feat: add DeepSeek V4 Pro model support#12179
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
Conversation
- Add deepseek-v4-pro to the model registry with appropriate config (164K context, 16K max output, vision support, preserveReasoning) - Update isThinkingModel check to recognize deepseek-v4 models so thinking mode and reasoning_content passback work correctly - Add tests for the new model Fixes #12177
That context window is incorrect. DeepSeek recommends a minimum context window of 384K and supports up to a 1M context window, per https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro 16K output tokens also may be too strict. DeepSeek API supports 384K max output tokens, per https://api-docs.deepseek.com/quick_start/pricing |
tionerJack
approved these changes
Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #12177
Description
This PR attempts to address Issue #12177 where
deepseek-v4-profails with error "The reasoning_content in the thinking mode must be passed back to the API".The root cause is that
deepseek-v4-prowas not recognized as a thinking/reasoning model. Three changes were made:Added
deepseek-v4-proto the model registry (packages/types/src/providers/deepseek.ts) with:preserveReasoning: trueso reasoning_content is passed back to the API during multi-turn tool call conversationsUpdated the
isThinkingModelcheck (src/api/providers/deepseek.ts) to matchdeepseek-v4prefix in addition todeepseek-reasoner. This ensures:thinking: { type: "enabled" }parameter is sentmergeToolResultTextis enabled to prevent reasoning_content from being droppedAdded tests for the new model in
src/api/providers/__tests__/deepseek.spec.tsFeedback and guidance are welcome, especially regarding the exact pricing and context window values.
Test Procedure
deepseek-v4-pro:cd src && npx vitest run api/providers/__tests__/deepseek.spec.tsPre-Submission Checklist
Documentation Updates
Additional Notes
The pricing values used ($2.19/M input, $8.87/M output, $0.55/M cache read) were estimated based on the pricing screenshot shared in the issue. These may need adjustment once official API documentation is confirmed.
Interactively review PR in Roo Code Cloud