Skip to content
Open
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
4 changes: 2 additions & 2 deletions packages/types/src/providers/deepseek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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
Expand All @@ -29,7 +29,7 @@ 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
Expand Down
13 changes: 12 additions & 1 deletion src/api/providers/__tests__/deepseek.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -633,6 +634,11 @@ describe("DeepSeekHandler", () => {
rawReasoningEffort: "low",
mappedReasoningEffort: "low",
},
{
modelId: "deepseek-v4-flash",
rawReasoningEffort: "medium",
mappedReasoningEffort: "high",
},
{
modelId: "deepseek-v4-flash",
rawReasoningEffort: "high",
Expand All @@ -656,6 +662,11 @@ describe("DeepSeekHandler", () => {
{
modelId: "deepseek-v4-pro",
rawReasoningEffort: "low",
mappedReasoningEffort: "low",
},
{
modelId: "deepseek-v4-pro",
rawReasoningEffort: "medium",
mappedReasoningEffort: "high",
},
{
Expand All @@ -666,7 +677,7 @@ describe("DeepSeekHandler", () => {
{
modelId: "deepseek-v4-pro",
rawReasoningEffort: "xhigh",
mappedReasoningEffort: "max",
mappedReasoningEffort: "high",
},
{
modelId: "deepseek-v4-pro",
Expand Down
22 changes: 3 additions & 19 deletions src/api/providers/deepseek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,22 @@ export const normalizeDeepSeekReasoningEffort = (
modelId: DeepSeekModelId,
reasoningEffort?: string,
): "low" | "high" | "max" | undefined => {
// 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":
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
}

return undefined
Expand Down
Loading