Skip to content

[AI Connector][Inference endpoint] Creation: adaptive allocations not set correctly on serverless#251357

Merged
saikatsarkar056 merged 25 commits intoelastic:mainfrom
saikatsarkar056:fix_adaptive_allocation
Feb 23, 2026
Merged

[AI Connector][Inference endpoint] Creation: adaptive allocations not set correctly on serverless#251357
saikatsarkar056 merged 25 commits intoelastic:mainfrom
saikatsarkar056:fix_adaptive_allocation

Conversation

@saikatsarkar056
Copy link
Copy Markdown
Contributor

@saikatsarkar056 saikatsarkar056 commented Feb 2, 2026

Summary

Fixes AI Connector inference endpoint creation failing on serverless when using the 'elasticsearch' provider with adaptive allocations enabled.

The issue was that num_threads and num_allocations were being sent in the providerConfig alongside adaptive_allocations, which causes a conflict since these properties cannot be set when adaptive allocations is enabled.

This PR updates the form serializer to exclude num_threads and num_allocations from the payload when adaptive allocations is configured.

Screen.Recording.2026-02-02.at.2.58.32.PM.mov

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

Release note

Fixes AI Connector creation on serverless failing when adaptive allocations is enabled with the ElasticSearch provider.

@saikatsarkar056 saikatsarkar056 requested review from a team as code owners February 2, 2026 22:12
@saikatsarkar056 saikatsarkar056 changed the title Fix adaptive allocation [AI Connector][Inference endpoint] Creation: adaptive allocations not set correctly on serverless Feb 2, 2026
@saikatsarkar056 saikatsarkar056 self-assigned this Feb 2, 2026
@saikatsarkar056 saikatsarkar056 requested a review from a team as a code owner February 3, 2026 00:39
@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

