Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 67457a3

Browse files
committed
Remove legacy DeepSeek model aliases
1 parent e882b9d commit 67457a3

5 files changed

Lines changed: 29 additions & 90 deletions

File tree

packages/types/src/providers/deepseek.ts

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,9 @@ import type { ModelInfo } from "../model.js"
66
// continuation within the same turn. See: https://api-docs.deepseek.com/guides/thinking_mode
77
export type DeepSeekModelId = keyof typeof deepSeekModels
88

9-
export const deepSeekDefaultModelId: DeepSeekModelId = "deepseek-chat"
9+
export const deepSeekDefaultModelId: DeepSeekModelId = "deepseek-v4-flash"
1010

1111
export const deepSeekModels = {
12-
"deepseek-chat": {
13-
maxTokens: 8192, // 8K max output
14-
contextWindow: 128_000,
15-
supportsImages: false,
16-
supportsPromptCache: true,
17-
inputPrice: 0.28, // $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
18-
outputPrice: 0.42, // $0.42 per million tokens - Updated Dec 9, 2025
19-
cacheWritesPrice: 0.28, // $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
20-
cacheReadsPrice: 0.028, // $0.028 per million tokens (cache hit) - Updated Dec 9, 2025
21-
description: `DeepSeek-V3.2 (Non-thinking Mode) 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. Supports JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta).`,
22-
},
23-
"deepseek-reasoner": {
24-
maxTokens: 8192, // 8K max output
25-
contextWindow: 128_000,
26-
supportsImages: false,
27-
supportsPromptCache: true,
28-
preserveReasoning: true,
29-
inputPrice: 0.28, // $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
30-
outputPrice: 0.42, // $0.42 per million tokens - Updated Dec 9, 2025
31-
cacheWritesPrice: 0.28, // $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
32-
cacheReadsPrice: 0.028, // $0.028 per million tokens (cache hit) - Updated Dec 9, 2025
33-
description: `DeepSeek-V3.2 (Thinking Mode) achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks. Supports Chain of Thought reasoning with up to 8K output tokens. Supports JSON output, tool calls, and chat prefix completion (beta).`,
34-
},
3512
"deepseek-v4-flash": {
3613
maxTokens: 384_000, // 384K max output
3714
contextWindow: 1_000_000,
@@ -40,10 +17,10 @@ export const deepSeekModels = {
4017
preserveReasoning: true,
4118
supportsReasoningEffort: ["disable", "high", "xhigh"],
4219
reasoningEffort: "high",
43-
inputPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated Apr 24, 2026
44-
outputPrice: 0.28, // $0.28 per million tokens - Updated Apr 24, 2026
45-
cacheWritesPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated Apr 24, 2026
46-
cacheReadsPrice: 0.0028, // $0.0028 per million tokens (cache hit) - Updated Apr 24, 2026
20+
inputPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated Apr 30, 2026
21+
outputPrice: 0.28, // $0.28 per million tokens - Updated Apr 30, 2026
22+
cacheWritesPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated Apr 30, 2026
23+
cacheReadsPrice: 0.0028, // $0.0028 per million tokens (cache hit) - Updated Apr 30, 2026
4724
description: `DeepSeek-V4 Flash supports 1M context, 384K max output, tool calls, and thinking/non-thinking modes.`,
4825
},
4926
"deepseek-v4-pro": {
@@ -54,10 +31,10 @@ export const deepSeekModels = {
5431
preserveReasoning: true,
5532
supportsReasoningEffort: ["disable", "high", "xhigh"],
5633
reasoningEffort: "high",
57-
inputPrice: 0.435, // $0.435 per million tokens (cache miss) - Updated Apr 24, 2026
58-
outputPrice: 0.87, // $0.87 per million tokens - Updated Apr 24, 2026
59-
cacheWritesPrice: 0.435, // $0.435 per million tokens (cache miss) - Updated Apr 24, 2026
60-
cacheReadsPrice: 0.003625, // $0.003625 per million tokens (cache hit) - Updated Apr 24, 2026
34+
inputPrice: 0.435, // $0.435 per million tokens (cache miss, 75% off until May 31, 2026) - Updated Apr 30, 2026
35+
outputPrice: 0.87, // $0.87 per million tokens (75% off until May 31, 2026) - Updated Apr 30, 2026
36+
cacheWritesPrice: 0.435, // $0.435 per million tokens (cache miss, 75% off until May 31, 2026) - Updated Apr 30, 2026
37+
cacheReadsPrice: 0.003625, // $0.003625 per million tokens (cache hit, 75% off until May 31, 2026) - Updated Apr 30, 2026
6138
description: `DeepSeek-V4 Pro supports 1M context, 384K max output, tool calls, and thinking/non-thinking modes.`,
6239
},
6340
} as const satisfies Record<string, ModelInfo>

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

Lines changed: 13 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ vi.mock("openai", () => {
3030
}
3131

3232
// Check if this is a reasoning_content test by looking at model
33-
const isReasonerModel =
34-
options.model?.includes("deepseek-reasoner") || options.model?.includes("deepseek-v4")
33+
const isReasonerModel = options.model?.includes("deepseek-v4")
3534
const isToolCallTest = options.tools?.length > 0
3635

3736
// Return async iterator for streaming
@@ -136,7 +135,7 @@ describe("DeepSeekHandler", () => {
136135
beforeEach(() => {
137136
mockOptions = {
138137
deepSeekApiKey: "test-api-key",
139-
apiModelId: "deepseek-chat",
138+
apiModelId: "deepseek-v4-flash",
140139
deepSeekBaseUrl: "https://api.deepseek.com",
141140
}
142141
handler = new DeepSeekHandler(mockOptions)
@@ -207,22 +206,8 @@ describe("DeepSeekHandler", () => {
207206
const model = handler.getModel()
208207
expect(model.id).toBe(mockOptions.apiModelId)
209208
expect(model.info).toBeDefined()
210-
expect(model.info.maxTokens).toBe(8192) // deepseek-chat has 8K max
211-
expect(model.info.contextWindow).toBe(128_000)
212-
expect(model.info.supportsImages).toBe(false)
213-
expect(model.info.supportsPromptCache).toBe(true) // Should be true now
214-
})
215-
216-
it("should return correct model info for deepseek-reasoner", () => {
217-
const handlerWithReasoner = new DeepSeekHandler({
218-
...mockOptions,
219-
apiModelId: "deepseek-reasoner",
220-
})
221-
const model = handlerWithReasoner.getModel()
222-
expect(model.id).toBe("deepseek-reasoner")
223-
expect(model.info).toBeDefined()
224-
expect(model.info.maxTokens).toBe(8192) // deepseek-reasoner has 8K max
225-
expect(model.info.contextWindow).toBe(128_000)
209+
expect(model.info.maxTokens).toBe(384_000)
210+
expect(model.info.contextWindow).toBe(1_000_000)
226211
expect(model.info.supportsImages).toBe(false)
227212
expect(model.info.supportsPromptCache).toBe(true)
228213
})
@@ -249,27 +234,20 @@ describe("DeepSeekHandler", () => {
249234
expect(model.info).toBe(expectedInfo)
250235
})
251236

252-
it("should have preserveReasoning enabled for deepseek-reasoner to support interleaved thinking", () => {
237+
it("should have preserveReasoning enabled for DeepSeek V4 models to support interleaved thinking", () => {
253238
// This is critical for DeepSeek's interleaved thinking mode with tool calls.
254239
// See: https://api-docs.deepseek.com/guides/thinking_mode
255240
// The reasoning_content needs to be passed back during tool call continuation
256241
// within the same turn for the model to continue reasoning properly.
257-
const handlerWithReasoner = new DeepSeekHandler({
242+
const handlerWithV4 = new DeepSeekHandler({
258243
...mockOptions,
259-
apiModelId: "deepseek-reasoner",
244+
apiModelId: "deepseek-v4-pro",
260245
})
261-
const model = handlerWithReasoner.getModel()
246+
const model = handlerWithV4.getModel()
262247
// Cast to ModelInfo to access preserveReasoning which is an optional property
263248
expect((model.info as ModelInfo).preserveReasoning).toBe(true)
264249
})
265250

266-
it("should NOT have preserveReasoning enabled for deepseek-chat", () => {
267-
// deepseek-chat doesn't use thinking mode, so no need to preserve reasoning
268-
const model = handler.getModel()
269-
// Cast to ModelInfo to access preserveReasoning which is an optional property
270-
expect((model.info as ModelInfo).preserveReasoning).toBeUndefined()
271-
})
272-
273251
it("should return provided model ID with default model info if model does not exist", () => {
274252
const handlerWithInvalidModel = new DeepSeekHandler({
275253
...mockOptions,
@@ -442,10 +420,10 @@ describe("DeepSeekHandler", () => {
442420
},
443421
]
444422

445-
it("should handle reasoning_content in streaming responses for deepseek-reasoner", async () => {
423+
it("should handle reasoning_content in streaming responses for DeepSeek V4", async () => {
446424
const reasonerHandler = new DeepSeekHandler({
447425
...mockOptions,
448-
apiModelId: "deepseek-reasoner",
426+
apiModelId: "deepseek-v4-pro",
449427
})
450428

451429
const stream = reasonerHandler.createMessage(systemPrompt, messages)
@@ -461,10 +439,10 @@ describe("DeepSeekHandler", () => {
461439
expect(reasoningChunks[1].text).toBe(" I'll analyze step by step.")
462440
})
463441

464-
it("should pass thinking parameter for deepseek-reasoner model", async () => {
442+
it("should pass thinking parameter for DeepSeek V4 models", async () => {
465443
const reasonerHandler = new DeepSeekHandler({
466444
...mockOptions,
467-
apiModelId: "deepseek-reasoner",
445+
apiModelId: "deepseek-v4-pro",
468446
})
469447

470448
const stream = reasonerHandler.createMessage(systemPrompt, messages)
@@ -482,22 +460,6 @@ describe("DeepSeekHandler", () => {
482460
)
483461
})
484462

485-
it("should NOT pass thinking parameter for deepseek-chat model", async () => {
486-
const chatHandler = new DeepSeekHandler({
487-
...mockOptions,
488-
apiModelId: "deepseek-chat",
489-
})
490-
491-
const stream = chatHandler.createMessage(systemPrompt, messages)
492-
for await (const _chunk of stream) {
493-
// Consume the stream
494-
}
495-
496-
// Verify that the thinking parameter was NOT passed to the API
497-
const callArgs = mockCreate.mock.calls[0][0]
498-
expect(callArgs.thinking).toBeUndefined()
499-
})
500-
501463
it("should pass reasoning parameters for DeepSeek V4 models", async () => {
502464
const v4Handler = new DeepSeekHandler({
503465
...mockOptions,
@@ -555,7 +517,7 @@ describe("DeepSeekHandler", () => {
555517
it("should handle tool calls with reasoning_content", async () => {
556518
const reasonerHandler = new DeepSeekHandler({
557519
...mockOptions,
558-
apiModelId: "deepseek-reasoner",
520+
apiModelId: "deepseek-v4-pro",
559521
})
560522

561523
const tools: any[] = [

src/api/providers/deepseek.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class DeepSeekHandler extends OpenAiHandler {
5656
const { info: modelInfo, reasoning } = this.getModel()
5757

5858
const isDeepSeekV4Model = modelId.includes("deepseek-v4")
59-
const isThinkingModel = modelId.includes("deepseek-reasoner") || isDeepSeekV4Model
59+
const isThinkingModel = isDeepSeekV4Model
6060
const thinkingType =
6161
isDeepSeekV4Model &&
6262
(this.options.reasoningEffort === "disable" || this.options.enableReasoningEffort === false)
@@ -68,9 +68,9 @@ export class DeepSeekHandler extends OpenAiHandler {
6868

6969
// Convert messages to R1 format (merges consecutive same-role messages)
7070
// This is required for DeepSeek which does not support successive messages with the same role
71-
// For thinking models (deepseek-reasoner), enable mergeToolResultText to preserve reasoning_content
72-
// during tool call sequences. Without this, environment_details text after tool_results would
73-
// create user messages that cause DeepSeek to drop all previous reasoning_content.
71+
// For thinking models, enable mergeToolResultText to preserve reasoning_content during tool call
72+
// sequences. Without this, environment_details text after tool_results would create user messages
73+
// that cause DeepSeek to drop all previous reasoning_content.
7474
// See: https://api-docs.deepseek.com/guides/thinking_mode
7575
const convertedMessages = convertToR1Format([{ role: "user", content: systemPrompt }, ...messages], {
7676
mergeToolResultText: isThinkingModel,

src/api/providers/openai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
106106
const enabledR1Format = this.options.openAiR1FormatEnabled ?? false
107107
const isAzureAiInference = this._isAzureAiInference(modelUrl)
108108
const isDeepSeekV4Model = modelId.includes("deepseek-v4")
109-
const usesDeepSeekThinkingParam = modelId.includes("deepseek-reasoner") || isDeepSeekV4Model
109+
const usesDeepSeekThinkingParam = isDeepSeekV4Model
110110
const deepseekReasoner = usesDeepSeekThinkingParam || enabledR1Format
111111
const deepseekThinkingType =
112112
isDeepSeekV4Model &&

src/core/config/__tests__/importExport.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ describe("importExport", () => {
21972197
{
21982198
testCase: "supportsReasoningBudget is false",
21992199
providerName: "deepseek-provider",
2200-
modelId: "deepseek-chat",
2200+
modelId: "deepseek-v4-flash",
22012201
providerId: "deepseek-id",
22022202
},
22032203
{
@@ -2209,7 +2209,7 @@ describe("importExport", () => {
22092209
{
22102210
testCase: "both supportsReasoningBudget and requiredReasoningBudget are false",
22112211
providerName: "deepseek-provider-3",
2212-
modelId: "deepseek-reasoner",
2212+
modelId: "deepseek-v4-pro",
22132213
providerId: "deepseek-id-3",
22142214
},
22152215
])(

0 commit comments

Comments
 (0)