feat: add deepseek-coder model to DeepSeek provider

- Added deepseek-coder model configuration with 8K max output tokens
- Added test coverage for the new model
- Fixes issue where users could not select deepseek-coder model

Fixes #7773
This commit is contained in:
Roo Code 2025-09-08 02:14:49 +00:00
parent 25717817a6
commit 47509bc486
2 changed files with 25 additions and 0 deletions

View file

@ -17,6 +17,17 @@ export const deepSeekModels = {
cacheReadsPrice: 0.07, // $0.07 per million tokens (cache hit) - Updated Sept 5, 2025
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-coder": {
maxTokens: 8192, // 8K max output
contextWindow: 128_000,
supportsImages: false,
supportsPromptCache: true,
inputPrice: 0.56, // $0.56 per million tokens (cache miss) - Updated Sept 5, 2025
outputPrice: 1.68, // $1.68 per million tokens - Updated Sept 5, 2025
cacheWritesPrice: 0.56, // $0.56 per million tokens (cache miss) - Updated Sept 5, 2025
cacheReadsPrice: 0.07, // $0.07 per million tokens (cache hit) - Updated Sept 5, 2025
description: `DeepSeek-Coder-V3 is specifically optimized for code generation, completion, and understanding tasks. It excels at programming challenges across multiple languages.`,
},
"deepseek-reasoner": {
maxTokens: 65536, // 64K max output for reasoning mode
contextWindow: 128_000,

View file

@ -160,6 +160,20 @@ describe("DeepSeekHandler", () => {
expect(model.info.supportsPromptCache).toBe(true) // Should be true now
})
it("should return correct model info for deepseek-coder", () => {
const handlerWithCoder = new DeepSeekHandler({
...mockOptions,
apiModelId: "deepseek-coder",
})
const model = handlerWithCoder.getModel()
expect(model.id).toBe("deepseek-coder")
expect(model.info).toBeDefined()
expect(model.info.maxTokens).toBe(8192) // deepseek-coder has 8K max
expect(model.info.contextWindow).toBe(128_000)
expect(model.info.supportsImages).toBe(false)
expect(model.info.supportsPromptCache).toBe(true)
})
it("should return correct model info for deepseek-reasoner", () => {
const handlerWithReasoner = new DeepSeekHandler({
...mockOptions,