Skip to content

Commit 7da8400

Browse files
committed
Non-thinking sonnet has 8192 max tokens
1 parent 000df18 commit 7da8400

File tree

8 files changed

+8
-14
lines changed

8 files changed

+8
-14
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ describe("AnthropicHandler", () => {
218218
})
219219

220220
const result = handler.getModel()
221-
expect(result.maxTokens).toBe(16_384)
221+
expect(result.maxTokens).toBe(8192)
222222
expect(result.thinking).toBeUndefined()
223223
expect(result.temperature).toBe(0)
224224
})

src/api/providers/__tests__/vertex.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ describe("VertexHandler", () => {
309309
},
310310
],
311311
generationConfig: {
312-
maxOutputTokens: 16384,
312+
maxOutputTokens: 8192,
313313
temperature: 0,
314314
},
315315
})
@@ -914,7 +914,7 @@ describe("VertexHandler", () => {
914914
})
915915

916916
const result = handler.getModel()
917-
expect(result.maxTokens).toBe(16_384)
917+
expect(result.maxTokens).toBe(8192)
918918
expect(result.thinking).toBeUndefined()
919919
expect(result.temperature).toBe(0)
920920
})

src/api/providers/glama.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ export async function getGlamaModels() {
217217
}
218218

219219
switch (rawModel.id) {
220-
case rawModel.id.startsWith("anthropic/claude-3-7-sonnet"):
221-
modelInfo.maxTokens = 16384
222-
break
223220
case rawModel.id.startsWith("anthropic/"):
224221
modelInfo.maxTokens = 8192
225222
break

src/api/providers/openrouter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export async function getOpenRouterModels(options?: ApiHandlerOptions) {
261261
modelInfo.supportsPromptCache = true
262262
modelInfo.cacheWritesPrice = 3.75
263263
modelInfo.cacheReadsPrice = 0.3
264-
modelInfo.maxTokens = rawModel.id === "anthropic/claude-3.7-sonnet:thinking" ? 128_000 : 16_384
264+
modelInfo.maxTokens = rawModel.id === "anthropic/claude-3.7-sonnet:thinking" ? 128_000 : 8192
265265
break
266266
case rawModel.id.startsWith("anthropic/claude-3.5-sonnet-20240620"):
267267
modelInfo.supportsPromptCache = true

src/api/providers/unbound.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@ export async function getUnboundModels() {
211211
}
212212

213213
switch (true) {
214-
case modelId.startsWith("anthropic/claude-3-7-sonnet"):
215-
modelInfo.maxTokens = 16384
216-
break
217214
case modelId.startsWith("anthropic/"):
218215
modelInfo.maxTokens = 8192
219216
break

src/shared/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const anthropicModels = {
174174
thinking: true,
175175
},
176176
"claude-3-7-sonnet-20250219": {
177-
maxTokens: 16_384,
177+
maxTokens: 8192,
178178
contextWindow: 200_000,
179179
supportsImages: true,
180180
supportsComputerUse: true,
@@ -667,7 +667,7 @@ export const vertexModels = {
667667
thinking: true,
668668
},
669669
"claude-3-7-sonnet@20250219": {
670-
maxTokens: 16_384,
670+
maxTokens: 8192,
671671
contextWindow: 200_000,
672672
supportsImages: true,
673673
supportsComputerUse: true,

webview-ui/src/components/ui/hooks/useOpenRouterModelProviders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async function getOpenRouterProvidersForModel(modelId: string) {
7575
modelInfo.supportsPromptCache = true
7676
modelInfo.cacheWritesPrice = 3.75
7777
modelInfo.cacheReadsPrice = 0.3
78-
modelInfo.maxTokens = id === "anthropic/claude-3.7-sonnet:thinking" ? 64_000 : 16_384
78+
modelInfo.maxTokens = id === "anthropic/claude-3.7-sonnet:thinking" ? 64_000 : 8192
7979
break
8080
case modelId.startsWith("anthropic/claude-3.5-sonnet-20240620"):
8181
modelInfo.supportsPromptCache = true

webview-ui/src/utils/__tests__/model-utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("Model utility functions", () => {
1515
/**
1616
* Testing the specific fix in commit cc79178f:
1717
* For thinking models, use apiConfig.modelMaxTokens if available,
18-
* otherwise fall back to 16_384 (not modelInfo.maxTokens)
18+
* otherwise fall back to 8192 (not modelInfo.maxTokens)
1919
*/
2020

2121
it("should return apiConfig.modelMaxTokens for thinking models when provided", () => {

0 commit comments

Comments
 (0)