Skip to content

Commit 5e01840

Browse files
committed
refactor: update Claude model identifiers to use new naming convention
1 parent 049f239 commit 5e01840

File tree

7 files changed

+13
-16
lines changed

7 files changed

+13
-16
lines changed

packages/types/src/providers/anthropic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type AnthropicModelId = keyof typeof anthropicModels
66
export const anthropicDefaultModelId: AnthropicModelId = "claude-sonnet-4-20250514"
77

88
export const anthropicModels = {
9-
"claude-sonnet-4-5-20250514": {
9+
"claude-4.5-sonnet": {
1010
maxTokens: 64_000, // Overridden to 8k if `enableReasoningEffort` is false.
1111
contextWindow: 200_000, // Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'
1212
supportsImages: true,

packages/types/src/providers/bedrock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const bedrockModels = {
6767
maxCachePoints: 1,
6868
cachableFields: ["system"],
6969
},
70-
"anthropic.claude-sonnet-4-5-20250514-v1:0": {
70+
"anthropic.claude-4.5-sonnet-v1:0": {
7171
maxTokens: 8192,
7272
contextWindow: 200_000,
7373
supportsImages: true,

packages/types/src/providers/claude-code.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export function getClaudeCodeModelId(baseModelId: ClaudeCodeModelId, useVertex =
4040
}
4141

4242
export const claudeCodeModels = {
43-
"claude-sonnet-4-5-20250514": {
44-
...anthropicModels["claude-sonnet-4-5-20250514"],
43+
"claude-4.5-sonnet": {
44+
...anthropicModels["claude-4.5-sonnet"],
4545
supportsImages: false,
4646
supportsPromptCache: true, // Claude Code does report cache tokens
4747
supportsReasoningEffort: false,

packages/types/src/providers/vertex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const vertexModels = {
163163
inputPrice: 1.25,
164164
outputPrice: 5,
165165
},
166-
"claude-sonnet-4-5@20250514": {
166+
"claude-4.5-sonnet": {
167167
maxTokens: 8192,
168168
contextWindow: 200_000,
169169
supportsImages: true,

src/api/providers/__tests__/anthropic.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ describe("AnthropicHandler", () => {
268268
it("should handle Claude 4.5 Sonnet model correctly", () => {
269269
const handler = new AnthropicHandler({
270270
apiKey: "test-api-key",
271-
apiModelId: "claude-sonnet-4-5-20250514",
271+
apiModelId: "claude-4.5-sonnet",
272272
})
273273
const model = handler.getModel()
274-
expect(model.id).toBe("claude-sonnet-4-5-20250514")
274+
expect(model.id).toBe("claude-4.5-sonnet")
275275
expect(model.info.maxTokens).toBe(64000)
276276
expect(model.info.contextWindow).toBe(200000)
277277
expect(model.info.supportsReasoningBudget).toBe(true)
@@ -280,7 +280,7 @@ describe("AnthropicHandler", () => {
280280
it("should enable 1M context for Claude 4.5 Sonnet when beta flag is set", () => {
281281
const handler = new AnthropicHandler({
282282
apiKey: "test-api-key",
283-
apiModelId: "claude-sonnet-4-5-20250514",
283+
apiModelId: "claude-4.5-sonnet",
284284
anthropicBeta1MContext: true,
285285
})
286286
const model = handler.getModel()

src/api/providers/anthropic.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
4747

4848
// Add 1M context beta flag if enabled for Claude Sonnet 4 and 4.5
4949
if (
50-
(modelId === "claude-sonnet-4-20250514" || modelId === "claude-sonnet-4-5-20250514") &&
50+
(modelId === "claude-sonnet-4-20250514" || modelId === "claude-4.5-sonnet") &&
5151
this.options.anthropicBeta1MContext
5252
) {
5353
betas.push("context-1m-2025-08-07")
5454
}
5555

5656
switch (modelId) {
57-
case "claude-sonnet-4-5-20250514":
57+
case "claude-4.5-sonnet":
5858
case "claude-sonnet-4-20250514":
5959
case "claude-opus-4-1-20250805":
6060
case "claude-opus-4-20250514":
@@ -114,7 +114,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
114114

115115
// Then check for models that support prompt caching
116116
switch (modelId) {
117-
case "claude-sonnet-4-5-20250514":
117+
case "claude-4.5-sonnet":
118118
case "claude-sonnet-4-20250514":
119119
case "claude-opus-4-1-20250805":
120120
case "claude-opus-4-20250514":
@@ -249,10 +249,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
249249
let info: ModelInfo = anthropicModels[id]
250250

251251
// If 1M context beta is enabled for Claude Sonnet 4 or 4.5, update the model info
252-
if (
253-
(id === "claude-sonnet-4-20250514" || id === "claude-sonnet-4-5-20250514") &&
254-
this.options.anthropicBeta1MContext
255-
) {
252+
if ((id === "claude-sonnet-4-20250514" || id === "claude-4.5-sonnet") && this.options.anthropicBeta1MContext) {
256253
// Use the tier pricing for 1M context
257254
const tier = info.tiers?.[0]
258255
if (tier) {

webview-ui/src/components/settings/providers/Anthropic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const Anthropic = ({ apiConfiguration, setApiConfigurationField }: Anthro
2323

2424
// Check if the current model supports 1M context beta
2525
const supports1MContextBeta =
26-
selectedModel?.id === "claude-sonnet-4-20250514" || selectedModel?.id === "claude-sonnet-4-5-20250514"
26+
selectedModel?.id === "claude-sonnet-4-20250514" || selectedModel?.id === "claude-4.5-sonnet"
2727

2828
const handleInputChange = useCallback(
2929
<K extends keyof ProviderSettings, E>(

0 commit comments

Comments
 (0)