Skip to content

fix(deepseek): preserve v4 native model ids during provider normalization#14946

Closed
zkl2333 wants to merge 1 commit into
NousResearch:mainfrom
zkl2333:fix/deepseek-v4-normalization
Closed

fix(deepseek): preserve v4 native model ids during provider normalization#14946
zkl2333 wants to merge 1 commit into
NousResearch:mainfrom
zkl2333:fix/deepseek-v4-normalization

Conversation

@zkl2333

@zkl2333 zkl2333 commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #14934, which added deepseek-v4-pro and deepseek-v4-flash to 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 to deepseek-chat before the request was sent.

The bug, at a glance

Before this PR, _normalize_for_deepseek collapsed any non-reasoner-keyword input to deepseek-chat:

User picks Pre-PR normalize output Post-PR normalize output
deepseek-v4-pro deepseek-chat deepseek-v4-pro
deepseek-v4-flash deepseek-chat deepseek-v4-flash
deepseek/deepseek-v4-pro deepseek-chat deepseek-v4-pro
deepseek-chat (legacy) deepseek-chat deepseek-chat
deepseek-reasoner (legacy) deepseek-reasoner deepseek-reasoner
deepseek-r1 (keyword) deepseek-reasoner deepseek-reasoner

Changes

  • Add the V4 ids to _DEEPSEEK_CANONICAL_MODELS so they pass through _normalize_for_deepseek unchanged.
  • Document 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.
  • Add parametrized tests covering V4 ids, legacy aliases, vendor-prefixed forms, and the reasoner-keyword path.

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 locally
  • Live against api.deepseek.com: normalize_model_for_provider("deepseek-v4-pro", "deepseek") returns "deepseek-v4-pro"; sending that normalized id as model= to chat.completions.create returns HTTP 200 with the server echoing model: deepseek-v4-pro (confirming v4-pro actually reaches the server instead of being silently folded to deepseek-chat)

…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.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard provider/deepseek DeepSeek API labels Apr 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

#14947 is a duplicate of this PR — same fix. Related to merged #14934 (added V4 to catalog but missed normalization).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists provider/deepseek DeepSeek API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants