feat: add DeepSeek V4 Pro and Flash models#12175
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
feat: add DeepSeek V4 Pro and Flash models#12175roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
2 tasks
- Add deepseek-v4-pro and deepseek-v4-flash to DeepSeek model definitions - Both models support thinking mode (preserveReasoning), vision, and prompt caching - Update thinking mode detection to use modelInfo.preserveReasoning flag instead of hardcoded model name check, making it future-proof - Add tests for new v4 model info and thinking mode behavior Addresses #12174
f7496cc to
e94d7b3
Compare
2 tasks
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: #12174
Description
This PR attempts to address Issue #12174 by adding the
deepseek-v4-proanddeepseek-v4-flashmodel definitions as specified by @designgears. Feedback and guidance are welcome.Key changes:
deepseek-v4-proanddeepseek-v4-flashtopackages/types/src/providers/deepseek.tswith thinking mode (preserveReasoning), vision support, and prompt caching enabled.src/api/providers/deepseek.tsto use thepreserveReasoningflag fromModelInfoinstead of hardcoding the model name check (modelId.includes("deepseek-reasoner")). This makes it future-proof for any new thinking-capable models.Test Procedure
cd src && npx vitest run api/providers/__tests__/deepseek.spec.ts-- all 28 tests pass (1 skipped is pre-existing).turbo lintandturbo check-types).Pre-Submission Checklist
Additional Notes
deepSeekModelsobject usesas const satisfies Record<string, ModelInfo>, so the handler code castsmodelInfotoModelInfoto access the optionalpreserveReasoningproperty safely.