* Layer user-configured modelOverrides (from settings.json) on top of the * provider-derived model strings. Overrides are keyed by canonical first-party * model ID (e.g. "claude-opus-4-6") and map to arbitrary provider-specific * strings — typically Bedrock inference profile ARNs.
(ms: ModelStrings)
| 61 | * strings — typically Bedrock inference profile ARNs. |
| 62 | */ |
| 63 | function applyModelOverrides(ms: ModelStrings): ModelStrings { |
| 64 | const overrides = getInitialSettings().modelOverrides |
| 65 | if (!overrides) { |
| 66 | return ms |
| 67 | } |
| 68 | const out = { ...ms } |
| 69 | for (const [canonicalId, override] of Object.entries(overrides)) { |
| 70 | const key = CANONICAL_ID_TO_KEY[canonicalId as CanonicalModelId] |
| 71 | if (key && override) { |
| 72 | out[key] = override |
| 73 | } |
| 74 | } |
| 75 | return out |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Resolve an overridden model ID (e.g. a Bedrock ARN) back to its canonical |
no test coverage detected