fix(deepseek): preserve v4 native model ids during provider normalization#14946
Closed
zkl2333 wants to merge 1 commit into
Closed
fix(deepseek): preserve v4 native model ids during provider normalization#14946zkl2333 wants to merge 1 commit into
zkl2333 wants to merge 1 commit into
Conversation
…tion NousResearch#14934 added deepseek-v4-pro and deepseek-v4-flash to the DeepSeek native provider's model list, but _normalize_for_deepseek still folded any non-reasoner input to deepseek-chat — so picking deepseek-v4-pro got silently rewritten to deepseek-chat before the request was sent. Add the V4 ids to the canonical pass-through set and document the fact that the legacy aliases (deepseek-chat / deepseek-reasoner) will be deprecated and map server-side to the non-thinking / thinking modes of deepseek-v4-flash respectively. Scope: native DeepSeek provider only. The OpenRouter / Nous Portal path is already handled by NousResearch#14934.
19 tasks
Collaborator
This was referenced Apr 24, 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.
Summary
Follow-up to #14934, which added
deepseek-v4-proanddeepseek-v4-flashto the DeepSeek native provider's model list — but the normalization layer was missed, so picking either V4 id from the native DeepSeek provider got silently rewritten todeepseek-chatbefore the request was sent.The bug, at a glance
Before this PR,
_normalize_for_deepseekcollapsed any non-reasoner-keyword input todeepseek-chat:deepseek-v4-prodeepseek-chatdeepseek-v4-prodeepseek-v4-flashdeepseek-chatdeepseek-v4-flashdeepseek/deepseek-v4-prodeepseek-chatdeepseek-v4-prodeepseek-chat(legacy)deepseek-chatdeepseek-chatdeepseek-reasoner(legacy)deepseek-reasonerdeepseek-reasonerdeepseek-r1(keyword)deepseek-reasonerdeepseek-reasonerChanges
_DEEPSEEK_CANONICAL_MODELSso they pass through_normalize_for_deepseekunchanged.deepseek-chat/deepseek-reasonerwill be deprecated and map server-side to the non-thinking / thinking modes ofdeepseek-v4-flashrespectively.Scope: native DeepSeek provider only. The OpenRouter / Nous Portal path was already handled by #14934.
This PR supersedes #14891 (closed); that PR was opened before #14934 landed and overlapped with the model-list additions.
Test plan
pytest tests/hermes_cli/test_model_normalize.py— 62 passed locallyapi.deepseek.com:normalize_model_for_provider("deepseek-v4-pro", "deepseek")returns"deepseek-v4-pro"; sending that normalized id asmodel=tochat.completions.createreturns HTTP 200 with the server echoingmodel: deepseek-v4-pro(confirming v4-pro actually reaches the server instead of being silently folded todeepseek-chat)