Skip to content

resolveInitModel

resolveInitModel(providerId): Promise<string | undefined>

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

Resolve the model id that init should bake into a generated config for a provider (CFG-14) — the safeguard against writing a speculative id that 404s once the model is retired.

  • Live discovery possible (a key / running daemon and a responding /v1/models endpoint): returns a verified-present id — the highest-ranked curated ⭐ id that is actually in the live list (matched tolerant of an :latest suffix), or, when no curated id is live, the first live id.
  • Live discovery impossible (kind: 'none', no key, offline, empty catalog): returns undefined. This is the ONLY speculative path, and it deliberately declines to invent a literal: the caller OMITS model so the provider factory falls back to getCuratedFallbackModel at run time (a single curated source that upgrades with the installed version).

Never throws — a bad key or network error degrades to undefined, mirroring discoverModels.

ProviderId

Promise<string | undefined>