Files
archie/ui/src/settings/model-choices.ts
T
sam 12b9a57404 feat(config): model aliases replace model roles, resolved by one resolver
Agent steps, implement, pr-review, MCP sampling, chat, embedding and
transcription resolve a model alias (empty means the purpose's default)
and fail on an unknown alias instead of falling back. The step editor and
chat pick aliases; workflow definitions naming an unknown alias are
refused on save.
2026-10-10 17:29:52 +11:00

16 lines
727 B
TypeScript

import type { CatalogProvider } from "./types.ts";
/** aliasModelOptions lists "provider/model" for every model of a configured
* provider: an alias can only point at a provider Archie is set up to call. */
export function aliasModelOptions(catalog: CatalogProvider[], configured: string[]): string[] {
return catalog
.filter((p) => configured.includes(p.id))
.flatMap((p) => p.models.map((m) => `${p.id}/${m}`));
}
/** availableProviders is what the catalog found usable but is not configured
* yet, the providers Settings offers to enable. */
export function availableProviders(catalog: CatalogProvider[], configured: string[]): CatalogProvider[] {
return catalog.filter((p) => !configured.includes(p.id));
}