Skip to content

Conversation

lucas-koehler
Copy link
Contributor

@lucas-koehler lucas-koehler commented Jun 6, 2025

What it does

Initial implementation of #15395

Introduces support for AI model aliases to facilitate updating many agents' used models at once.
An alias either points to a single model selected by the user or a chain of default/fallback models to consider in priority order.
For the fallback chain, the first ready model (e.g. has an API key configured) is used. For this the language model was extended with a status to be set by its manager.

  • Introduces a language model alias registry for registering and retrieving model aliases and chains
  • Adds support for chains of default model aliases (code, universal, code completion, summarize)
  • Selects the first available model (with an API key) from the chain when resolving an alias; falls back to the first in the chain if none are ready
  • Enables users to point an alias to use a specific model
  • Extends language models to track readiness (e.g., whether an API key is set)
  • Adds a new Model Aliases tab to the the AI configuration UI to:
    • Display alias chains
    • Select a mode for an alias

How to test

  • Open AI configuration view -> agents configuration
  • Select an agent (e.g. Coder)
  • Open the language model dropdown. Observe:
    • there are 4 aliases at the top of the dropdown
    • models you don't have an API key are not selectable and show a tooltip when hovering over them
  • Select the "default/code" alias
  • Go to the new Model Aliases tab in the AI configuration view
  • Have an anthropic key configured
  • open a chat and request something
  • observe: tokens for claude 3.7 are used
  • remove api key for anthropic and have a openai key configured
  • do another request
  • observe: tokens for gpt 4.1 are used
  • select a model explicitly for the default/code alias (e.g. gpt-4.1-nano)
  • do another request and observe tokens for the selected model are used

Follow-ups

  • Render Agents using an alias in alias view (@sgraband has a WIP implementation)
  • Show resolved model for an alias in alias config view and in agent config view
  • Display in chain the ones that are ready and the one that is chosen (only if applicable)
  • Configure aliases as default models for agents
  • Define fallbackchains for aliases
  • Better display that a model is not ready just disabled for now
  • Allow to add aliases

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Jun 6, 2025
@ndoschek ndoschek mentioned this pull request Jun 11, 2025
61 tasks
@sgraband sgraband force-pushed the issues/15395-model-aliases branch from 7b55b3b to fc65afb Compare June 12, 2025 08:07
@ndoschek ndoschek requested a review from sdirix June 12, 2025 13:40
@sgraband sgraband force-pushed the issues/15395-model-aliases branch from 57abfe7 to 6e6566d Compare June 18, 2025 07:55
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Does not work for me. When testing on latest master, Theia AI works as expected. When I start from this PR, then all models are gone.

There are a lot of errors in the console which are likely the cause of this:

ERROR Error: You are attempting to construct Symbol(AnthropicLanguageModelsManager) in a synchronous way but it has asynchronous dependencies.
ERROR Error: You are attempting to construct Symbol(LanguageModelRegistryFrontendDelegate) in a synchronous way but it has asynchronous dependencies.
[...]
ERROR Uncaught Exception:  Error: No matching bindings found for serviceIdentifier: Symbol(LanguageModelAliasRegistry)
Trying to resolve bindings for "BackendLanguageModelRegistry"
ERROR Error: No matching bindings found for serviceIdentifier: Symbol(LanguageModelAliasRegistry)

@github-project-automation github-project-automation bot moved this from Waiting on reviewers to Waiting on author in PR Backlog Jun 23, 2025
@ndoschek ndoschek mentioned this pull request Jun 24, 2025
15 tasks
@sgraband sgraband force-pushed the issues/15395-model-aliases branch from 143fcc7 to c81c0f2 Compare June 30, 2025 11:44
@sgraband sgraband requested a review from sdirix June 30, 2025 11:44
@sgraband
Copy link
Contributor

@sdirix Thanks for the feedback. I incorporated most of it and also fixed the regression you reported. I added comments on two of your suggestions. Could you take another look?

@sgraband sgraband force-pushed the issues/15395-model-aliases branch 2 times, most recently from 6337ccd to bcabb50 Compare July 7, 2025 10:03
@sgraband sgraband requested a review from sdirix July 7, 2025 10:03
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

In general the functionality works. However regarding UX and feature set there are quite a lot of things to be improved.

@sgraband sgraband force-pushed the issues/15395-model-aliases branch 2 times, most recently from bee21fe to 393c0f0 Compare July 23, 2025 11:28
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Works for me! I only have minor comments left. Feel free to tackle them here or log them as follow ups

@github-project-automation github-project-automation bot moved this from Waiting on author to Needs merge in PR Backlog Jul 28, 2025
@sgraband
Copy link
Contributor

