Skip to content

feat(provider/deepseek): support DeepSeek V4 reasoning effort#14743

Merged
R-Taneja merged 4 commits into
vercel:mainfrom
ousugo:deepseek-reasoning-effort
May 6, 2026
Merged

feat(provider/deepseek): support DeepSeek V4 reasoning effort#14743
R-Taneja merged 4 commits into
vercel:mainfrom
ousugo:deepseek-reasoning-effort

Conversation

@ousugo
Copy link
Copy Markdown
Contributor

@ousugo ousugo commented Apr 26, 2026

Background

DeepSeek V4 thinking mode supports an OpenAI-compatible reasoning_effort
parameter for controlling thinking strength. The DeepSeek provider already
supports enabling or disabling thinking mode, but it did not expose the new V4
effort control.

Summary

  • Add reasoningEffort: 'high' | 'max' to DeepSeek provider options.
  • Send reasoning_effort in DeepSeek chat completion requests when configured.
  • Map the top-level reasoning setting to DeepSeek's supported effort values:
    • minimal, low, medium, and high -> high
    • xhigh -> max
  • Add request-body tests for provider options, top-level reasoning mapping,
    precedence, and disabled thinking.
  • Document the new DeepSeek provider option.

Manual Verification

N/A - verified with package tests and type checking.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Future Work

N/A

Related Issues

N/A

@goal31121
Copy link
Copy Markdown

this project is very excellent

@chengfengfengwang
Copy link
Copy Markdown

Thanks for putting this together — really hoping to see this land soon. We're hitting the same gap on our side: V4 thinking mode is enabled via provider options, but without a way to surface reasoning_effort we can't take advantage of max for the harder agent / tool-calling cases.

The mapping you chose (xhigh → max, everything else → high) lines up cleanly with the OpenAI-compatible top-level reasoning field, so existing user code shouldn't need any changes to start benefiting. The downstream impact is also already visible in CherryHQ/cherry-studio#14588.

Would be great to get this in a release ahead of the broader V4 model-id work in #14718. Happy to help test against the official endpoint if useful.

Add DeepSeek provider options for V4 reasoning effort and map the top-level reasoning setting to the OpenAI-compatible reasoning_effort parameter.

Document the OpenAI-compatible API boundary and add tests for provider options, top-level mapping, precedence, and disabled thinking.
@dancer dancer force-pushed the deepseek-reasoning-effort branch from 3952bb5 to 9c05a96 Compare May 6, 2026 17:39
@R-Taneja R-Taneja merged commit eda4373 into vercel:main May 6, 2026
17 of 18 checks passed
@ousugo ousugo deleted the deepseek-reasoning-effort branch May 6, 2026 18:18
@R-Taneja R-Taneja added the backport Admins only: add this label to a pull request in order to backport it to the prior version label May 6, 2026
github-actions Bot added a commit that referenced this pull request May 6, 2026
@github-actions github-actions Bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

⚠️ Backport to release-v6.0 created but has conflicts: #15064

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🚀 Published in:

Package Version
ai 7.0.0-canary.123
@ai-sdk/angular 3.0.0-canary.123
@ai-sdk/deepseek 3.0.0-canary.37
@ai-sdk/langchain 3.0.0-canary.123
@ai-sdk/llamaindex 3.0.0-canary.123
@ai-sdk/otel 1.0.0-canary.69
@ai-sdk/react 4.0.0-canary.123
@ai-sdk/rsc 3.0.0-canary.124
@ai-sdk/svelte 5.0.0-canary.123
@ai-sdk/voyage 2.0.0-canary.7
@ai-sdk/vue 4.0.0-canary.123
@ai-sdk/workflow 1.0.0-canary.38

R-Taneja added a commit that referenced this pull request May 6, 2026
v6 (provider spec V3) has no top-level `reasoning` parameter, so the
top-level mapping logic from #14743 doesn't apply. Keeping only the
`providerOptions.deepseek.reasoningEffort` knob.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants