Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions packages/types/src/__tests__/deepseek-v4-pro.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { basetenModels, deepSeekModels, fireworksModels, opencodeGoModels } from "../providers/index.js"

describe("DeepSeek V4 Pro 0813 provider catalogs", () => {
it.each([
["DeepSeek", deepSeekModels["deepseek-v4-pro"]],
["OpenCode Go", opencodeGoModels["deepseek-v4-pro"]],
])("labels the first-party API checkpoint through %s", (_provider, model) => {
expect(model).toBeDefined()
expect(model?.displayName).toBe("DeepSeek V4 Pro 0813")
expect(model?.contextWindow).toBeGreaterThanOrEqual(1_000_000)
})

it("uses peak first-party pricing and unchanged OpenCode Go pricing", () => {
expect(deepSeekModels["deepseek-v4-flash"]).toMatchObject({
supportsImages: false,
outputPrice: 1.32,
cacheWritesPrice: 0.44,
cacheReadsPrice: 0.014,
})
expect(deepSeekModels["deepseek-v4-pro"].supportsImages).toBe(false)
expect(deepSeekModels["deepseek-v4-pro"]).toMatchObject({
outputPrice: 3.96,
cacheWritesPrice: 1.32,
cacheReadsPrice: 0.044,
})
expect(opencodeGoModels["deepseek-v4-pro"]).toMatchObject({
inputPrice: 0.435,
outputPrice: 0.87,
cacheReadsPrice: 0.003625,
})
expect(opencodeGoModels["deepseek-v4-flash"]).toMatchObject({
inputPrice: 0.14,
outputPrice: 0.28,
cacheReadsPrice: 0.0028,
})
})

// Self-hosted providers retain separate IDs for the preview weights and 0813 checkpoint.
it.each([
["Fireworks AI", fireworksModels["accounts/fireworks/models/deepseek-v4-pro"]],
["Baseten", basetenModels["deepseek-ai/DeepSeek-V4-Pro"]],
])("does not apply the API checkpoint label to %s", (_provider, model) => {
expect(model).toBeDefined()
expect("displayName" in model && typeof model.displayName === "string" ? model.displayName : "").not.toContain(
"0813",
)
expect(model?.contextWindow).toBeGreaterThanOrEqual(1_000_000)
})

it.each([
[
"Fireworks AI",
fireworksModels["accounts/fireworks/models/deepseek-v4-pro-0813"],
{ inputPrice: 1.32, outputPrice: 3.96, cacheReadsPrice: 0.044 },
],
[
"Baseten",
basetenModels["deepseek-ai/DeepSeek-V4-Pro-0813"],
{ inputPrice: 1.32, outputPrice: 3.96, cacheReadsPrice: 0.132 },
],
])("publishes the dated checkpoint and provider-specific pricing for %s", (_provider, model, pricing) => {
expect(model).toMatchObject({
displayName: "DeepSeek V4 Pro 0813",
...pricing,
})
})

it("keeps preview pricing separate and omits unverified cache-write prices", () => {
expect(fireworksModels["accounts/fireworks/models/deepseek-v4-pro"]).toMatchObject({
inputPrice: 1.74,
outputPrice: 3.48,
cacheReadsPrice: 0.145,
})
expect(basetenModels["deepseek-ai/DeepSeek-V4-Pro"]).toMatchObject({
inputPrice: 1.74,
outputPrice: 3.48,
cacheReadsPrice: 0.145,
})
expect(basetenModels["deepseek-ai/DeepSeek-V4-Pro"]).not.toHaveProperty("cacheWritesPrice")
expect(basetenModels["deepseek-ai/DeepSeek-V4-Pro-0813"]).not.toHaveProperty("cacheWritesPrice")
})
})
26 changes: 26 additions & 0 deletions packages/types/src/providers/baseten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,32 @@ export const basetenModels = {
description:
"DeepSeek's hybrid reasoning model with efficient long context scaling with GPT-5 level performance",
},
"deepseek-ai/DeepSeek-V4-Pro": {
displayName: "DeepSeek V4 Pro",
maxTokens: 384_000,
contextWindow: 1_000_000,
supportsImages: false,
supportsPromptCache: true,
supportsMaxTokens: true,
inputPrice: 1.74,
outputPrice: 3.48,
cacheReadsPrice: 0.145,
description:
"DeepSeek V4 Pro is a 1.6T-parameter mixture-of-experts model with a 1M context window for advanced reasoning, coding, and agentic workloads.",
},
"deepseek-ai/DeepSeek-V4-Pro-0813": {
displayName: "DeepSeek V4 Pro 0813",
maxTokens: 384_000,
contextWindow: 1_000_000,
supportsImages: false,
supportsPromptCache: true,
supportsMaxTokens: true,
inputPrice: 1.32,
outputPrice: 3.96,
cacheReadsPrice: 0.132,
description:
"DeepSeek V4 Pro 0813 is a 1.6T-parameter mixture-of-experts model with a 1M context window for advanced reasoning, coding, and agentic workloads.",
},
"openai/gpt-oss-120b": {
maxTokens: 16_384,
contextWindow: 128_072,
Expand Down
23 changes: 12 additions & 11 deletions packages/types/src/providers/deepseek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,33 @@ export const deepSeekModels = {
"deepseek-v4-flash": {
maxTokens: 384_000,
contextWindow: 1_000_000,
supportsImages: true,
supportsImages: false,
supportsPromptCache: true,
supportsReasoningEffort: ["disable", "low", "high", "max"], // Updated 2026-08-01
preserveReasoning: true,
reasoningEffort: "high",
inputPrice: 0, // the inputs are priced as cache read/write, so `inputPrice` should be 0
// the peak/off-peak pricing policy has not been implemented yet - Updated 2026-08-01
outputPrice: 0.28, // $0.28 per million tokens - Updated 2026-08-01
cacheWritesPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated 2026-08-01
cacheReadsPrice: 0.0028, // $0.0028 per million tokens (cache hit) - Updated 2026-08-01
// Static estimates use peak rates; off-peak rates are 50% lower. Effective 2026-08-16.
outputPrice: 1.32,
cacheWritesPrice: 0.44,
cacheReadsPrice: 0.014,
description: `DeepSeek-V4-Flash is DeepSeek's fast, cost-efficient V4 model. It supports thinking and non-thinking modes, JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta) in non-thinking mode.`,
},
"deepseek-v4-pro": {
displayName: "DeepSeek V4 Pro 0813",
maxTokens: 384_000,
contextWindow: 1_000_000,
supportsImages: true,
supportsImages: false,
supportsPromptCache: true,
supportsReasoningEffort: ["disable", "high", "max"], // Updated 2026-08-01
preserveReasoning: true,
reasoningEffort: "high",
inputPrice: 0, // the inputs are priced as cache read/write, so `inputPrice` should be 0
// the peak/off-peak pricing policy has not been implemented yet - Updated 2026-08-01
outputPrice: 0.87, // $0.87 per million tokens - Updated 2026-08-01
cacheWritesPrice: 0.435, // $0.435 per million tokens (cache miss) - Updated 2026-08-01
cacheReadsPrice: 0.003625, // $0.003625 per million tokens (cache hit) - Updated 2026-08-01
description: `DeepSeek-V4-Pro is DeepSeek's strongest V4 model for reasoning, coding, long-context, and agentic workloads. It supports thinking and non-thinking modes, JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta) in non-thinking mode.`,
// Static estimates use peak rates; off-peak rates are 50% lower. Effective 2026-08-16.
outputPrice: 3.96,
cacheWritesPrice: 1.32,
cacheReadsPrice: 0.044,
description: `DeepSeek-V4-Pro-0813 is DeepSeek's strongest V4 model for reasoning, coding, long-context, and agentic workloads. It supports thinking and non-thinking modes, JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta) in non-thinking mode.`,
},
} as const satisfies Record<string, ModelInfo>

Expand Down
16 changes: 15 additions & 1 deletion packages/types/src/providers/fireworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type FireworksModelId =
| "accounts/fireworks/models/deepseek-v3p1"
| "accounts/fireworks/models/deepseek-v3p2"
| "accounts/fireworks/models/deepseek-v4-pro"
| "accounts/fireworks/models/deepseek-v4-pro-0813"
| "accounts/fireworks/models/glm-4p5"
| "accounts/fireworks/models/glm-4p5-air"
| "accounts/fireworks/models/glm-4p6"
Expand Down Expand Up @@ -262,10 +263,23 @@ export const fireworksModels = {
supportsPromptCache: true,
inputPrice: 1.74,
outputPrice: 3.48,
cacheReadsPrice: 0.14,
cacheReadsPrice: 0.145,
description:
"DeepSeek V4 Pro is the latest iteration of the DeepSeek model family, with improved reasoning, code generation, and instruction following over the V3 series.",
},
"accounts/fireworks/models/deepseek-v4-pro-0813": {
displayName: "DeepSeek V4 Pro 0813",
maxTokens: 384_000,
contextWindow: 1_000_000,
supportsImages: false,
supportsPromptCache: true,
supportsMaxTokens: true,
inputPrice: 1.32,
outputPrice: 3.96,
cacheReadsPrice: 0.044,
description:
"DeepSeek V4 Pro 0813 is DeepSeek's production checkpoint for advanced reasoning, coding, and long-context agentic workloads.",
},
"accounts/fireworks/models/kimi-k2p7-code": {
maxTokens: 16384,
contextWindow: 262144,
Expand Down
9 changes: 5 additions & 4 deletions packages/types/src/providers/opencode-go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export const opencodeGoModels: Record<string, ModelInfo> = {

// --- DeepSeek ---
"deepseek-v4-pro": {
displayName: "DeepSeek V4 Pro 0813",
maxTokens: 384_000,
contextWindow: 1_000_000,
supportsImages: false,
Expand All @@ -308,11 +309,11 @@ export const opencodeGoModels: Record<string, ModelInfo> = {
supportsReasoningEffort: ["disable", "low", "medium", "high", "xhigh"],
preserveReasoning: true,
reasoningEffort: "high",
inputPrice: 1.74,
outputPrice: 3.48,
cacheReadsPrice: 0.0145,
inputPrice: 0.435,
outputPrice: 0.87,
cacheReadsPrice: 0.003625,
description:
"DeepSeek-V4-Pro is DeepSeek's strongest V4 model for reasoning, coding, long-context, and agentic workloads. Available via the Opencode Go plan.",
"DeepSeek-V4-Pro-0813 is DeepSeek's strongest V4 model for reasoning, coding, long-context, and agentic workloads. Available via the Opencode Go plan.",
},
"deepseek-v4-flash": {
maxTokens: 384_000,
Expand Down
6 changes: 3 additions & 3 deletions src/api/providers/__tests__/deepseek.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe("DeepSeekHandler", () => {
expect(model.info).toBeDefined()
expect(model.info.maxTokens).toBe(384_000)
expect(model.info.contextWindow).toBe(1_000_000)
expect(model.info.supportsImages).toBe(true)
expect(model.info.supportsImages).toBe(false)
expect(model.info.supportsPromptCache).toBe(true) // Should be true now
expect((model.info as ModelInfo).preserveReasoning).toBe(true)
})
Expand All @@ -229,7 +229,7 @@ describe("DeepSeekHandler", () => {
expect(model.id).toBe("deepseek-v4-flash")
expect(model.info.maxTokens).toBe(384_000)
expect(model.info.contextWindow).toBe(1_000_000)
expect(model.info.supportsImages).toBe(true)
expect(model.info.supportsImages).toBe(false)
expect((model.info as ModelInfo).supportsReasoningEffort).toContain("max")
})

Expand All @@ -243,7 +243,7 @@ describe("DeepSeekHandler", () => {
expect(model.info).toBeDefined()
expect(model.info.maxTokens).toBe(384_000)
expect(model.info.contextWindow).toBe(1_000_000)
expect(model.info.supportsImages).toBe(true)
expect(model.info.supportsImages).toBe(false)
expect(model.info.supportsPromptCache).toBe(true)
expect((model.info as ModelInfo).preserveReasoning).toBe(true)
expect((model.info as ModelInfo).reasoningEffort).toBe("high")
Expand Down
9 changes: 8 additions & 1 deletion src/api/providers/__tests__/fireworks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ describe("FireworksHandler", () => {
contextWindow: 1048576,
inputPrice: 1.74,
outputPrice: 3.48,
cacheReadsPrice: 0.14,
cacheReadsPrice: 0.145,
},
{
modelId: "accounts/fireworks/models/deepseek-v4-pro-0813" as const,
contextWindow: 1_000_000,
inputPrice: 1.32,
outputPrice: 3.96,
cacheReadsPrice: 0.044,
},
])(
"should expose newly added model $modelId",
Expand Down
Loading