-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathmodel-config.ts
More file actions
66 lines (63 loc) · 1.88 KB
/
Copy pathmodel-config.ts
File metadata and controls
66 lines (63 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
export interface ModelOverride {
exclude?: string[]
add?: string[]
disableEffort?: boolean
}
export interface ModelConfig {
ccVersion: string
baseBetas: string[]
longContextBetas: string[]
modelOverrides: Record<string, ModelOverride>
}
export const config: ModelConfig = {
ccVersion: "2.1.217",
baseBetas: [
"claude-code-20250219",
"oauth-2025-04-20",
"interleaved-thinking-2025-05-14",
"prompt-caching-scope-2026-01-05",
"context-management-2025-06-27",
"advisor-tool-2026-03-01",
"thinking-token-count-2026-05-13",
"extended-cache-ttl-2025-04-11",
],
longContextBetas: [
"context-1m-2025-08-07",
"interleaved-thinking-2025-05-14",
],
// NOTE: getModelOverride is first-match-wins. The "sonnet" key must stay
// ahead of "4-6"/"4-7": it shields claude-sonnet-4-6 from the "4-6"
// effort add-override, and its exclude strips effort if a user supplies
// it via ANTHROPIC_BETA_FLAGS. Do not remove it as inert — the split is
// pinned by the "effort beta" test in betas.test.ts.
modelOverrides: {
sonnet: {
exclude: ["effort-2025-11-24"],
},
haiku: {
exclude: ["effort-2025-11-24"],
disableEffort: true,
},
"4-6": {
add: ["effort-2025-11-24"],
},
"4-7": {
add: ["effort-2025-11-24"],
},
},
}
/**
* Find the override entry matching a model ID.
* Keys are matched via includes() against the lowercased model ID.
*
* First-match-wins: if multiple keys match, only the first (by insertion
* order) is returned. List more specific keys before broader ones
* (e.g. "opus-4-6" before "opus") so they take priority.
*/
export function getModelOverride(modelId: string): ModelOverride | null {
const lower = modelId.toLowerCase()
for (const [pattern, override] of Object.entries(config.modelOverrides)) {
if (lower.includes(pattern)) return override
}
return null
}