fix: update DeepSeek models context window to 128k (#7269)

* fix: update DeepSeek models context window to 128k

- Updated deepseek-chat and deepseek-reasoner models from 64k to 128k context window
- Updated corresponding test expectations
- Aligns with DeepSeek API documentation at https://api-docs.deepseek.com/quick_start/pricing/

Fixes #7268

* feat: update deepseek-reasoner maxTokens to 64K based on official documentation

* fix: use default maxTokens values instead of maximum for DeepSeek models

- deepseek-chat: 4096 (4K default) instead of 8192 (8K max)
- deepseek-reasoner: 32768 (32K default) instead of 65536 (64K max)
- Updated tests to match new default values
- Updated description to clarify default vs max output tokens

* fix: use maximum output tokens for both DeepSeek models

- deepseek-chat: 8192 (8K max)
- deepseek-reasoner: 65536 (64K max)
- Updated tests to match maximum values
- Updated description to reflect 64K max output

---------

Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
This commit is contained in:
roomote[bot] 2025-08-21 15:03:35 -07:00 committed by GitHub
parent 44fd6432dc
commit 9fe06db921
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 7 deletions

View file

@ -7,8 +7,8 @@ export const deepSeekDefaultModelId: DeepSeekModelId = "deepseek-chat"
export const deepSeekModels = {
"deepseek-chat": {
maxTokens: 8192,
contextWindow: 64_000,
maxTokens: 8192, // 8K max output
contextWindow: 128_000,
supportsImages: false,
supportsPromptCache: true,
inputPrice: 0.27, // $0.27 per million tokens (cache miss)
@ -18,15 +18,15 @@ export const deepSeekModels = {
description: `DeepSeek-V3 achieves a significant breakthrough in inference speed over previous models. It tops the leaderboard among open-source models and rivals the most advanced closed-source models globally.`,
},
"deepseek-reasoner": {
maxTokens: 8192,
contextWindow: 64_000,
maxTokens: 65536, // 64K max output for reasoning mode
contextWindow: 128_000,
supportsImages: false,
supportsPromptCache: true,
inputPrice: 0.55, // $0.55 per million tokens (cache miss)
outputPrice: 2.19, // $2.19 per million tokens
cacheWritesPrice: 0.55, // $0.55 per million tokens (cache miss)
cacheReadsPrice: 0.14, // $0.14 per million tokens (cache hit)
description: `DeepSeek-R1 achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks. Supports Chain of Thought reasoning with up to 32K tokens.`,
description: `DeepSeek-R1 achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks. Supports Chain of Thought reasoning with up to 64K output tokens.`,
},
} as const satisfies Record<string, ModelInfo>

View file

@ -154,12 +154,26 @@ describe("DeepSeekHandler", () => {
const model = handler.getModel()
expect(model.id).toBe(mockOptions.apiModelId)
expect(model.info).toBeDefined()
expect(model.info.maxTokens).toBe(8192)
expect(model.info.contextWindow).toBe(64_000)
expect(model.info.maxTokens).toBe(8192) // deepseek-chat has 8K max
expect(model.info.contextWindow).toBe(128_000)
expect(model.info.supportsImages).toBe(false)
expect(model.info.supportsPromptCache).toBe(true) // Should be true now
})
it("should return correct model info for deepseek-reasoner", () => {
const handlerWithReasoner = new DeepSeekHandler({
...mockOptions,
apiModelId: "deepseek-reasoner",
})
const model = handlerWithReasoner.getModel()
expect(model.id).toBe("deepseek-reasoner")
expect(model.info).toBeDefined()
expect(model.info.maxTokens).toBe(65536) // deepseek-reasoner has 64K max
expect(model.info.contextWindow).toBe(128_000)
expect(model.info.supportsImages).toBe(false)
expect(model.info.supportsPromptCache).toBe(true)
})
it("should return provided model ID with default model info if model does not exist", () => {
const handlerWithInvalidModel = new DeepSeekHandler({
...mockOptions,