Skip to content

Add default model population for AI Connector service providers#250506

Merged
saikatsarkar056 merged 19 commits intoelastic:mainfrom
saikatsarkar056:default_model
Feb 3, 2026
Merged

Add default model population for AI Connector service providers#250506
saikatsarkar056 merged 19 commits intoelastic:mainfrom
saikatsarkar056:default_model

Conversation

@saikatsarkar056
Copy link
Copy Markdown
Contributor

@saikatsarkar056 saikatsarkar056 commented Jan 27, 2026

Summary

Users currently have to manually search for and enter model names when configuring AI connectors, which is error-prone and time-consuming. This change auto-populates the model field with recommended defaults, eliminating the need to look up model identifiers.

Screen.Recording.2026-01-27.at.10.28.36.AM.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

Improves AI connector setup by auto-populating the model field with recommended defaults, so users no longer need to search for and manually enter model identifiers.

@saikatsarkar056 saikatsarkar056 requested a review from a team as a code owner January 27, 2026 00:40
@saikatsarkar056 saikatsarkar056 marked this pull request as draft January 27, 2026 00:40
@saikatsarkar056 saikatsarkar056 self-assigned this Jan 27, 2026
@alvarezmelissa87 alvarezmelissa87 self-requested a review January 28, 2026 15:48
export const MAX_NUMBER_OF_ALLOCATIONS = 'max_number_of_allocations';
export const CONTEXT_WINDOW_LENGTH = 'contextWindowLength';

export const DEFAULT_MODELS: Partial<Record<ServiceProviderKeys, string>> = {
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.

I think it makes more sense to add these default models to the INTERNAL_OVERRIDE_FIELDS. These are used in the mapProviderFields helper function where we already set a default_value if the field config has one. The model id default could be set there. It also keeps these internal changes that are service specific in one place and easier to track.

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

* @param providerService - the service provider identifier
* @returns the default model string if available, otherwise null
*/
function getDefaultModelValue(
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.

A function like this should go in helpers.ts to keep this file size manageable.

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

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.

Thanks so much for your work on this! 🙏 Left a couple of comments.

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@alvarezmelissa87
Copy link
Copy Markdown
Contributor

alvarezmelissa87 commented Jan 29, 2026

@saikatsarkar056 - gave this a test and there's an issue with trying to delete the model id to input something else. Just keeps resetting. Likely need to add some logic to add default value only once. Just checked some other providers and looks like this is a bug that's been around and unrelated to your changes. 🤔 Would be good to get that bug fixed prior to merging this as the modelId is very important for the user to be able to edit. (Link to kibana issue)

modelIdDefaultBug.mov

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@saikatsarkar056 - gave this a test and there's an issue with trying to delete the model id to input something else. Just keeps resetting. Likely need to add some logic to add default value only once. Just checked some other providers and looks like this is a bug that's been around and unrelated to your changes. 🤔 Would be good to get that bug fixed prior to merging this as the modelId is very important for the user to be able to edit. (Link to kibana issue)

modelIdDefaultBug.mov

@alvarezmelissa87 This PR will fix the issue.

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

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.

Tested and working as expected. (Once this fix is in).
LGTM ⚡

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

Tested and working as expected. (Once this fix is in). LGTM ⚡

@alvarezmelissa87 The fix is added into this PR. The CI was green. Could you please review once more? Thank you.

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #13 / Agent Builder tools MCP tools creating MCP tools should create an MCP tool by selecting connector and tool

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
agentBuilder 1426 1428 +2
indexManagement 705 708 +3
searchInferenceEndpoints 163 166 +3
securitySolution 8705 8707 +2
total +10

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/inference-endpoint-ui-common 179 190 +11

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
agentBuilder 554.1KB 554.4KB +288.0B
indexManagement 739.1KB 739.6KB +469.0B
searchInferenceEndpoints 142.9KB 143.4KB +473.0B
searchPlayground 246.2KB 246.3KB +63.0B
securitySolution 10.9MB 10.9MB +573.0B
stackConnectors 1.1MB 1.1MB +204.0B
total +2.0KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 172.0KB 172.0KB -1.0B
Unknown metric groups

API count

id before after diff
@kbn/inference-endpoint-ui-common 179 192 +13

History

cc @saikatsarkar056

@saikatsarkar056 saikatsarkar056 merged commit 1d9a659 into elastic:main Feb 3, 2026
16 checks passed
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.

4 participants