Model Override Target Mapper (lib/modelCapabilityOverrideTargets.ts)

LLM-Router · src/lib/modelCapabilityOverrideTargets.ts · typescript · MIT
ai, lang:typescript, tag:data-mapping, tag:configuration, tag:catalog

Converts catalog data into model override targets, ensuring correct provider prefixes are used for public labels while preserving internal IDs.

// Source: https://github.com/cmahmud/LLM-Router | License: MIT | Copyright 2026 diegosouzapw
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Pure catalog → Model Override target conversion.
 *
 * The operator-facing Model Overrides surface must present a compatible
 * provider node under its configured public `prefix` (e.g. `vibeproxy/gpt-4o`)
 * — never the generated `openai-compatible-chat-<uuid>` node id (#9557).
 *
 * The pricing catalog keeps the internal `id` (the DB node id, which PricingTab
 * uses to key pricing data) and, when the node has a configured prefix, also
 * carries `displayPrefix`. This helper prefers `displayPrefix` for the public
 * label/target while leaving the raw id untouched for storage/runtime lookup.
 *
 * Model-Overrides eligibility s

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key