Skip to content

feat: add DeepSeek V4 Pro and Flash models#12175

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/deepseek-v4-models
Draft

feat: add DeepSeek V4 Pro and Flash models#12175
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/deepseek-v4-models

Conversation

@roomote-v0
Copy link
Copy Markdown
Contributor

@roomote-v0 roomote-v0 Bot commented Apr 24, 2026

Related GitHub Issue

Closes: #12174

Description

This PR attempts to address Issue #12174 by adding the deepseek-v4-pro and deepseek-v4-flash model definitions as specified by @designgears. Feedback and guidance are welcome.

Key changes:

  1. Added deepseek-v4-pro and deepseek-v4-flash to packages/types/src/providers/deepseek.ts with thinking mode (preserveReasoning), vision support, and prompt caching enabled.
  2. Updated thinking mode detection in src/api/providers/deepseek.ts to use the preserveReasoning flag from ModelInfo instead of hardcoding the model name check (modelId.includes("deepseek-reasoner")). This makes it future-proof for any new thinking-capable models.
  3. Added tests for the new v4 models covering model info, thinking mode enablement, and reasoning content streaming.

Test Procedure

  • Ran cd src && npx vitest run api/providers/__tests__/deepseek.spec.ts -- all 28 tests pass (1 skipped is pre-existing).
  • All lint and type checks pass via the pre-push hook (turbo lint and turbo check-types).

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue.
  • Scope: Changes are focused on the linked issue.
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New tests have been added for the v4 models.
  • Documentation Impact: No documentation updates are required.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Additional Notes

  • Pricing values for v4 models are estimated. They should be verified against the official DeepSeek API pricing page once confirmed.
  • The deepSeekModels object uses as const satisfies Record<string, ModelInfo>, so the handler code casts modelInfo to ModelInfo to access the optional preserveReasoning property safely.

- 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
@roomote-v0 roomote-v0 Bot force-pushed the feature/deepseek-v4-models branch from f7496cc to e94d7b3 Compare April 24, 2026 09:32
@roomote-v0 roomote-v0 Bot changed the title feat: add DeepSeek V4 Flash and V4 Pro model support feat: add DeepSeek V4 Pro and Flash models Apr 24, 2026
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.

[ENHANCEMENT] support deepseek v4 and new thinking mode

1 participant