@agentproto/model-catalog 0.12.6 → 0.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/registry/index.ts"],"names":["resolveAlias"],"mappings":";;;;;;;;;;;;;;;;AAsCA,SAAS,WAAA,CAAY,IAAY,EAAA,EAA2B;AAC1D,EAAA,IAAI,GAAA,GAAM,EAAA;AACV,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,WAAS;AACP,IAAA,MAAM,IAAA,GAAO,EAAA,CAAG,OAAA,CAAQ,GAAG,CAAA;AAC3B,IAAA,IAAI,IAAA,KAAS,MAAA,IAAa,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA,EAAG;AACzC,IAAA,IAAA,CAAK,IAAI,GAAG,CAAA;AACZ,IAAA,GAAA,GAAM,IAAA;AAAA,EACR;AACA,EAAA,OAAO,GAAA;AACT;AAGA,SAAS,YAAA,CAAa,IAAmB,GAAA,EAAuC;AAC9E,EAAA,OAAO,GAAG,KAAA,CAAM,IAAA;AAAA,IACd,CAAA,CAAA,KACE,CAAA,CAAE,SAAA,KAAc,GAAA,IAChB,CAAA,CAAE,eAAA,KAAoB,GAAA,IAAA,CACrB,CAAA,CAAE,OAAA,IAAW,EAAC,EAAG,QAAA,CAAS,GAAG;AAAA,GAClC;AACF;AAuCA,IAAM,WAAA,GAAyC,IAAI,GAAA,CAAI;AAAA,EACrD,GAAG,cAAc,GAAA,CAAI,CAAA,CAAA,KAAK,CAAC,CAAA,CAAE,eAAA,EAAiB,CAAC,CAAU,CAAA;AAAA,EACzD,GAAG,cAAc,GAAA,CAAI,CAAA,CAAA,KAAK,CAAC,CAAA,CAAE,SAAA,EAAW,CAAC,CAAU,CAAA;AAAA,EACnD,GAAG,aAAA,CAAc,OAAA;AAAA,IAAQ,CAAC,CAAA,KAAA,CACvB,CAAA,CAAE,OAAA,IAAW,EAAC,EAAG,G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A,IAAI,EAAA,CAAG,GAAA,CAAI,GAAG,CAAA,EAAG,OAAO,GAAA;AACxB,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,WAAA,CAAY,GAAA,CAAI,GAAG,CAAA,EAAG,OAAO,GAAA;AACjC,EAAA,OAAO,aAAgB,GAAG,CAAA;AAC5B","file":"chunk-VDHRRWLK.mjs","sourcesContent":["/**\n * Cross-kind registry. Resolves a model id against every catalog (LLM,\n * image, video, audio) and returns a discriminated `ResolvedModel`.\n *\n * v1 returns the legacy per-kind data shapes verbatim — image/video keep\n * `*ModelDefinition`, LLM keeps `LLMPricing`, audio surfaces voices.\n * Callers (cost dispatcher, access evaluator) match on `.kind` and dig\n * into the per-kind payload as needed.\n */\n\nimport {\n LLM_PRICING_CATALOG,\n resolveAlias as resolveLlmAlias,\n resolvePricing,\n isKnownLlmId,\n listUnpricedKnownLlmIds,\n getModelProvider,\n type LLMPricing,\n} from \"../llm/index.js\"\nimport {\n IMAGE_MODEL_CATALOG,\n type ImageModelDefinition,\n} from \"../image/index.js\"\nimport {\n VIDEO_MODEL_CATALOG,\n type VideoModelDefinition,\n} from \"../video/index.js\"\nimport {\n AUDIO_MODEL_CATALOG,\n type AudioModelDefinition,\n} from \"../audio/index.js\"\nimport { VOICE_CATALOG, type CatalogVoice } from \"../voice/index.js\"\nimport { modelHasTag } from \"../enrichment/index.js\"\nimport { getMergedOverlay, type MergedOverlay } from \"../overlay/index.js\"\nimport { listRouterLlmRoutes, formatModelRef } from \"../route-identity/index.js\"\n\n/** Follow consumer-overlay alias hops to a concrete id (cycle-guarded).\n * Ids with no overlay alias pass through unchanged. */\nfunction followAlias(id: string, ov: MergedOverlay): string {\n let cur = id\n const seen = new Set<string>()\n for (;;) {\n const next = ov.aliases[cur]\n if (next === undefined || seen.has(cur)) break\n seen.add(cur)\n cur = next\n }\n return cur\n}\n\n/** Find an overlay voice by catalogId / providerVoiceId / alias. */\nfunction overlayVoice(ov: MergedOverlay, key: string): CatalogVoice | undefined {\n return ov.voice.find(\n v =>\n v.catalogId === key ||\n v.providerVoiceId === key ||\n (v.aliases ?? []).includes(key),\n )\n}\n\n/**\n * `audio` resolves to either an audio MODEL (priced TTS/STT) or a\n * voice (downstream metadata). Most call sites care about the model\n * (pricing, capabilities); a few (voice pickers) want the voice. They\n * share the resolver but discriminate on the inner payload.\n */\nexport type ResolvedModel =\n | {\n kind: \"llm\"\n id: string\n canonicalId: string\n /** Undefined for a real, known id with no pricing row yet — existence\n * and pricing are independent, see `LlmModelId`'s doc comment in\n * `llm/catalog.ts`. Every reader MUST handle the absent case; never\n * assume a `kind: \"llm\"` result is priced. */\n pricing: LLMPricing | undefined\n /** Best-effort provider even when `pricing` is absent (falls back to\n * `CONTEXT_WINDOWS`'s own provider field — see `getModelProvider`).\n * Prefer this over `pricing?.provider` when you only need routing. */\n provider: string | undefined\n }\n | { kind: \"image\"; id: string; def: ImageModelDefinition }\n | { kind: \"video\"; id: string; def: VideoModelDefinition }\n | { kind: \"audio\"; id: string; def: AudioModelDefinition }\n | { kind: \"voice\"; id: string; voice: CatalogVoice }\n\n/**\n * Every kind the registry can resolve. Broader than the catalog\n * `ModelKind` (llm/image/video/audio) because voices are a first-class\n * registry kind but not a priced model family. Derived from\n * `ResolvedModel` so it can never drift.\n */\nexport type CatalogKind = ResolvedModel[\"kind\"]\n\n// Voices resolve by canonical id (\"minimax-french-female-anchor\"), native\n// provider id (\"French_FemaleAnchor\"), or a consumer-overlay alias — index\n// all three so new slugs, native ids, and persisted operator rows all hit.\nconst VOICE_INDEX: Map<string, CatalogVoice> = new Map([\n ...VOICE_CATALOG.map(v => [v.providerVoiceId, v] as const),\n ...VOICE_CATALOG.map(v => [v.catalogId, v] as const),\n ...VOICE_CATALOG.flatMap((v: CatalogVoice) =>\n (v.aliases ?? []).map(a => [a, v] as const)\n ),\n])\n\n/**\n * Resolves a model id across every catalog.\n *\n * Lookup order: image → video → audio → LLM (last because LLM has the\n * partial-prefix fallback that can match other strings if probed first).\n *\n * Returns `undefined` for unknown ids — callers decide whether to throw\n * or fall back. LLM uses fallback pricing inside its own dispatcher\n * (preserves existing behavior at the orchestrator).\n */\nexport function getModel(id: string): ResolvedModel | undefined {\n // Consumer overlays first: resolve any overlay alias to a concrete id,\n // then let overlay entries override/extend the generated catalogs. The\n // returned `id` echoes what the caller asked for (alias-preserving), as\n // the legacy voice-alias path already did.\n const ov = getMergedOverlay()\n const key = followAlias(id, ov)\n\n if (ov.image[key]) return { kind: \"image\", id, def: ov.image[key]! }\n if (ov.video[key]) return { kind: \"video\", id, def: ov.video[key]! }\n if (ov.audio[key]) return { kind: \"audio\", id, def: ov.audio[key]! }\n const ovVoice = overlayVoice(ov, key)\n if (ovVoice) return { kind: \"voice\", id, voice: ovVoice }\n if (ov.llm[key]) {\n const pricing = ov.llm[key]!\n return { kind: \"llm\", id, canonicalId: key, pricing, provider: pricing.provider }\n }\n\n const imageDef = IMAGE_MODEL_CATALOG[key]\n if (imageDef) return { kind: \"image\", id, def: imageDef }\n\n const videoDef = VIDEO_MODEL_CATALOG[key]\n if (videoDef) return { kind: \"video\", id, def: videoDef }\n\n // Audio MODEL (priced TTS/STT) — checked before voice lookup so an\n // id that exists in both maps lands on the priced entry.\n const audioDef = AUDIO_MODEL_CATALOG[key]\n if (audioDef) return { kind: \"audio\", id, def: audioDef }\n\n const voice = VOICE_INDEX.get(key)\n if (voice) return { kind: \"voice\", id, voice }\n\n const llmPricing = resolvePricing(key)\n if (llmPricing) {\n const canonicalId = resolveLlmAlias(key)\n return { kind: \"llm\", id, canonicalId, pricing: llmPricing, provider: llmPricing.provider }\n }\n // Known id, no pricing row yet (see `LlmModelId`'s doc comment in\n // llm/catalog.ts) — still resolves, just unpriced. This is the case that\n // used to make a real, live, provider-published model (e.g. a brand-new\n // Anthropic release the day it ships, before the next pricing sync)\n // disappear from every downstream surface instead of showing up unpriced.\n if (isKnownLlmId(key)) {\n return { kind: \"llm\", id, canonicalId: key, pricing: undefined, provider: getModelProvider(key) }\n }\n\n return undefined\n}\n\n/**\n * Returns true iff the id is exposed to agents.\n *\n * - LLM: every entry in `LLM_PRICING_CATALOG` is considered visible\n * (legacy convention; refine in v2 with per-entry `agentVisible`).\n * - Image / Video: respects the `agentVisible` flag.\n * - Audio voices: all voices are visible (catalog itself is curated).\n */\nexport function isAgentVisible(id: string): boolean {\n const m = getModel(id)\n if (!m) return false\n switch (m.kind) {\n case \"image\":\n return m.def.agentVisible\n case \"video\":\n return m.def.agentVisible\n case \"audio\":\n return m.def.agentVisible\n case \"llm\":\n return (\n id in LLM_PRICING_CATALOG || resolveLlmAlias(id) in LLM_PRICING_CATALOG\n )\n case \"voice\":\n return true\n }\n}\n\nexport interface ListModelsFilter {\n kind?: CatalogKind\n /** Single provider (back-compat). Folded into `providers` internally. */\n provider?: string\n /** Provider OR-set — a model matches if its provider is any of these. */\n providers?: string[]\n /**\n * Capability tags a model must carry (ALL of them). Capabilities are\n * emitted as tags by enrichment — audio `tts`/`stt`/`s2s`, image\n * `edit`/`upscale`, video `i2v`/`t2v` — so this filters on the same\n * vocabulary `listModels({capabilities:[\"s2s\"]})` would expect.\n */\n capabilities?: string[]\n /** Arbitrary tags a model must carry (ALL of them). */\n tags?: string[]\n agentVisibleOnly?: boolean\n}\n\n/**\n * Cross-kind listing. Useful for catalog browsers and capability search.\n * Returns `ResolvedModel[]` (discriminated by kind).\n *\n * Provider is an OR-set (`providers` ∪ the singular `provider`); capability\n * and tag filters are AND-sets (a model must carry every listed value).\n * Composed: `listModels({ kind:\"audio\", capabilities:[\"s2s\"],\n * providers:[\"gemini-live\",\"openai-realtime\"] })` → all s2s models from\n * Gemini OR OpenAI.\n */\nexport function listModels(filter: ListModelsFilter = {}): ResolvedModel[] {\n const providerSet =\n filter.provider || filter.providers\n ? new Set([\n ...(filter.provider ? [filter.provider] : []),\n ...(filter.providers ?? []),\n ])\n : undefined\n const providerMatches = (provider: string | undefined): boolean =>\n !providerSet || (provider !== undefined && providerSet.has(provider))\n\n const ov = getMergedOverlay()\n const out: ResolvedModel[] = []\n // Overlay entries override core ones with the same id, so collect ids the\n // overlay has already supplied per kind and skip the core duplicate.\n const seen = { image: new Set<string>(), video: new Set<string>(), audio: new Set<string>(), voice: new Set<string>(), llm: new Set<string>() }\n\n if (!filter.kind || filter.kind === \"image\") {\n for (const [id, def] of Object.entries(ov.image)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.image.add(id)\n out.push({ kind: \"image\", id, def })\n }\n for (const [id, def] of Object.entries(IMAGE_MODEL_CATALOG)) {\n if (seen.image.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"image\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"video\") {\n for (const [id, def] of Object.entries(ov.video)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.video.add(id)\n out.push({ kind: \"video\", id, def })\n }\n for (const [id, def] of Object.entries(VIDEO_MODEL_CATALOG)) {\n if (seen.video.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"video\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"audio\") {\n for (const [id, def] of Object.entries(ov.audio)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.audio.add(id)\n out.push({ kind: \"audio\", id, def })\n }\n for (const [id, def] of Object.entries(AUDIO_MODEL_CATALOG)) {\n if (seen.audio.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"audio\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"voice\") {\n for (const v of ov.voice) {\n if (!providerMatches(v.provider)) continue\n seen.voice.add(v.catalogId)\n out.push({ kind: \"voice\", id: v.catalogId, voice: v })\n }\n for (const v of VOICE_CATALOG) {\n if (seen.voice.has(v.catalogId) || !providerMatches(v.provider)) continue\n out.push({ kind: \"voice\", id: v.catalogId, voice: v })\n }\n }\n if (!filter.kind || filter.kind === \"llm\") {\n for (const [id, pricing] of Object.entries(ov.llm)) {\n if (!providerMatches(pricing.provider)) continue\n seen.llm.add(id)\n out.push({ kind: \"llm\", id, canonicalId: id, pricing, provider: pricing.provider })\n }\n for (const [id, pricing] of Object.entries(LLM_PRICING_CATALOG)) {\n if (seen.llm.has(id) || !providerMatches(pricing.provider)) continue\n seen.llm.add(id)\n out.push({ kind: \"llm\", id, canonicalId: id, pricing, provider: pricing.provider })\n }\n // Known ids with no pricing row yet (see `LlmModelId`'s doc comment in\n // llm/catalog.ts) — surfaced unpriced rather than silently dropped.\n for (const { id, provider } of listUnpricedKnownLlmIds()) {\n if (seen.llm.has(id) || !providerMatches(provider)) continue\n out.push({ kind: \"llm\", id, canonicalId: id, pricing: undefined, provider })\n }\n }\n\n // Capability + tag filters are AND-sets, applied over the enrichment tag\n // vocabulary (capabilities are emitted as tags). Skipped entirely when\n // unset so the common path stays allocation-free.\n const required = [...(filter.capabilities ?? []), ...(filter.tags ?? [])]\n if (required.length === 0) return out\n return out.filter(model => required.every(tag => modelHasTag(model, tag)))\n}\n\n/**\n * Provider-centric view — every model a provider offers across all kinds\n * (llm / image / video / audio incl. tts/stt/s2s). This is the \"provider\n * catalog\" (openai, google, anthropic, replicate, openrouter, …): a\n * derived query over the kind-organized catalogs, NOT a parallel store.\n *\n * When `provider` names a router or a routed endpoint (openrouter, requesty,\n * huggingface, opencode, opencode-go), this also folds in that provider's\n * generated route table (`listRouterLlmRoutes`) — the provider's full\n * surface, not just what happens to be curated into `LLM_PRICING_CATALOG`.\n * The emitted id is whatever `formatModelRef` produces for the resolved ref:\n * `vendor/product@router` for the vendor-namespacing routers, and the bare\n * `opencode-go/glm-5.3` / `opencode/claude-sonnet-4-6` form for the two\n * OpenCode endpoints, whose route IS the id's leading segment (so there is no\n * `@route` to append). OpenRouter's routes are already spread into\n * `LLM_PRICING_CATALOG` (bare `vendor/product` ids, `llm/catalog.ts`), so its\n * router-table entries are deduped against the bare ids `listModels` already\n * returned; Requesty, HuggingFace and the two OpenCode endpoints have no such\n * overlap, so their route table entries are added in full. Deliberately NOT\n * achieved by spreading `REQUESTY_ROUTES`/`HUGGINGFACE_ROUTES`/\n * `OPENCODE_*_ROUTES` into `LLM_PRICING_CATALOG` itself — that catalog is the\n * legacy bare-id path, and a bare id must keep meaning direct-vendor pricing\n * (`route-identity/index.ts`).\n */\nexport function getModelsByProvider(provider: string): ResolvedModel[] {\n const models = listModels({ provider })\n const routerRoutes = listRouterLlmRoutes(provider)\n if (routerRoutes.length === 0) return models\n\n const existingIds = new Set(models.map(m => m.id))\n const routed: ResolvedModel[] = []\n for (const route of routerRoutes) {\n const bareId = `${route.vendor}/${route.product}`\n if (existingIds.has(bareId)) continue\n const id = formatModelRef(route.ref)\n routed.push({ kind: \"llm\", id, canonicalId: id, pricing: route.pricing, provider: route.pricing.provider })\n }\n return [...models, ...routed]\n}\n\n/**\n * Returns the platform a model's adapter is **statically pinned** to,\n * if known. ONLY meaningful for image / video / audio — those adapters\n * are constructed per-platform (Replicate adapter, MiniMax adapter…),\n * so the model's `def.provider` IS the runtime connector.\n *\n * For LLM, returns `undefined` — the runtime connector is determined\n * at call time by `pickLlmConnector(connectors, parseModelId(id).provider)`\n * against the guild's installed connectors, NOT by the model id alone.\n * The same `anthropic/claude-sonnet-4-5` can route through OpenRouter\n * OR direct Anthropic depending on which connectors the guild has\n * installed. Recording call sites MUST pass the actual `connectorUsed`\n * they invoked; do not infer from id.\n *\n * Use case: image/video workflow steps fetch `model.def.provider`\n * directly (no ambiguity). LLM call sites use the runtime resolver.\n */\nexport function getStaticModelProvider(\n model: ResolvedModel\n): string | undefined {\n switch (model.kind) {\n case \"image\":\n case \"video\":\n case \"audio\":\n return model.def.provider\n case \"voice\":\n return model.voice.provider\n case \"llm\":\n // Runtime routing — caller knows, we don't.\n return undefined\n }\n}\n\n/**\n * Resolves an id to its canonical catalog key across kinds. For ids that\n * have no alias, returns the id unchanged. Used by callers that want to\n * normalize before persisting (e.g., `byok_usage` rows).\n */\nexport function resolveAlias(id: string): string {\n const ov = getMergedOverlay()\n const key = followAlias(id, ov)\n if (ov.image[key] || ov.video[key] || ov.audio[key]) return key\n if (overlayVoice(ov, key)) return key\n if (ov.llm[key]) return key\n if (IMAGE_MODEL_CATALOG[key]) return key\n if (VIDEO_MODEL_CATALOG[key]) return key\n if (AUDIO_MODEL_CATALOG[key]) return key\n if (VOICE_INDEX.has(key)) return key\n return resolveLlmAlias(key)\n}\n"]}
1
+ {"version":3,"sources":["../src/registry/index.ts"],"names":["resolveAlias"],"mappings":";;;;;;;;;;;;;;;;AAsCA,SAAS,WAAA,CAAY,IAAY,EAAA,EAA2B;AAC1D,EAAA,IAAI,GAAA,GAAM,EAAA;AACV,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,WAAS;AACP,IAAA,MAAM,IAAA,GAAO,EAAA,CAAG,OAAA,CAAQ,GAAG,CAAA;AAC3B,IAAA,IAAI,IAAA,KAAS,MAAA,IAAa,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA,EAAG;AACzC,IAAA,IAAA,CAAK,IAAI,GAAG,CAAA;AACZ,IAAA,GAAA,GAAM,IAAA;AAAA,EACR;AACA,EAAA,OAAO,GAAA;AACT;AAGA,SAAS,YAAA,CAAa,IAAmB,GAAA,EAAuC;AAC9E,EAAA,OAAO,GAAG,KAAA,CAAM,IAAA;AAAA,IACd,CAAA,CAAA,KACE,CAAA,CAAE,SAAA,KAAc,GAAA,IAChB,CAAA,CAAE,eAAA,KAAoB,GAAA,IAAA,CACrB,CAAA,CAAE,OAAA,IAAW,EAAC,EAA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,MAAA;AAAA;AAEb;AAOO,SAASA,cAAa,EAAA,EAAoB;AAC/C,EAAA,MAAM,KAAK,gBAAA,EAAiB;AAC5B,EAAA,MAAM,GAAA,GAAM,WAAA,CAAY,EAAA,EAAI,EAAE,CAAA;AAC9B,EAAA,IAAI,EAAA,CAAG,KAAA,CAAM,GAAG,CAAA,IAAK,EAAA,CAAG,KAAA,CAAM,GAAG,CAAA,IAAK,EAAA,CAAG,KAAA,CAAM,GAAG,CAAA,EAAG,OAAO,GAAA;AAC5D,EAAA,IAAI,YAAA,CAAa,EAAA,EAAI,GAAG,CAAA,EAAG,OAAO,GAAA;AAClC,EAAA,IAAI,EAAA,CAAG,GAAA,CAAI,GAAG,CAAA,EAAG,OAAO,GAAA;AACxB,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,mBAAA,CAAoB,GAAG,CAAA,EAAG,OAAO,GAAA;AACrC,EAAA,IAAI,WAAA,CAAY,GAAA,CAAI,GAAG,CAAA,EAAG,OAAO,GAAA;AACjC,EAAA,OAAO,aAAgB,GAAG,CAAA;AAC5B","file":"chunk-UWZLV4P2.mjs","sourcesContent":["/**\n * Cross-kind registry. Resolves a model id against every catalog (LLM,\n * image, video, audio) and returns a discriminated `ResolvedModel`.\n *\n * v1 returns the legacy per-kind data shapes verbatim — image/video keep\n * `*ModelDefinition`, LLM keeps `LLMPricing`, audio surfaces voices.\n * Callers (cost dispatcher, access evaluator) match on `.kind` and dig\n * into the per-kind payload as needed.\n */\n\nimport {\n LLM_PRICING_CATALOG,\n resolveAlias as resolveLlmAlias,\n resolvePricing,\n isKnownLlmId,\n listUnpricedKnownLlmIds,\n getModelProvider,\n type LLMPricing,\n} from \"../llm/index.js\"\nimport {\n IMAGE_MODEL_CATALOG,\n type ImageModelDefinition,\n} from \"../image/index.js\"\nimport {\n VIDEO_MODEL_CATALOG,\n type VideoModelDefinition,\n} from \"../video/index.js\"\nimport {\n AUDIO_MODEL_CATALOG,\n type AudioModelDefinition,\n} from \"../audio/index.js\"\nimport { VOICE_CATALOG, type CatalogVoice } from \"../voice/index.js\"\nimport { modelHasTag } from \"../enrichment/index.js\"\nimport { getMergedOverlay, type MergedOverlay } from \"../overlay/index.js\"\nimport { listRouterLlmRoutes, formatModelRef } from \"../route-identity/index.js\"\n\n/** Follow consumer-overlay alias hops to a concrete id (cycle-guarded).\n * Ids with no overlay alias pass through unchanged. */\nfunction followAlias(id: string, ov: MergedOverlay): string {\n let cur = id\n const seen = new Set<string>()\n for (;;) {\n const next = ov.aliases[cur]\n if (next === undefined || seen.has(cur)) break\n seen.add(cur)\n cur = next\n }\n return cur\n}\n\n/** Find an overlay voice by catalogId / providerVoiceId / alias. */\nfunction overlayVoice(ov: MergedOverlay, key: string): CatalogVoice | undefined {\n return ov.voice.find(\n v =>\n v.catalogId === key ||\n v.providerVoiceId === key ||\n (v.aliases ?? []).includes(key),\n )\n}\n\n/**\n * `audio` resolves to either an audio MODEL (priced TTS/STT) or a\n * voice (downstream metadata). Most call sites care about the model\n * (pricing, capabilities); a few (voice pickers) want the voice. They\n * share the resolver but discriminate on the inner payload.\n */\nexport type ResolvedModel =\n | {\n kind: \"llm\"\n id: string\n canonicalId: string\n /** Undefined for a real, known id with no pricing row yet — existence\n * and pricing are independent, see `LlmModelId`'s doc comment in\n * `llm/catalog.ts`. Every reader MUST handle the absent case; never\n * assume a `kind: \"llm\"` result is priced. */\n pricing: LLMPricing | undefined\n /** Best-effort provider even when `pricing` is absent (falls back to\n * `CONTEXT_WINDOWS`'s own provider field — see `getModelProvider`).\n * Prefer this over `pricing?.provider` when you only need routing. */\n provider: string | undefined\n }\n | { kind: \"image\"; id: string; def: ImageModelDefinition }\n | { kind: \"video\"; id: string; def: VideoModelDefinition }\n | { kind: \"audio\"; id: string; def: AudioModelDefinition }\n | { kind: \"voice\"; id: string; voice: CatalogVoice }\n\n/**\n * Every kind the registry can resolve. Broader than the catalog\n * `ModelKind` (llm/image/video/audio) because voices are a first-class\n * registry kind but not a priced model family. Derived from\n * `ResolvedModel` so it can never drift.\n */\nexport type CatalogKind = ResolvedModel[\"kind\"]\n\n// Voices resolve by canonical id (\"minimax-french-female-anchor\"), native\n// provider id (\"French_FemaleAnchor\"), or a consumer-overlay alias — index\n// all three so new slugs, native ids, and persisted operator rows all hit.\nconst VOICE_INDEX: Map<string, CatalogVoice> = new Map([\n ...VOICE_CATALOG.map(v => [v.providerVoiceId, v] as const),\n ...VOICE_CATALOG.map(v => [v.catalogId, v] as const),\n ...VOICE_CATALOG.flatMap((v: CatalogVoice) =>\n (v.aliases ?? []).map(a => [a, v] as const)\n ),\n])\n\n/**\n * Resolves a model id across every catalog.\n *\n * Lookup order: image → video → audio → LLM (last because LLM has the\n * partial-prefix fallback that can match other strings if probed first).\n *\n * Returns `undefined` for unknown ids — callers decide whether to throw\n * or fall back. LLM uses fallback pricing inside its own dispatcher\n * (preserves existing behavior at the orchestrator).\n */\nexport function getModel(id: string): ResolvedModel | undefined {\n // Consumer overlays first: resolve any overlay alias to a concrete id,\n // then let overlay entries override/extend the generated catalogs. The\n // returned `id` echoes what the caller asked for (alias-preserving), as\n // the legacy voice-alias path already did.\n const ov = getMergedOverlay()\n const key = followAlias(id, ov)\n\n if (ov.image[key]) return { kind: \"image\", id, def: ov.image[key]! }\n if (ov.video[key]) return { kind: \"video\", id, def: ov.video[key]! }\n if (ov.audio[key]) return { kind: \"audio\", id, def: ov.audio[key]! }\n const ovVoice = overlayVoice(ov, key)\n if (ovVoice) return { kind: \"voice\", id, voice: ovVoice }\n if (ov.llm[key]) {\n const pricing = ov.llm[key]!\n return { kind: \"llm\", id, canonicalId: key, pricing, provider: pricing.provider }\n }\n\n const imageDef = IMAGE_MODEL_CATALOG[key]\n if (imageDef) return { kind: \"image\", id, def: imageDef }\n\n const videoDef = VIDEO_MODEL_CATALOG[key]\n if (videoDef) return { kind: \"video\", id, def: videoDef }\n\n // Audio MODEL (priced TTS/STT) — checked before voice lookup so an\n // id that exists in both maps lands on the priced entry.\n const audioDef = AUDIO_MODEL_CATALOG[key]\n if (audioDef) return { kind: \"audio\", id, def: audioDef }\n\n const voice = VOICE_INDEX.get(key)\n if (voice) return { kind: \"voice\", id, voice }\n\n const llmPricing = resolvePricing(key)\n if (llmPricing) {\n const canonicalId = resolveLlmAlias(key)\n return { kind: \"llm\", id, canonicalId, pricing: llmPricing, provider: llmPricing.provider }\n }\n // Known id, no pricing row yet (see `LlmModelId`'s doc comment in\n // llm/catalog.ts) — still resolves, just unpriced. This is the case that\n // used to make a real, live, provider-published model (e.g. a brand-new\n // Anthropic release the day it ships, before the next pricing sync)\n // disappear from every downstream surface instead of showing up unpriced.\n if (isKnownLlmId(key)) {\n return { kind: \"llm\", id, canonicalId: key, pricing: undefined, provider: getModelProvider(key) }\n }\n\n return undefined\n}\n\n/**\n * Returns true iff the id is exposed to agents.\n *\n * - LLM: every entry in `LLM_PRICING_CATALOG` is considered visible\n * (legacy convention; refine in v2 with per-entry `agentVisible`).\n * - Image / Video: respects the `agentVisible` flag.\n * - Audio voices: all voices are visible (catalog itself is curated).\n */\nexport function isAgentVisible(id: string): boolean {\n const m = getModel(id)\n if (!m) return false\n switch (m.kind) {\n case \"image\":\n return m.def.agentVisible\n case \"video\":\n return m.def.agentVisible\n case \"audio\":\n return m.def.agentVisible\n case \"llm\":\n return (\n id in LLM_PRICING_CATALOG || resolveLlmAlias(id) in LLM_PRICING_CATALOG\n )\n case \"voice\":\n return true\n }\n}\n\nexport interface ListModelsFilter {\n kind?: CatalogKind\n /** Single provider (back-compat). Folded into `providers` internally. */\n provider?: string\n /** Provider OR-set — a model matches if its provider is any of these. */\n providers?: string[]\n /**\n * Capability tags a model must carry (ALL of them). Capabilities are\n * emitted as tags by enrichment — audio `tts`/`stt`/`s2s`, image\n * `edit`/`upscale`, video `i2v`/`t2v` — so this filters on the same\n * vocabulary `listModels({capabilities:[\"s2s\"]})` would expect.\n */\n capabilities?: string[]\n /** Arbitrary tags a model must carry (ALL of them). */\n tags?: string[]\n agentVisibleOnly?: boolean\n}\n\n/**\n * Cross-kind listing. Useful for catalog browsers and capability search.\n * Returns `ResolvedModel[]` (discriminated by kind).\n *\n * Provider is an OR-set (`providers` ∪ the singular `provider`); capability\n * and tag filters are AND-sets (a model must carry every listed value).\n * Composed: `listModels({ kind:\"audio\", capabilities:[\"s2s\"],\n * providers:[\"gemini-live\",\"openai-realtime\"] })` → all s2s models from\n * Gemini OR OpenAI.\n */\nexport function listModels(filter: ListModelsFilter = {}): ResolvedModel[] {\n const providerSet =\n filter.provider || filter.providers\n ? new Set([\n ...(filter.provider ? [filter.provider] : []),\n ...(filter.providers ?? []),\n ])\n : undefined\n const providerMatches = (provider: string | undefined): boolean =>\n !providerSet || (provider !== undefined && providerSet.has(provider))\n\n const ov = getMergedOverlay()\n const out: ResolvedModel[] = []\n // Overlay entries override core ones with the same id, so collect ids the\n // overlay has already supplied per kind and skip the core duplicate.\n const seen = { image: new Set<string>(), video: new Set<string>(), audio: new Set<string>(), voice: new Set<string>(), llm: new Set<string>() }\n\n if (!filter.kind || filter.kind === \"image\") {\n for (const [id, def] of Object.entries(ov.image)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.image.add(id)\n out.push({ kind: \"image\", id, def })\n }\n for (const [id, def] of Object.entries(IMAGE_MODEL_CATALOG)) {\n if (seen.image.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"image\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"video\") {\n for (const [id, def] of Object.entries(ov.video)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.video.add(id)\n out.push({ kind: \"video\", id, def })\n }\n for (const [id, def] of Object.entries(VIDEO_MODEL_CATALOG)) {\n if (seen.video.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"video\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"audio\") {\n for (const [id, def] of Object.entries(ov.audio)) {\n if (!providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n seen.audio.add(id)\n out.push({ kind: \"audio\", id, def })\n }\n for (const [id, def] of Object.entries(AUDIO_MODEL_CATALOG)) {\n if (seen.audio.has(id) || !providerMatches(def.provider)) continue\n if (filter.agentVisibleOnly && !def.agentVisible) continue\n out.push({ kind: \"audio\", id, def })\n }\n }\n if (!filter.kind || filter.kind === \"voice\") {\n for (const v of ov.voice) {\n if (!providerMatches(v.provider)) continue\n seen.voice.add(v.catalogId)\n out.push({ kind: \"voice\", id: v.catalogId, voice: v })\n }\n for (const v of VOICE_CATALOG) {\n if (seen.voice.has(v.catalogId) || !providerMatches(v.provider)) continue\n out.push({ kind: \"voice\", id: v.catalogId, voice: v })\n }\n }\n if (!filter.kind || filter.kind === \"llm\") {\n for (const [id, pricing] of Object.entries(ov.llm)) {\n if (!providerMatches(pricing.provider)) continue\n seen.llm.add(id)\n out.push({ kind: \"llm\", id, canonicalId: id, pricing, provider: pricing.provider })\n }\n for (const [id, pricing] of Object.entries(LLM_PRICING_CATALOG)) {\n if (seen.llm.has(id) || !providerMatches(pricing.provider)) continue\n seen.llm.add(id)\n out.push({ kind: \"llm\", id, canonicalId: id, pricing, provider: pricing.provider })\n }\n // Known ids with no pricing row yet (see `LlmModelId`'s doc comment in\n // llm/catalog.ts) — surfaced unpriced rather than silently dropped.\n for (const { id, provider } of listUnpricedKnownLlmIds()) {\n if (seen.llm.has(id) || !providerMatches(provider)) continue\n out.push({ kind: \"llm\", id, canonicalId: id, pricing: undefined, provider })\n }\n }\n\n // Capability + tag filters are AND-sets, applied over the enrichment tag\n // vocabulary (capabilities are emitted as tags). Skipped entirely when\n // unset so the common path stays allocation-free.\n const required = [...(filter.capabilities ?? []), ...(filter.tags ?? [])]\n if (required.length === 0) return out\n return out.filter(model => required.every(tag => modelHasTag(model, tag)))\n}\n\n/**\n * Provider-centric view — every model a provider offers across all kinds\n * (llm / image / video / audio incl. tts/stt/s2s). This is the \"provider\n * catalog\" (openai, google, anthropic, replicate, openrouter, …): a\n * derived query over the kind-organized catalogs, NOT a parallel store.\n *\n * When `provider` names a router or a routed endpoint (openrouter, requesty,\n * huggingface, opencode, opencode-go), this also folds in that provider's\n * generated route table (`listRouterLlmRoutes`) — the provider's full\n * surface, not just what happens to be curated into `LLM_PRICING_CATALOG`.\n * The emitted id is whatever `formatModelRef` produces for the resolved ref:\n * `vendor/product@router` for the vendor-namespacing routers, and the bare\n * `opencode-go/glm-5.3` / `opencode/claude-sonnet-4-6` form for the two\n * OpenCode endpoints, whose route IS the id's leading segment (so there is no\n * `@route` to append). OpenRouter's routes are already spread into\n * `LLM_PRICING_CATALOG` (bare `vendor/product` ids, `llm/catalog.ts`), so its\n * router-table entries are deduped against the bare ids `listModels` already\n * returned; Requesty, HuggingFace and the two OpenCode endpoints have no such\n * overlap, so their route table entries are added in full. Deliberately NOT\n * achieved by spreading `REQUESTY_ROUTES`/`HUGGINGFACE_ROUTES`/\n * `OPENCODE_*_ROUTES` into `LLM_PRICING_CATALOG` itself — that catalog is the\n * legacy bare-id path, and a bare id must keep meaning direct-vendor pricing\n * (`route-identity/index.ts`).\n */\nexport function getModelsByProvider(provider: string): ResolvedModel[] {\n const models = listModels({ provider })\n const routerRoutes = listRouterLlmRoutes(provider)\n if (routerRoutes.length === 0) return models\n\n const existingIds = new Set(models.map(m => m.id))\n const routed: ResolvedModel[] = []\n for (const route of routerRoutes) {\n const bareId = `${route.vendor}/${route.product}`\n if (existingIds.has(bareId)) continue\n const id = formatModelRef(route.ref)\n routed.push({ kind: \"llm\", id, canonicalId: id, pricing: route.pricing, provider: route.pricing.provider })\n }\n return [...models, ...routed]\n}\n\n/**\n * Returns the platform a model's adapter is **statically pinned** to,\n * if known. ONLY meaningful for image / video / audio — those adapters\n * are constructed per-platform (Replicate adapter, MiniMax adapter…),\n * so the model's `def.provider` IS the runtime connector.\n *\n * For LLM, returns `undefined` — the runtime connector is determined\n * at call time by `pickLlmConnector(connectors, parseModelId(id).provider)`\n * against the guild's installed connectors, NOT by the model id alone.\n * The same `anthropic/claude-sonnet-4-5` can route through OpenRouter\n * OR direct Anthropic depending on which connectors the guild has\n * installed. Recording call sites MUST pass the actual `connectorUsed`\n * they invoked; do not infer from id.\n *\n * Use case: image/video workflow steps fetch `model.def.provider`\n * directly (no ambiguity). LLM call sites use the runtime resolver.\n */\nexport function getStaticModelProvider(\n model: ResolvedModel\n): string | undefined {\n switch (model.kind) {\n case \"image\":\n case \"video\":\n case \"audio\":\n return model.def.provider\n case \"voice\":\n return model.voice.provider\n case \"llm\":\n // Runtime routing — caller knows, we don't.\n return undefined\n }\n}\n\n/**\n * Resolves an id to its canonical catalog key across kinds. For ids that\n * have no alias, returns the id unchanged. Used by callers that want to\n * normalize before persisting (e.g., `byok_usage` rows).\n */\nexport function resolveAlias(id: string): string {\n const ov = getMergedOverlay()\n const key = followAlias(id, ov)\n if (ov.image[key] || ov.video[key] || ov.audio[key]) return key\n if (overlayVoice(ov, key)) return key\n if (ov.llm[key]) return key\n if (IMAGE_MODEL_CATALOG[key]) return key\n if (VIDEO_MODEL_CATALOG[key]) return key\n if (AUDIO_MODEL_CATALOG[key]) return key\n if (VOICE_INDEX.has(key)) return key\n return resolveLlmAlias(key)\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { CatalogProviderSchema } from './chunk-WG4F6IRS.mjs';
2
- import { resolvePricing, resolveAlias, OPENCODE_GO_ROUTES, OPENCODE_ZEN_ROUTES, OPENROUTER_ROUTES, DEFAULT_PRICING } from './chunk-XZXZXU6H.mjs';
2
+ import { resolvePricing, resolveAlias, OPENCODE_GO_ROUTES, OPENCODE_ZEN_ROUTES, OPENROUTER_ROUTES, DEFAULT_PRICING } from './chunk-Z2WIEJR7.mjs';
3
3
 
4
4
  /**
5
5
  * @agentproto/model-catalog v0.1.0
@@ -2652,6 +2652,14 @@ var REQUESTY_ROUTES = {
2652
2652
  vendor: "deepinfra",
2653
2653
  provider: "requesty"
2654
2654
  },
2655
+ "deepinfra/step-5-preview": {
2656
+ inputPer1M: 1,
2657
+ outputPer1M: 2.7,
2658
+ cacheReadMultiplier: 0.05,
2659
+ addedAt: "2026-10-08",
2660
+ vendor: "deepinfra",
2661
+ provider: "requesty"
2662
+ },
2655
2663
  "deepinfra/zai-org/GLM-4.5": {
2656
2664
  inputPer1M: 0.6,
2657
2665
  outputPer1M: 2.2,
@@ -2714,6 +2722,14 @@ var REQUESTY_ROUTES = {
2714
2722
  vendor: "deepseek",
2715
2723
  provider: "requesty"
2716
2724
  },
2725
+ "deepseek/deepseek-v4.1-flash-1017": {
2726
+ inputPer1M: 0.3,
2727
+ outputPer1M: 1.2,
2728
+ cacheReadMultiplier: 0.02,
2729
+ addedAt: "2026-10-17",
2730
+ vendor: "deepseek",
2731
+ provider: "requesty"
2732
+ },
2717
2733
  "doubleword/deepseek-v4-flash-0424": {
2718
2734
  inputPer1M: 0.14,
2719
2735
  outputPer1M: 0.28,
@@ -2898,6 +2914,14 @@ var REQUESTY_ROUTES = {
2898
2914
  vendor: "fireworks",
2899
2915
  provider: "requesty"
2900
2916
  },
2917
+ "fireworks/muse-spark-open": {
2918
+ inputPer1M: 1.25,
2919
+ outputPer1M: 4.25,
2920
+ cacheReadMultiplier: 0.12,
2921
+ addedAt: "2026-10-15",
2922
+ vendor: "fireworks",
2923
+ provider: "requesty"
2924
+ },
2901
2925
  "fireworks/nemotron-3-ultra-nvfp4": {
2902
2926
  inputPer1M: 0.6,
2903
2927
  outputPer1M: 2.4,
@@ -4548,6 +4572,14 @@ var REQUESTY_ROUTES = {
4548
4572
  vendor: "sference",
4549
4573
  provider: "requesty"
4550
4574
  },
4575
+ "sference/deepseek-v4.1-flash-1017": {
4576
+ inputPer1M: 0.5,
4577
+ outputPer1M: 1.5,
4578
+ cacheReadMultiplier: 0.1,
4579
+ addedAt: "2026-10-17",
4580
+ vendor: "sference",
4581
+ provider: "requesty"
4582
+ },
4551
4583
  "sference/glm-5.2": {
4552
4584
  inputPer1M: 1.2,
4553
4585
  outputPer1M: 4.2,
@@ -4843,6 +4875,14 @@ var REQUESTY_ROUTES = {
4843
4875
  vendor: "together",
4844
4876
  provider: "requesty"
4845
4877
  },
4878
+ "together/muse-spark-open": {
4879
+ inputPer1M: 1.25,
4880
+ outputPer1M: 4.25,
4881
+ cacheReadMultiplier: 0.12,
4882
+ addedAt: "2026-10-15",
4883
+ vendor: "together",
4884
+ provider: "requesty"
4885
+ },
4846
4886
  "typesafe/jev-1.13.0": {
4847
4887
  inputPer1M: 0.042,
4848
4888
  outputPer1M: 0,
@@ -6489,7 +6529,7 @@ var HUGGINGFACE_ROUTES = {
6489
6529
  inputPer1M: 0.07,
6490
6530
  outputPer1M: 0.2,
6491
6531
  supportsTools: true,
6492
- supportsStructuredOutput: false
6532
+ supportsStructuredOutput: true
6493
6533
  }
6494
6534
  ]
6495
6535
  },
@@ -6584,7 +6624,7 @@ var HUGGINGFACE_ROUTES = {
6584
6624
  inputPer1M: 0.08,
6585
6625
  outputPer1M: 0.28,
6586
6626
  supportsTools: true,
6587
- supportsStructuredOutput: true
6627
+ supportsStructuredOutput: false
6588
6628
  },
6589
6629
  {
6590
6630
  provider: "featherless-ai",
@@ -6622,6 +6662,10 @@ var HUGGINGFACE_ROUTES = {
6622
6662
  "Qwen/Qwen3-4B-Thinking-2507": {
6623
6663
  wireId: "Qwen/Qwen3-4B-Thinking-2507",
6624
6664
  providers: [
6665
+ {
6666
+ provider: "featherless-ai",
6667
+ status: "live"
6668
+ },
6625
6669
  {
6626
6670
  provider: "nscale",
6627
6671
  status: "live",
@@ -6647,7 +6691,7 @@ var HUGGINGFACE_ROUTES = {
6647
6691
  inputPer1M: 0.07,
6648
6692
  outputPer1M: 0.18,
6649
6693
  supportsTools: true,
6650
- supportsStructuredOutput: true
6694
+ supportsStructuredOutput: false
6651
6695
  }
6652
6696
  ]
6653
6697
  },
@@ -6715,6 +6759,15 @@ var HUGGINGFACE_ROUTES = {
6715
6759
  {
6716
6760
  provider: "featherless-ai",
6717
6761
  status: "live"
6762
+ },
6763
+ {
6764
+ provider: "novita",
6765
+ status: "live",
6766
+ contextLength: 131072,
6767
+ inputPer1M: 0.2,
6768
+ outputPer1M: 0.7,
6769
+ supportsTools: true,
6770
+ supportsStructuredOutput: true
6718
6771
  }
6719
6772
  ]
6720
6773
  },
@@ -6920,7 +6973,7 @@ var HUGGINGFACE_ROUTES = {
6920
6973
  inputPer1M: 0.285,
6921
6974
  outputPer1M: 1.71,
6922
6975
  supportsTools: true,
6923
- supportsStructuredOutput: true
6976
+ supportsStructuredOutput: false
6924
6977
  }
6925
6978
  ]
6926
6979
  },
@@ -6975,15 +7028,6 @@ var HUGGINGFACE_ROUTES = {
6975
7028
  supportsTools: true,
6976
7029
  supportsStructuredOutput: true
6977
7030
  },
6978
- {
6979
- provider: "deepinfra",
6980
- status: "live",
6981
- contextLength: 262144,
6982
- inputPer1M: 0.2,
6983
- outputPer1M: 2.5,
6984
- supportsTools: true,
6985
- supportsStructuredOutput: true
6986
- },
6987
7031
  {
6988
7032
  provider: "featherless-ai",
6989
7033
  status: "live"
@@ -7036,7 +7080,7 @@ var HUGGINGFACE_ROUTES = {
7036
7080
  inputPer1M: 0.14,
7037
7081
  outputPer1M: 0.28,
7038
7082
  supportsTools: true,
7039
- supportsStructuredOutput: false
7083
+ supportsStructuredOutput: true
7040
7084
  },
7041
7085
  {
7042
7086
  provider: "featherless-ai",
@@ -7225,7 +7269,7 @@ var HUGGINGFACE_ROUTES = {
7225
7269
  inputPer1M: 0.2,
7226
7270
  outputPer1M: 0.2,
7227
7271
  supportsTools: false,
7228
- supportsStructuredOutput: false
7272
+ supportsStructuredOutput: true
7229
7273
  }
7230
7274
  ]
7231
7275
  },
@@ -7315,6 +7359,20 @@ var HUGGINGFACE_ROUTES = {
7315
7359
  }
7316
7360
  ]
7317
7361
  },
7362
+ "deepseek-ai/DeepSeek-V3.2": {
7363
+ wireId: "deepseek-ai/DeepSeek-V3.2",
7364
+ providers: [
7365
+ {
7366
+ provider: "deepinfra",
7367
+ status: "live",
7368
+ contextLength: 163840,
7369
+ inputPer1M: 0.26,
7370
+ outputPer1M: 0.38,
7371
+ supportsTools: true,
7372
+ supportsStructuredOutput: true
7373
+ }
7374
+ ]
7375
+ },
7318
7376
  "deepseek-ai/DeepSeek-V4-Flash": {
7319
7377
  wireId: "deepseek-ai/DeepSeek-V4-Flash",
7320
7378
  providers: [
@@ -7537,7 +7595,7 @@ var HUGGINGFACE_ROUTES = {
7537
7595
  inputPer1M: 0.08,
7538
7596
  outputPer1M: 0.16,
7539
7597
  supportsTools: true,
7540
- supportsStructuredOutput: false
7598
+ supportsStructuredOutput: true
7541
7599
  },
7542
7600
  {
7543
7601
  provider: "featherless-ai",
@@ -7586,7 +7644,7 @@ var HUGGINGFACE_ROUTES = {
7586
7644
  inputPer1M: 0.13,
7587
7645
  outputPer1M: 0.4,
7588
7646
  supportsTools: true,
7589
- supportsStructuredOutput: true
7647
+ supportsStructuredOutput: false
7590
7648
  },
7591
7649
  {
7592
7650
  provider: "scaleway",
@@ -7917,6 +7975,20 @@ var HUGGINGFACE_ROUTES = {
7917
7975
  }
7918
7976
  ]
7919
7977
  },
7978
+ "meta-models/Muse-Spark-Open-816B-A42B": {
7979
+ wireId: "meta-models/Muse-Spark-Open-816B-A42B",
7980
+ providers: [
7981
+ {
7982
+ provider: "baseten",
7983
+ status: "live",
7984
+ contextLength: 1048576,
7985
+ inputPer1M: 1.25,
7986
+ outputPer1M: 4.25,
7987
+ supportsTools: true,
7988
+ supportsStructuredOutput: true
7989
+ }
7990
+ ]
7991
+ },
7920
7992
  "microsoft/phi-4": {
7921
7993
  wireId: "microsoft/phi-4",
7922
7994
  providers: [
@@ -8133,6 +8205,20 @@ var HUGGINGFACE_ROUTES = {
8133
8205
  }
8134
8206
  ]
8135
8207
  },
8208
+ "nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4": {
8209
+ wireId: "nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4",
8210
+ providers: [
8211
+ {
8212
+ provider: "baseten",
8213
+ status: "live",
8214
+ contextLength: 1048576,
8215
+ inputPer1M: 0.2,
8216
+ outputPer1M: 0.5,
8217
+ supportsTools: true,
8218
+ supportsStructuredOutput: true
8219
+ }
8220
+ ]
8221
+ },
8136
8222
  "openai/gpt-oss-120b": {
8137
8223
  wireId: "openai/gpt-oss-120b",
8138
8224
  providers: [
@@ -8210,7 +8296,7 @@ var HUGGINGFACE_ROUTES = {
8210
8296
  inputPer1M: 0.09,
8211
8297
  outputPer1M: 0.47,
8212
8298
  supportsTools: true,
8213
- supportsStructuredOutput: false
8299
+ supportsStructuredOutput: true
8214
8300
  },
8215
8301
  {
8216
8302
  provider: "scaleway",
@@ -8218,7 +8304,7 @@ var HUGGINGFACE_ROUTES = {
8218
8304
  inputPer1M: 0.171,
8219
8305
  outputPer1M: 0.684,
8220
8306
  supportsTools: true,
8221
- supportsStructuredOutput: true
8307
+ supportsStructuredOutput: false
8222
8308
  },
8223
8309
  {
8224
8310
  provider: "together",
@@ -8339,7 +8425,7 @@ var HUGGINGFACE_ROUTES = {
8339
8425
  inputPer1M: 0.1,
8340
8426
  outputPer1M: 0.3,
8341
8427
  supportsTools: true,
8342
- supportsStructuredOutput: false
8428
+ supportsStructuredOutput: true
8343
8429
  },
8344
8430
  {
8345
8431
  provider: "featherless-ai",
@@ -8357,7 +8443,7 @@ var HUGGINGFACE_ROUTES = {
8357
8443
  inputPer1M: 0.2,
8358
8444
  outputPer1M: 1.15,
8359
8445
  supportsTools: true,
8360
- supportsStructuredOutput: false
8446
+ supportsStructuredOutput: true
8361
8447
  },
8362
8448
  {
8363
8449
  provider: "featherless-ai",
@@ -8477,6 +8563,17 @@ var HUGGINGFACE_ROUTES = {
8477
8563
  }
8478
8564
  ]
8479
8565
  },
8566
+ "zai-org/GLM-4.5": {
8567
+ wireId: "zai-org/GLM-4.5",
8568
+ providers: [
8569
+ {
8570
+ provider: "zai-org",
8571
+ status: "live",
8572
+ supportsTools: true,
8573
+ supportsStructuredOutput: false
8574
+ }
8575
+ ]
8576
+ },
8480
8577
  "zai-org/GLM-4.5-Air": {
8481
8578
  wireId: "zai-org/GLM-4.5-Air",
8482
8579
  providers: [
@@ -8552,7 +8649,12 @@ var HUGGINGFACE_ROUTES = {
8552
8649
  outputPer1M: 2.2,
8553
8650
  supportsTools: true,
8554
8651
  supportsStructuredOutput: false
8555
- },
8652
+ }
8653
+ ]
8654
+ },
8655
+ "zai-org/GLM-4.6-FP8": {
8656
+ wireId: "zai-org/GLM-4.6-FP8",
8657
+ providers: [
8556
8658
  {
8557
8659
  provider: "zai-org",
8558
8660
  status: "live",
@@ -8594,6 +8696,12 @@ var HUGGINGFACE_ROUTES = {
8594
8696
  outputPer1M: 0.9,
8595
8697
  supportsTools: true,
8596
8698
  supportsStructuredOutput: false
8699
+ },
8700
+ {
8701
+ provider: "zai-org",
8702
+ status: "live",
8703
+ supportsTools: true,
8704
+ supportsStructuredOutput: false
8597
8705
  }
8598
8706
  ]
8599
8707
  },
@@ -8705,12 +8813,6 @@ var HUGGINGFACE_ROUTES = {
8705
8813
  {
8706
8814
  provider: "featherless-ai",
8707
8815
  status: "live"
8708
- },
8709
- {
8710
- provider: "zai-org",
8711
- status: "live",
8712
- supportsTools: true,
8713
- supportsStructuredOutput: false
8714
8816
  }
8715
8817
  ]
8716
8818
  },
@@ -8849,7 +8951,7 @@ var HUGGINGFACE_ROUTES = {
8849
8951
  provider: "zai-org",
8850
8952
  status: "live",
8851
8953
  supportsTools: true,
8852
- supportsStructuredOutput: false
8954
+ supportsStructuredOutput: true
8853
8955
  }
8854
8956
  ]
8855
8957
  },
@@ -8860,7 +8962,7 @@ var HUGGINGFACE_ROUTES = {
8860
8962
  provider: "zai-org",
8861
8963
  status: "live",
8862
8964
  supportsTools: true,
8863
- supportsStructuredOutput: false
8965
+ supportsStructuredOutput: true
8864
8966
  }
8865
8967
  ]
8866
8968
  },
@@ -8918,7 +9020,7 @@ var HUGGINGFACE_ROUTES = {
8918
9020
  provider: "zai-org",
8919
9021
  status: "live",
8920
9022
  supportsTools: true,
8921
- supportsStructuredOutput: false
9023
+ supportsStructuredOutput: true
8922
9024
  }
8923
9025
  ]
8924
9026
  },
@@ -8929,7 +9031,7 @@ var HUGGINGFACE_ROUTES = {
8929
9031
  provider: "zai-org",
8930
9032
  status: "live",
8931
9033
  supportsTools: true,
8932
- supportsStructuredOutput: false
9034
+ supportsStructuredOutput: true
8933
9035
  }
8934
9036
  ]
8935
9037
  }
@@ -9275,5 +9377,5 @@ function diagnoseModelRef(input) {
9275
9377
  }
9276
9378
 
9277
9379
  export { InvalidModelRefError, OPENROUTER_VARIANTS, clearCustomRoutes, diagnoseModelRef, formatModelRef, isModelRefString, listRouterLlmRoutes, parseModelRef, registerCustomRoute, resolveCustomRoute, resolveLlmModelRoute, stripAnthropicNativeVendor, stripFixedNativeVendor, stripRouteSuffix, tryParseModelRef };
9278
- //# sourceMappingURL=chunk-XMQXJNZO.mjs.map
9279
- //# sourceMappingURL=chunk-XMQXJNZO.mjs.map
9380
+ //# sourceMappingURL=chunk-XYM6UG7C.mjs.map
9381
+ //# sourceMappingURL=chunk-XYM6UG7C.mjs.map