Theia API Documentation v1.76.0
    Preparing search index...

    Decides which models the model picker in the AI chat input offers.

    Discovery registers everything a provider offers, including one entry per release, which is far more than anyone picks between while chatting. What that picker shows is therefore the favorites: the models that are featured automatically plus the ones the user marked. Everywhere a model is chosen deliberately — an agent's model, a model alias — every discovered model stays on offer.

    A model is featured when it is one of the FEATURED_MODEL_COUNT most recently released undated ids of its provider — so claude-opus-5 is featured while claude-opus-5-20260401 is not. Because the featured set is derived from each discovery rather than stored, a model released tomorrow is offered the day it appears, and the user cannot end up pinned to a stale line-up.

    Both directions are the user's to override, and only the override is stored: a model offered by default is taken out of the picker by an entry in PREFERENCE_NAME_HIDDEN_MODELS, any other model is put into it by an entry in PREFERENCE_NAME_FAVORITE_MODELS. A model nobody touched appears in neither.

    Models of a provider that does not participate in discovery — one whose models are configured by hand, or a custom endpoint — are all favorites: listing them was the user's choice.

    Index

    Constructors

    Properties

    derived: undefined | DerivedFavorites

    Memoized getDerived, dropped whenever a discovery reports something new.

    onDidChange: Event<void> = ...

    Fired when the marked models or the featured set change.

    onDidChangeEmitter: Emitter<void> = ...
    preferenceService: PreferenceService

    Methods

    • Whether the user decided anything about this provider's models, i.e. whether resetting it to the models it offers by default would change what the picker shows.

      Parameters

      • modelIdPrefix: string

        prefix of the provider's registered model ids, e.g. openai

      Returns boolean

    • Whether the picker would offer this model without the user marking it: one of the newest of a provider that discovers, or any model of a provider that does not. Nothing was discovered for the latter, so its models are there because someone put them there - a manually configured provider, or a custom endpoint. That is choice enough.

      Parameters

      • modelId: string

      Returns boolean

    • Drops what the user decided about one provider's models, so the picker shows the models that provider offers by default again. The other providers are left alone.

      Parameters

      • modelIdPrefix: string

        prefix of the provider's registered model ids, e.g. openai

      Returns Promise<void>

    • The models of one provider that are offered automatically: at most FEATURED_MODEL_COUNT of its undated ids. A release-pinned id is never featured — the undated form of the same model already is, and pinning a release is the deliberate choice the switch on its row makes.

      They are ranked by what the provider reports about them, in that order:

      1. most recently released, where the provider reports release dates (Anthropic, OpenAI);
      2. a -latest pointer the provider maintains at the current model of a family, which only decides where there are no dates: a provider that reports them dates its pointers as well;
      3. highest version in the id, which is what is left for Gemini — the naming of those models carries their generation (gemini-3.7-flash over gemini-2.5-pro).

      What the model aliases name has no say in this: an alias is a curated list of its own, pointing at the model a purpose should use, which is a different question from which models are worth offering in the picker.

      An explicitly configured list (modelOverrides) is featured in full: the user named it. So is a provider's own nomination (DiscoveredModel.featured), which a provider makes when the generic ranking cannot serve it — Copilot carries models of many vendors and nominates one each of the three the other providers offer directly, where "the newest five" would pick five of whichever vendor numbers its models highest.

      Parameters

      Returns DiscoveredModel[]

    • Puts a model into the picker or takes it out of it, whichever the current state calls for. Only the deviation from the default is stored: a model offered by default is taken out by an entry in the hidden list, and any other by dropping its entry from the favorites (or adding one).

      Parameters

      • modelId: string

      Returns Promise<void>