Skip to content

Chat: Show provider instance name for duplicate BYOK models in model picker#312028

Merged
lramos15 merged 4 commits into
microsoft:mainfrom
fishcharlie:issue-312025-model-picker-provider-instance-label
Apr 24, 2026
Merged

Chat: Show provider instance name for duplicate BYOK models in model picker#312028
lramos15 merged 4 commits into
microsoft:mainfrom
fishcharlie:issue-312025-model-picker-provider-instance-label

Conversation

@fishcharlie

Copy link
Copy Markdown
Contributor

Summary

This PR updates Chat model picker labeling for grouped language model providers so duplicate models from the same vendor are distinguishable by provider instance name.

Specifically, when resolving grouped models, the displayed model detail now uses the configured provider group name (for example, Local MacBook, Remote Linux) instead of the generic vendor label (for example, Ollama).

Fixes #312025

Problem

When users configure multiple Ollama providers and those providers expose overlapping model names, the model picker showed the same generic label for each duplicate row. That made it unclear which backend was being selected.

Change

  • In grouped language-model resolution, model detail is overridden with the user-configured provider group name.
  • This preserves unique context per provider instance in the picker while keeping the rest of model metadata behavior unchanged.

Why this approach

  • Centralized fix in grouped model resolution path.
  • Works for duplicate models across multiple instances of the same vendor.
  • Avoids provider-specific special handling.

Tests

Automated

  • Added unit test suite: LanguageModels - Provider Group Detail Override.
  • Test validates that two groups from the same vendor resolve the same model id with different detail values matching group names.

Manual

  1. Configure two Ollama providers with different names.
  2. Ensure both providers expose at least one duplicate model.
  3. Open Chat model picker.
  4. Verify duplicate model rows now show provider instance names (group names), not a generic Ollama label.

Screenshots

Before

Screenshot 2026-04-22 at 4 37 32 PM

After

Screenshot 2026-04-22 at 4 30 36 PM Screenshot 2026-04-22 at 4 30 49 PM

Risk and impact

  • Low risk: change is limited to grouped model metadata detail in picker-related model resolution.
  • No expected behavior change for non-grouped providers.
When resolving grouped language model providers, replace model metadata detail with the configured group name. This lets users distinguish duplicate models from multiple instances of the same vendor (for example Local vs Remote Ollama).

Also adds a unit test that verifies two groups from the same vendor produce distinct detail labels in the picker metadata.

Signed-off-by: Charlie Fish <contact@charlie.fish>
Copilot AI review requested due to automatic review settings April 22, 2026 22:38

Copilot AI left a comment

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.

Pull request overview

This PR improves Chat’s model picker labeling for grouped language model providers so that duplicate models from the same vendor can be distinguished by the configured provider instance (group) name.

Changes:

  • Override grouped language model metadata.detail to use the provider group name during grouped model resolution.
  • Add a unit test validating that the same model ID exposed by multiple groups resolves with distinct detail values matching the group names.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/chat/common/languageModels.ts Overrides grouped model metadata.detail with the configured provider group name during model resolution.
src/vs/workbench/contrib/chat/test/common/languageModels.test.ts Adds a unit test ensuring grouped instances produce distinct detail values for duplicate models.
Comment thread src/vs/workbench/contrib/chat/common/languageModels.ts Outdated
Co-authored-by: Copilot <copilot@github.com>
@lramos15

Copy link
Copy Markdown
Member

How do we feel about just not setting detail in the chat extension and then if detail isn't set we set it to Group name. That way we aren't making assumptions that extensions are setting vendor = detail or having to iterate the model list creating a clean separation of concerns by basically providing a reasonable default

@fishcharlie

Copy link
Copy Markdown
Contributor Author

@lramos15 Should be addressed in dd70562

@lramos15 lramos15 enabled auto-merge (squash) April 23, 2026 17:58
@lramos15 lramos15 merged commit 5407371 into microsoft:main Apr 24, 2026
26 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 24, 2026
@fishcharlie fishcharlie deleted the issue-312025-model-picker-provider-instance-label branch April 24, 2026 19:18
@fishcharlie

Copy link
Copy Markdown
Contributor Author

@lramos15 Seems like this broke in a recent Insiders build.

@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants