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

Commit 28c6d27

Browse files
committed
Add support for Deepseek V4 Pro and Deepseek V4 Flash
1 parent 96d6e43 commit 28c6d27

6 files changed

Lines changed: 144 additions & 2 deletions

File tree

packages/types/src/providers/baseten.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,28 @@ export const basetenModels = {
8383
description:
8484
"DeepSeek's hybrid reasoning model with efficient long context scaling with GPT-5 level performance",
8585
},
86+
"deepseek-ai/DeepSeek-V4-Pro": {
87+
maxTokens: 384_000,
88+
contextWindow: 1_000_000,
89+
supportsImages: false,
90+
supportsPromptCache: true,
91+
inputPrice: 12,
92+
outputPrice: 24,
93+
cacheWritesPrice: 0,
94+
cacheReadsPrice: 1,
95+
description: "DeepSeek V4 Pro",
96+
},
97+
"deepseek-ai/DeepSeek-V4-Flash": {
98+
maxTokens: 384_000,
99+
contextWindow: 1_000_000,
100+
supportsImages: false,
101+
supportsPromptCache: true,
102+
inputPrice: 0.2,
103+
outputPrice: 1,
104+
cacheWritesPrice: 0,
105+
cacheReadsPrice: 1,
106+
description: "DeepSeek V4 Flash",
107+
},
86108
"openai/gpt-oss-120b": {
87109
maxTokens: 16_384,
88110
contextWindow: 128_072,

packages/types/src/providers/deepseek.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,30 @@ export const deepSeekModels = {
3232
cacheReadsPrice: 0.028, // $0.028 per million tokens (cache hit) - Updated Dec 9, 2025
3333
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).`,
3434
},
35+
"deepseek-v4-pro": {
36+
maxTokens: 384_000,
37+
contextWindow: 1_000_000,
38+
supportsImages: false,
39+
supportsPromptCache: true,
40+
preserveReasoning: true,
41+
inputPrice: 12,
42+
outputPrice: 24,
43+
cacheWritesPrice: 0,
44+
cacheReadsPrice: 1,
45+
description: `DeepSeek V4 Pro`,
46+
},
47+
"deepseek-v4-flash": {
48+
maxTokens: 384_000,
49+
contextWindow: 1_000_000,
50+
supportsImages: false,
51+
supportsPromptCache: true,
52+
preserveReasoning: true,
53+
inputPrice: 0.2,
54+
outputPrice: 1,
55+
cacheWritesPrice: 0,
56+
cacheReadsPrice: 1,
57+
description: `DeepSeek V4 Flash`,
58+
},
3559
} as const satisfies Record<string, ModelInfo>
3660

3761
// https://api-docs.deepseek.com/quick_start/parameter_settings

packages/types/src/providers/fireworks.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export type FireworksModelId =
1313
| "accounts/fireworks/models/deepseek-v3"
1414
| "accounts/fireworks/models/deepseek-v3p1"
1515
| "accounts/fireworks/models/deepseek-v3p2"
16+
| "accounts/fireworks/models/deepseek-v4-pro"
17+
| "accounts/fireworks/models/deepseek-v4-flash"
1618
| "accounts/fireworks/models/glm-4p5"
1719
| "accounts/fireworks/models/glm-4p5-air"
1820
| "accounts/fireworks/models/glm-4p6"
@@ -200,6 +202,28 @@ export const fireworksModels = {
200202
description:
201203
"DeepSeek V3.2 is the latest iteration of the V3 model family with enhanced reasoning capabilities, improved code generation, and better instruction following.",
202204
},
205+
"accounts/fireworks/models/deepseek-v4-pro": {
206+
maxTokens: 384_000,
207+
contextWindow: 1_000_000,
208+
supportsImages: false,
209+
supportsPromptCache: true,
210+
inputPrice: 12,
211+
outputPrice: 24,
212+
cacheWritesPrice: 0,
213+
cacheReadsPrice: 1,
214+
description: "DeepSeek V4 Pro",
215+
},
216+
"accounts/fireworks/models/deepseek-v4-flash": {
217+
maxTokens: 384_000,
218+
contextWindow: 1_000_000,
219+
supportsImages: false,
220+
supportsPromptCache: true,
221+
inputPrice: 0.2,
222+
outputPrice: 1,
223+
cacheWritesPrice: 0,
224+
cacheReadsPrice: 1,
225+
description: "DeepSeek V4 Flash",
226+
},
203227
"accounts/fireworks/models/glm-4p7": {
204228
maxTokens: 25344,
205229
contextWindow: 198000,

packages/types/src/providers/sambanova.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type SambaNovaModelId =
77
| "DeepSeek-R1"
88
| "DeepSeek-V3-0324"
99
| "DeepSeek-V3.1"
10+
| "DeepSeek-V4-Pro"
1011
| "Llama-4-Maverick-17B-128E-Instruct"
1112
| "Qwen3-32B"
1213
| "gpt-oss-120b"
@@ -60,6 +61,28 @@ export const sambaNovaModels = {
6061
outputPrice: 4.5,
6162
description: "DeepSeek V3.1 model with 32K context window.",
6263
},
64+
"DeepSeek-V4-Pro": {
65+
maxTokens: 384_000,
66+
contextWindow: 1_000_000,
67+
supportsImages: false,
68+
supportsPromptCache: true,
69+
inputPrice: 12,
70+
outputPrice: 24,
71+
cacheWritesPrice: 0,
72+
cacheReadsPrice: 1,
73+
description: "DeepSeek V4 Pro",
74+
},
75+
"deepseek-ai/DeepSeek-V4-Flash": {
76+
maxTokens: 384_000,
77+
contextWindow: 1_000_000,
78+
supportsImages: false,
79+
supportsPromptCache: true,
80+
inputPrice: 0.2,
81+
outputPrice: 1,
82+
cacheWritesPrice: 0,
83+
cacheReadsPrice: 1,
84+
description: "DeepSeek V4 Flash",
85+
},
6386
"Llama-4-Maverick-17B-128E-Instruct": {
6487
maxTokens: 8192,
6588
contextWindow: 131072,

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,52 @@ describe("FireworksHandler", () => {
245245
)
246246
})
247247

248+
it("should return DeepSeek V4 Pro model with correct configuration", () => {
249+
const testModelId: FireworksModelId = "accounts/fireworks/models/deepseek-v4-pro"
250+
const handlerWithModel = new FireworksHandler({
251+
apiModelId: testModelId,
252+
fireworksApiKey: "test-fireworks-api-key",
253+
})
254+
const model = handlerWithModel.getModel()
255+
expect(model.id).toBe(testModelId)
256+
expect(model.info).toEqual(
257+
expect.objectContaining({
258+
maxTokens: 384_000,
259+
contextWindow: 1_000_000,
260+
supportsImages: false,
261+
supportsPromptCache: true,
262+
inputPrice: 12,
263+
outputPrice: 24,
264+
cacheWritesPrice: 0,
265+
cacheReadsPrice: 1,
266+
description: expect.stringContaining("DeepSeek V4 Pro"),
267+
}),
268+
)
269+
})
270+
271+
it("should return DeepSeek V4 Flash model with correct configuration", () => {
272+
const testModelId: FireworksModelId = "accounts/fireworks/models/deepseek-v4-flash"
273+
const handlerWithModel = new FireworksHandler({
274+
apiModelId: testModelId,
275+
fireworksApiKey: "test-fireworks-api-key",
276+
})
277+
const model = handlerWithModel.getModel()
278+
expect(model.id).toBe(testModelId)
279+
expect(model.info).toEqual(
280+
expect.objectContaining({
281+
maxTokens: 384_000,
282+
contextWindow: 1_000_000,
283+
supportsImages: false,
284+
supportsPromptCache: true,
285+
inputPrice: 0.2,
286+
outputPrice: 1,
287+
cacheWritesPrice: 0,
288+
cacheReadsPrice: 1,
289+
description: expect.stringContaining("DeepSeek V4 Flash"),
290+
}),
291+
)
292+
})
293+
248294
it("should return GLM-4.5 model with correct configuration", () => {
249295
const testModelId: FireworksModelId = "accounts/fireworks/models/glm-4p5"
250296
const handlerWithModel = new FireworksHandler({

src/api/providers/deepseek.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ export class DeepSeekHandler extends OpenAiHandler {
5555
const modelId = this.options.apiModelId ?? deepSeekDefaultModelId
5656
const { info: modelInfo } = this.getModel()
5757

58-
// Check if this is a thinking-enabled model (deepseek-reasoner)
59-
const isThinkingModel = modelId.includes("deepseek-reasoner")
58+
// Check if this is a thinking-enabled model (deepseek-reasoner, deepseek-v4-pro, deepseek-v4-flash)
59+
const isThinkingModel =
60+
modelId.includes("deepseek-reasoner") ||
61+
modelId.includes("deepseek-v4-pro") ||
62+
modelId.includes("deepseek-v4-flash")
6063

6164
// Convert messages to R1 format (merges consecutive same-role messages)
6265
// This is required for DeepSeek which does not support successive messages with the same role

0 commit comments

Comments
 (0)