-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: add proper support for DeepSeek V3 models in OpenRouter #9782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- DeepSeek V3 models (v3, 3.2, 3.2-exp) now correctly use standard message format instead of R1 format - Added explicit model detection to differentiate between DeepSeek R1 and V3 models - Ensured V3 models have proper tool calling support and reasonable token limits - Added comprehensive tests to verify correct behavior for both V3 and R1 models Fixes #9779
No new issues found in the latest commit. The implementation correctly adds DeepSeek V3.2 thinking mode support with proper Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
@roomote Could you also add direct support to Deepseek as well more information here: https://api-docs.deepseek.com/quick_start/pricing to support 3.2 |
Added direct DeepSeek API support for V3/3.2 models. All local checks passed. |
|
@roomote Investigate/debug issues with the platform-unit-test for both ubuntu and windows and correct the issue. |
- Add model aliases (deepseek-v3, deepseek-3.2) that map to deepseek-chat - Update DeepSeek handler to map alias model names to official API model names - Add tests to verify model alias mapping works correctly - Supports DeepSeek 3.2 models as requested in issue #9779
Fixed the flaky ChatView focus grabbing test by adding delays to wait for debounced effects (50ms useDebounceEffect) to complete before asserting. All local tests pass. |
| "deepseek-3.2": { | ||
| ...deepSeekV3Info, | ||
| description: `DeepSeek V3.2 (alias for deepseek-chat). ${deepSeekV3Info.description}`, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deepseek-3.2-exp alias is missing from the deepSeekModels object. While it's included in deepSeekModelAliases (line 53), there's no corresponding model entry like there is for deepseek-v3 and deepseek-3.2. This creates an inconsistency where deepseek-3.2-exp users will get model info via fallback to the default rather than an explicit entry with a descriptive message.
| "deepseek-3.2": { | |
| ...deepSeekV3Info, | |
| description: `DeepSeek V3.2 (alias for deepseek-chat). ${deepSeekV3Info.description}`, | |
| }, | |
| "deepseek-3.2": { | |
| ...deepSeekV3Info, | |
| description: `DeepSeek V3.2 (alias for deepseek-chat). ${deepSeekV3Info.description}`, | |
| }, | |
| "deepseek-3.2-exp": { | |
| ...deepSeekV3Info, | |
| description: `DeepSeek V3.2 Experimental (alias for deepseek-chat). ${deepSeekV3Info.description}`, | |
| }, |
Fix it with Roo Code or mention @roomote and request a fix.
Add delays to wait for debounced focus effects to complete before asserting. The useDebounceEffect has a 50ms delay, and the test was flaky because state changes could trigger the debounced effect after mockFocus.mockClear() was called.
|
@roomote Just want to doublecheck, we have Deepseek supported for Openrouter, and now Deepseek directly via their API. Could you tell me the models supported of Deepseek under each provider please. |
Added the missing DeepSeek models by provider:
|
|
@roomote What are those aliases? Because on Deepseek's website they have the two models: |
You're correct that DeepSeek's official API only uses |
|
OpenRouter only has deepseek/deepseek-v3.2, see https://openrouter.ai/deepseek/deepseek-v3.2 Direct DeepSeek API has deepseek-chat and deepseek-reasoner both running the deepseek v3.2 Please correct the provider and models. |
Fixed the reported issues. All local checks passed. |
|
@roomote Sanity check, Could you tell me the models supported of Deepseek under each provider please for Openrouter and Deepseek Direct API. |
Here's a summary of the DeepSeek models supported under each provider (with this PR): DeepSeek Direct API
OpenRouter
Key differences:
|
|
Fixed the reported issues. Removed non-existent DeepSeek model aliases ( |
|
@roomote Mark this ready for code review |
- Remove deepseek-v3 and deepseek-3.2-exp from DeepSeek Direct API (only deepseek-chat and deepseek-reasoner are supported) - Keep deepseek-3.2 as version alias for deepseek-chat - Remove deepseek/deepseek-v3 test from OpenRouter (only deepseek/deepseek-v3.2 exists) - Update documentation references to API docs
PR #9782 has been marked as ready for code review. |
Review complete. No issues found. The PR correctly implements DeepSeek V3 model support for OpenRouter and adds proper model aliases for the direct DeepSeek API. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
@roomote please fix the Openrouter model support, as there are other models we should have the following: deepseek/deepseek-v3.2 |
Added support for additional DeepSeek models in OpenRouter. All local checks passed. |
- Add deepseek-chat prefix detection for V3 chat models (deepseek-chat-v3.1, deepseek-chat-v3-0324, etc.) - Add deepseek-prover prefix detection for prover/reasoning models (deepseek-prover-v2) - Prover models now correctly use R1 format like other reasoning models - Chat models use standard format with native tool support - Added comprehensive tests for new model patterns
|
@roomote We need to implement the new tool calling method for Deepseek 3.2 as mentioned here: https://api-docs.deepseek.com/guides/thinking_mode |
Implemented DeepSeek V3.2 thinking mode support for tool calling as documented at https://api-docs.deepseek.com/guides/thinking_mode. All local checks passed. |
- Add supportsReasoningBinary flag to DeepSeek V3 model info - Override createMessage in DeepSeekHandler to add thinking parameter when enableReasoningEffort is true - Preserve reasoning_content in message conversion for subsequent API calls - Add comprehensive tests for thinking mode tool calling See: https://api-docs.deepseek.com/guides/thinking_mode
Summary
This PR attempts to address Issue #9779 regarding DeepSeek 3.2 models failing with tool calling errors when used through OpenRouter. Feedback and guidance are welcome!
Problem
DeepSeek V3 models (deepseek-v3, deepseek-3.2, deepseek-3.2-exp) were being incorrectly treated as R1 models, causing them to fail with tool calling errors. The OpenRouter handler was only checking for
deepseek/deepseek-r1models but not properly distinguishing between R1 and V3 model variants.Solution
Changes
src/api/providers/openrouter.tsto add detection for DeepSeek V3 modelssrc/api/providers/fetchers/openrouter.tsto configure V3 models properlysrc/api/providers/__tests__/openrouter.spec.tsto verify the fixTesting
Fixes #9779
Important
Fixes handling of DeepSeek V3 models in OpenRouter by updating model detection, configuration, and adding tests.
OpenRouterHandlerto differentiate between DeepSeek R1 and V3 models, ensuring V3 models use standard message format.openrouter.tsanddeepseek.ts.deepseek.spec.tsandopenrouter.spec.tsto verify correct handling of DeepSeek V3 models.convertToOpenAiMessagesinopenai-format.tsto handlereasoning_contentfor DeepSeek V3.2 thinking mode.parseOpenRouterModelinfetchers/openrouter.tsto configure DeepSeek V3 models properly.This description was created by
for 9eba297. You can customize this summary. It will automatically update as commits are pushed.