discoverModels
discoverModels(
providerId,options?):Promise<ModelInfo[]>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/providers/modelDiscovery.ts:617
Discover the models for a single provider.
kind: 'none'→ returns the curatedbuildModelList(descriptor).kind: 'openai' | 'anthropic'→ fetches the models endpoint with a short timeout, parsesdata[].id, applies the chat-onlyfilter, and overlays the ⭐ preferred flags viabuildModelList(descriptor, liveIds).kind: 'google'→ fetches the native ListModels endpoint, parsesmodels[].namekeeping onlygenerateContent-capable entries and stripping themodels/prefix, then overlays the ⭐ preferred flags likewise.
Best-effort: any error / non-2xx / malformed / empty payload falls back to the curated list. This function NEVER throws — a bad key must degrade to the curated catalog, not break first-run config.
Cloud providers are only probed live when an API key is present; without a key the curated catalog is returned directly. Ollama (no key, local daemon) is always probed.
Parameters
Section titled “Parameters”providerId
Section titled “providerId”options?
Section titled “options?”Returns
Section titled “Returns”Promise<ModelInfo[]>