@JonasHelming Could you go over the proposed aliases here and adjust which ones should be available, which models they should reference and the description. And then change the default model of the agents to a suitable alias and just add this as an commit on this PR?

@JonasHelming
Copy link
Contributor

I would go:

    {
        id: 'default/code',
        defaultModelIds: [
            'anthropic/claude-3-7-sonnet-latest',
            'openai/gpt-4.1',
            'google/gemini-2.5-pro-exp-03-25'
        ],
        description: 'Optimized for code understanding and generation tasks.'
    },
    {
        id: 'default/universal',
        defaultModelIds: [
            'openai/gpt-4o',
            'anthropic/claude-3-7-sonnet-latest',
            'google/gemini-2.5-pro-exp-03-25'
        ],
        description: 'Well-balanced for both code and general language use.'
    },
    {
        id: 'default/code-completion',
        defaultModelIds: [
            'openai/gpt-4.1',
            'anthropic/claude-3-7-sonnet-latest',
            'google/gemini-2.5-pro-exp-03-25'
        ],
        description: 'Best suited for code autocompletion scenarios.'
    },
    {
        id: 'default/summarize',
        defaultModelIds: [
            'openai/gpt-4.1',
            'anthropic/claude-3-7-sonnet-latest',
            'google/gemini-2.5-pro-exp-03-25'
        ],
        description: 'Models prioritized for summarization and condensation of content.'
    }
];

@sgraband sgraband force-pushed the issues/15395-model-aliases branch from fc13df6 to 184753b Compare July 30, 2025 09:52
sgraband and others added 2 commits July 30, 2025 11:54
Initial implementation of #15395

Introduces support for AI model aliases to facilitate updating many agents' used models at once.
An alias either points to a single model selected by the user or a chain of default/fallback models to consider in priority order.
For the fallback chain, the first ready model (e.g. has an API key configured) is used. For this the language model was extended with a status to be set by its manager.

- Introduces a language model alias registry for registering and retrieving model aliases and chains
- Adds support for chains of default model aliases (`code`, `universal`, `code completion`, `summarize`)
- Selects the first available model (with an API key) from the chain when resolving an alias; falls back to the first in the chain if none are ready
- Enables users to point an alias to use a specific model
- Extends language models to track readiness (e.g., whether an API key is set)
- Adds a new Model Aliases tab to the the AI configuration UI to:
  - Display alias chains
  - Select a mode for an alias

Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
Co-authored-by: Lucas Koehler <lkoehler@eclipsesource.com>
Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>
Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
@sgraband sgraband force-pushed the issues/15395-model-aliases branch from 184753b to cc13d53 Compare July 30, 2025 09:54
@sgraband
Copy link
Contributor

@JonasHelming could you take a look at the assignment between agents and aliases? Best to just delete your ai-features.agentSettings block in the settings.json.

@sdirix Could you take a look at the changes of this commit? This was needed to properly render the agents using this alias if the setting was not set.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

I deleted all my ai-feature preferences and the tool worked as expected

sgraband added 2 commits July 30, 2025 14:53
Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
Previously the alias would not be associated with the agent if the setting was empty.

Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
@sgraband sgraband force-pushed the issues/15395-model-aliases branch from cc13d53 to 93a56e5 Compare July 30, 2025 12:53
@sgraband sgraband merged commit 442802e into master Jul 30, 2025
9 of 11 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Jul 30, 2025
@github-actions github-actions bot added this to the 1.64.0 milestone Jul 30, 2025
@JonasHelming
Copy link
Contributor

@sgraband The follow up section above mentions: "Configure aliases as default models for agents" => isn't this done?

@sgraband
Copy link
Contributor

sgraband commented Aug 5, 2025

Yes. Since i already created a follow-up. I did not update this further.

laemmleint pushed a commit to mvtecsoftware/theia that referenced this pull request Aug 18, 2025
Initial implementation of eclipse-theia#15395

Introduces support for AI model aliases to facilitate updating many agents' used models at once.
An alias either points to a single model selected by the user or a chain of default/fallback models to consider in priority order.
For the fallback chain, the first ready model (e.g. has an API key configured) is used. For this the language model was extended with a status to be set by its manager.

- Introduces a language model alias registry for registering and retrieving model aliases and chains
- Adds support for chains of default model aliases (`code`, `universal`, `code completion`, `summarize`)
- Selects the first available model (with an API key) from the chain when resolving an alias; falls back to the first in the chain if none are ready
- Enables users to point an alias to use a specific model
- Extends language models to track readiness (e.g., whether an API key is set)
- Adds a new Model Aliases tab to the the AI configuration UI to:
  - Display alias chains
  - Select a mode for an alias

Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
Co-authored-by: Simon Graband <sgraband@eclipsesource.com>
Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants