MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / applyModelOverrides

Function applyModelOverrides

source code/utils/model/modelStrings.ts:65–78  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

63 * strings — typically Bedrock inference profile ARNs.
64 */
65function applyModelOverrides(ms: ModelStrings): ModelStrings {
66 const overrides = getInitialSettings().modelOverrides
67 if (!overrides) {
68 return ms
69 }
70 const out = { ...ms }
71 for (const [canonicalId, override] of Object.entries(overrides)) {
72 const key = CANONICAL_ID_TO_KEY[canonicalId as CanonicalModelId]
73 if (key && override) {
74 out[key] = override
75 }
76 }
77 return out
78}
79
80/**
81 * Resolve an overridden model ID (e.g. a Bedrock ARN) back to its canonical

Callers 1

getModelStringsFunction · 0.85

Calls 2

getInitialSettingsFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected