From 1bd508486498285786ab1a495a33c7058e3873df Mon Sep 17 00:00:00 2001 From: WHMHammer Date: Wed, 12 Aug 2026 14:58:53 -0500 Subject: [PATCH 1/3] fix: update deepseek-v4-pro reasoning efforts and mappings --- packages/types/src/providers/deepseek.ts | 20 +++++------ src/api/providers/deepseek.ts | 44 +++++++----------------- 2 files changed, 23 insertions(+), 41 deletions(-) diff --git a/packages/types/src/providers/deepseek.ts b/packages/types/src/providers/deepseek.ts index 9387d6a4ae..52e73ca8d6 100644 --- a/packages/types/src/providers/deepseek.ts +++ b/packages/types/src/providers/deepseek.ts @@ -14,14 +14,14 @@ export const deepSeekModels = { contextWindow: 1_000_000, supportsImages: true, supportsPromptCache: true, - supportsReasoningEffort: ["disable", "low", "high", "max"], // Updated 2026-08-01 + supportsReasoningEffort: ["disable", "low", "high", "max"], // Updated 2026-08-13 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 + // the peak/off-peak pricing policy has not been implemented yet - Updated 2026-08-13 + outputPrice: 0.28, // $0.28 per million tokens - Updated 2026-08-13 + cacheWritesPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated 2026-08-13 + cacheReadsPrice: 0.0028, // $0.0028 per million tokens (cache hit) - Updated 2026-08-13 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": { @@ -29,14 +29,14 @@ export const deepSeekModels = { contextWindow: 1_000_000, supportsImages: true, supportsPromptCache: true, - supportsReasoningEffort: ["disable", "high", "max"], // Updated 2026-08-01 + supportsReasoningEffort: ["disable", "low", "high", "max"], // Updated 2026-08-13 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 + // the peak/off-peak pricing policy has not been implemented yet - Updated 2026-08-13 + outputPrice: 0.87, // $0.87 per million tokens - Updated 2026-08-13 + cacheWritesPrice: 0.435, // $0.435 per million tokens (cache miss) - Updated 2026-08-13 + cacheReadsPrice: 0.003625, // $0.003625 per million tokens (cache hit) - Updated 2026-08-13 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.`, }, } as const satisfies Record diff --git a/src/api/providers/deepseek.ts b/src/api/providers/deepseek.ts index 2e85c016b0..0d1cc86cd4 100644 --- a/src/api/providers/deepseek.ts +++ b/src/api/providers/deepseek.ts @@ -43,41 +43,23 @@ const isDeepSeekThinkingEnabled = (modelId: string, options: ApiHandlerOptions) // https://api-docs.deepseek.com/guides/thinking_mode/ export const normalizeDeepSeekReasoningEffort = ( - modelId: DeepSeekModelId, + // the mapping became model-agnostic now, + // but let's keep the modelId parameter for future flexibility + // updated 2026-08-13 + _modelId: DeepSeekModelId, reasoningEffort?: string, ): "low" | "high" | "max" | undefined => { - switch (modelId) { - case "deepseek-v4-flash": - switch (reasoningEffort) { - case "low": - return "low" + switch (reasoningEffort) { + case "low": + return "low" - case "high": - return "high" + case "medium": + case "high": + case "xhigh": + return "high" - case "xhigh": - return "high" - - case "max": - return "max" - } - break - - case "deepseek-v4-pro": - switch (reasoningEffort) { - case "low": - return "high" - - case "high": - return "high" - - case "xhigh": - return "max" - - case "max": - return "max" - } - break + case "max": + return "max" } return undefined From 27574026458e490afc1a11df1b1bae47e19851e5 Mon Sep 17 00:00:00 2001 From: WHMHammer Date: Wed, 12 Aug 2026 15:38:07 -0500 Subject: [PATCH 2/3] fix: deepseek-v4-pro unit testing --- src/api/providers/__tests__/deepseek.spec.ts | 13 +++++++- src/api/providers/deepseek.ts | 32 +++++++++++--------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/api/providers/__tests__/deepseek.spec.ts b/src/api/providers/__tests__/deepseek.spec.ts index 4f3cccdc08..94bed4fc6f 100644 --- a/src/api/providers/__tests__/deepseek.spec.ts +++ b/src/api/providers/__tests__/deepseek.spec.ts @@ -617,6 +617,7 @@ describe("DeepSeekHandler", () => { describe("normalizeDeepSeekReasoningEffort", () => { // https://api-docs.deepseek.com/guides/thinking_mode/ + // updated on 2026-08-13 it("should map acceptable reasoning efforts the same way as stated by the official documentation", async () => { const mappings: { modelId: DeepSeekModelId @@ -633,6 +634,11 @@ describe("DeepSeekHandler", () => { rawReasoningEffort: "low", mappedReasoningEffort: "low", }, + { + modelId: "deepseek-v4-flash", + rawReasoningEffort: "medium", + mappedReasoningEffort: "high", + }, { modelId: "deepseek-v4-flash", rawReasoningEffort: "high", @@ -656,6 +662,11 @@ describe("DeepSeekHandler", () => { { modelId: "deepseek-v4-pro", rawReasoningEffort: "low", + mappedReasoningEffort: "low", + }, + { + modelId: "deepseek-v4-pro", + rawReasoningEffort: "medium", mappedReasoningEffort: "high", }, { @@ -666,7 +677,7 @@ describe("DeepSeekHandler", () => { { modelId: "deepseek-v4-pro", rawReasoningEffort: "xhigh", - mappedReasoningEffort: "max", + mappedReasoningEffort: "high", }, { modelId: "deepseek-v4-pro", diff --git a/src/api/providers/deepseek.ts b/src/api/providers/deepseek.ts index 0d1cc86cd4..12d4afaae2 100644 --- a/src/api/providers/deepseek.ts +++ b/src/api/providers/deepseek.ts @@ -43,23 +43,25 @@ const isDeepSeekThinkingEnabled = (modelId: string, options: ApiHandlerOptions) // https://api-docs.deepseek.com/guides/thinking_mode/ export const normalizeDeepSeekReasoningEffort = ( - // the mapping became model-agnostic now, - // but let's keep the modelId parameter for future flexibility - // updated 2026-08-13 - _modelId: DeepSeekModelId, + modelId: DeepSeekModelId, reasoningEffort?: string, ): "low" | "high" | "max" | undefined => { - switch (reasoningEffort) { - case "low": - return "low" - - case "medium": - case "high": - case "xhigh": - return "high" - - case "max": - return "max" + // still check the modelId so non-supported models won't produce reasoning efforts + switch (modelId) { + case "deepseek-v4-flash": + case "deepseek-v4-pro": + switch (reasoningEffort) { + case "low": + return "low" + + case "medium": + case "high": + case "xhigh": + return "high" + + case "max": + return "max" + } } return undefined From 703577d133e1840c5f9988550804eed88e8bc4df Mon Sep 17 00:00:00 2001 From: WHMHammer Date: Thu, 13 Aug 2026 10:51:54 -0500 Subject: [PATCH 3/3] fix: remove deepseek price comment changes Prices are going to change on 2026-08-16. We need a separate PR for that. --- packages/types/src/providers/deepseek.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/types/src/providers/deepseek.ts b/packages/types/src/providers/deepseek.ts index 52e73ca8d6..d2bcd84607 100644 --- a/packages/types/src/providers/deepseek.ts +++ b/packages/types/src/providers/deepseek.ts @@ -18,10 +18,10 @@ export const deepSeekModels = { 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-13 - outputPrice: 0.28, // $0.28 per million tokens - Updated 2026-08-13 - cacheWritesPrice: 0.14, // $0.14 per million tokens (cache miss) - Updated 2026-08-13 - cacheReadsPrice: 0.0028, // $0.0028 per million tokens (cache hit) - Updated 2026-08-13 + // 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 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": { @@ -33,10 +33,10 @@ export const deepSeekModels = { 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-13 - outputPrice: 0.87, // $0.87 per million tokens - Updated 2026-08-13 - cacheWritesPrice: 0.435, // $0.435 per million tokens (cache miss) - Updated 2026-08-13 - cacheReadsPrice: 0.003625, // $0.003625 per million tokens (cache hit) - Updated 2026-08-13 + // 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.`, }, } as const satisfies Record