This PR is blocked due to an backend error. Inference team is looking into the issue now. Once fixed, we can test the UI changes.

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

}
: {}),
: {
...(numAllocations !== undefined ? { num_allocations: numAllocations } : {}),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for clarity - why is this change to the serializer needed?
This is explicitly checking for undefined - is it possible for numAllocations to be null?

Copy link
Copy Markdown
Contributor Author

@saikatsarkar056 saikatsarkar056 Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When editing an endpoint on serverless, num_allocations was inside providerConfig and was being sent in the update request. However, Elasticsearch does not allow this field on serverless, so we need to remove it.

The cleanest solution is to remove (destructure) num_allocations from providerConfig at the beginning. After doing that, restProviderConfig will no longer include it.

For serverless, this is correct — the field should not be sent.
For stateful deployments, we still need num_allocations, so we add it back explicitly.

Copy link
Copy Markdown
Contributor Author

@saikatsarkar056 saikatsarkar056 Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible for numAllocations to be null?

Yes. There is no num_allocations field for OpenAI

...(config?.providerConfig?.num_allocations !== undefined && {
num_allocations: config.providerConfig.num_allocations,
}),
...(adaptiveAllocations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ease of understanding and maintenance, we should follow the kibana styleguide and not use nested ternary operators.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

}),
...(adaptiveAllocations
? { adaptive_allocations: adaptiveAllocations }
: numAllocations !== undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this numAllocations undefined check - is it possible that it could be null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be null for OpenAI

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@saikatsarkar056 saikatsarkar056 enabled auto-merge (squash) February 23, 2026 17:00
Copy link
Copy Markdown
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM ⚡

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

cc @saikatsarkar056

@saikatsarkar056 saikatsarkar056 merged commit 82dc85e into elastic:main Feb 23, 2026
16 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.3

https://github.com/elastic/kibana/actions/runs/22320695468

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.3 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 251357

Questions ?

Please refer to the Backport tool documentation

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

saikatsarkar056 added a commit to saikatsarkar056/kibana that referenced this pull request Feb 23, 2026
… set correctly on serverless (elastic#251357)

## Summary

Fixes AI Connector inference endpoint creation failing on serverless
when using the 'elasticsearch' provider with adaptive allocations
enabled.

The issue was that `num_threads` and `num_allocations` were being sent
in the `providerConfig` alongside `adaptive_allocations`, which causes a
conflict since these properties cannot be set when adaptive allocations
is enabled.

This PR updates the form serializer to exclude `num_threads` and
`num_allocations` from the payload when adaptive allocations is
configured.

https://github.com/user-attachments/assets/5d4b42ff-db33-4f3a-ab70-b32fcccbc445

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

### Release note
Fixes AI Connector creation on serverless failing when adaptive
allocations is enabled with the ElasticSearch provider.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Melissa <melissa.alvarez@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 82dc85e)

# Conflicts:
#	x-pack/platform/packages/shared/kbn-inference-endpoint-ui-common/src/components/inference_flyout_wrapper.test.tsx
saikatsarkar056 added a commit to saikatsarkar056/kibana that referenced this pull request Feb 23, 2026
… set correctly on serverless (elastic#251357)

## Summary

Fixes AI Connector inference endpoint creation failing on serverless
when using the 'elasticsearch' provider with adaptive allocations
enabled.

The issue was that `num_threads` and `num_allocations` were being sent
in the `providerConfig` alongside `adaptive_allocations`, which causes a
conflict since these properties cannot be set when adaptive allocations
is enabled.

This PR updates the form serializer to exclude `num_threads` and
`num_allocations` from the payload when adaptive allocations is
configured.

https://github.com/user-attachments/assets/5d4b42ff-db33-4f3a-ab70-b32fcccbc445

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

### Release note
Fixes AI Connector creation on serverless failing when adaptive
allocations is enabled with the ElasticSearch provider.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Melissa <melissa.alvarez@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 82dc85e)
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	x-pack/platform/packages/shared/kbn-inference-endpoint-ui-common/src/components/inference_flyout_wrapper.test.tsx
saikatsarkar056 added a commit to saikatsarkar056/kibana that referenced this pull request Feb 23, 2026
… set correctly on serverless (elastic#251357)

## Summary

Fixes AI Connector inference endpoint creation failing on serverless
when using the 'elasticsearch' provider with adaptive allocations
enabled.

The issue was that `num_threads` and `num_allocations` were being sent
in the `providerConfig` alongside `adaptive_allocations`, which causes a
conflict since these properties cannot be set when adaptive allocations
is enabled.

This PR updates the form serializer to exclude `num_threads` and
`num_allocations` from the payload when adaptive allocations is
configured.

https://github.com/user-attachments/assets/5d4b42ff-db33-4f3a-ab70-b32fcccbc445

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

### Release note
Fixes AI Connector creation on serverless failing when adaptive
allocations is enabled with the ElasticSearch provider.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Melissa <melissa.alvarez@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 82dc85e)
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	x-pack/platform/packages/shared/kbn-inference-endpoint-ui-common/src/components/inference_flyout_wrapper.test.tsx
saikatsarkar056 added a commit that referenced this pull request Feb 23, 2026
…ns not set correctly on serverless (#251357) (#254585)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[AI Connector][Inference endpoint] Creation: adaptive allocations not
set correctly on serverless
(#251357)](#251357)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Saikat
Sarkar","email":"132922331+saikatsarkar056@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-02-23T19:04:49Z","message":"[AI
Connector][Inference endpoint] Creation: adaptive allocations not set
correctly on serverless (#251357)\n\n## Summary\n\nFixes AI Connector
inference endpoint creation failing on serverless\nwhen using the
'elasticsearch' provider with adaptive allocations\nenabled.\n\nThe
issue was that `num_threads` and `num_allocations` were being sent\nin
the `providerConfig` alongside `adaptive_allocations`, which causes
a\nconflict since these properties cannot be set when adaptive
allocations\nis enabled.\n\nThis PR updates the form serializer to
exclude `num_threads` and\n`num_allocations` from the payload when
adaptive allocations
is\nconfigured.\n\n\n\nhttps://github.com/user-attachments/assets/5d4b42ff-db33-4f3a-ab70-b32fcccbc445\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n\n### Release note\nFixes AI Connector creation on serverless
failing when adaptive\nallocations is enabled with the ElasticSearch
provider.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Melissa <melissa.alvarez@elastic.co>\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"82dc85e41b82908e61c9afc0f9ab18dc4a734172","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Search","backport:version","v9.3.0","v9.4.0"],"title":"[AI
Connector][Inference endpoint] Creation: adaptive allocations not set
correctly on
serverless","number":251357,"url":"https://github.com/elastic/kibana/pull/251357","mergeCommit":{"message":"[AI
Connector][Inference endpoint] Creation: adaptive allocations not set
correctly on serverless (#251357)\n\n## Summary\n\nFixes AI Connector
inference endpoint creation failing on serverless\nwhen using the
'elasticsearch' provider with adaptive allocations\nenabled.\n\nThe
issue was that `num_threads` and `num_allocations` were being sent\nin
the `providerConfig` alongside `adaptive_allocations`, which causes
a\nconflict since these properties cannot be set when adaptive
allocations\nis enabled.\n\nThis PR updates the form serializer to
exclude `num_threads` and\n`num_allocations` from the payload when
adaptive allocations
is\nconfigured.\n\n\n\nhttps://github.com/user-attachments/assets/5d4b42ff-db33-4f3a-ab70-b32fcccbc445\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n\n### Release note\nFixes AI Connector creation on serverless
failing when adaptive\nallocations is enabled with the ElasticSearch
provider.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Melissa <melissa.alvarez@elastic.co>\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"82dc85e41b82908e61c9afc0f9ab18dc4a734172"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/251357","number":251357,"mergeCommit":{"message":"[AI
Connector][Inference endpoint] Creation: adaptive allocations not set
correctly on serverless (#251357)\n\n## Summary\n\nFixes AI Connector
inference endpoint creation failing on serverless\nwhen using the
'elasticsearch' provider with adaptive allocations\nenabled.\n\nThe
issue was that `num_threads` and `num_allocations` were being sent\nin
the `providerConfig` alongside `adaptive_allocations`, which causes
a\nconflict since these properties cannot be set when adaptive
allocations\nis enabled.\n\nThis PR updates the form serializer to
exclude `num_threads` and\n`num_allocations` from the payload when
adaptive allocations
is\nconfigured.\n\n\n\nhttps://github.com/user-attachments/assets/5d4b42ff-db33-4f3a-ab70-b32fcccbc445\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n\n### Release note\nFixes AI Connector creation on serverless
failing when adaptive\nallocations is enabled with the ElasticSearch
provider.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Melissa <melissa.alvarez@elastic.co>\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"82dc85e41b82908e61c9afc0f9ab18dc4a734172"}}]}]
BACKPORT-->
bhapas pushed a commit to bhapas/kibana that referenced this pull request Feb 25, 2026
… set correctly on serverless (elastic#251357)

## Summary

Fixes AI Connector inference endpoint creation failing on serverless
when using the 'elasticsearch' provider with adaptive allocations
enabled.

The issue was that `num_threads` and `num_allocations` were being sent
in the `providerConfig` alongside `adaptive_allocations`, which causes a
conflict since these properties cannot be set when adaptive allocations
is enabled.

This PR updates the form serializer to exclude `num_threads` and
`num_allocations` from the payload when adaptive allocations is
configured.



https://github.com/user-attachments/assets/5d4b42ff-db33-4f3a-ab70-b32fcccbc445



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...


### Release note
Fixes AI Connector creation on serverless failing when adaptive
allocations is enabled with the ElasticSearch provider.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Melissa <melissa.alvarez@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants