Skip to content

buildModelList

buildModelList(descriptor, discoveredModels?): ModelInfo[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/providers/modelDiscovery.ts:355

Build the ModelInfo list for a provider given the descriptor and an optional set of model ids known to actually exist (e.g. from a live /v1/models query or the local Ollama daemon).

  • When discoveredModels is omitted, the curated preferredModels are returned, all flagged ⭐ preferred.
  • When provided, every discovered model is listed; those that also appear in the curated preferredModels are flagged ⭐ preferred. The list is ordered preferred first (in curated order, so the recommended default sits on top and is pre-selected), then every other discovered model alphabetically — so a large catalog (e.g. OpenRouter’s 200+ models) is navigable instead of arriving in the endpoint’s arbitrary order.

ProviderDescriptor

string[]

ModelInfo[]