Skip to content

fix(model-normalize): pass DeepSeek V-series IDs through instead of folding to deepseek-chat#15123

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-5d044ade
Apr 24, 2026
Merged

fix(model-normalize): pass DeepSeek V-series IDs through instead of folding to deepseek-chat#15123
teknium1 merged 1 commit into
mainfrom
hermes/hermes-5d044ade

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #15119 (@0xbyt4) onto current main. DeepSeek V4 Preview shipped 2026-04-24 with first-class IDs deepseek-v4-pro / deepseek-v4-flash; legacy deepseek-chat / deepseek-reasoner get discontinued 2026-07-24. Without this, users picking V4 through /model are silently downgraded to V3 (on aggregators, deepseek-chat routes to Novita's V3 backend).

Changes

  • hermes_cli/model_normalize.py: add deepseek-v4-pro / deepseek-v4-flash to _DEEPSEEK_CANONICAL_MODELS; add _DEEPSEEK_V_SERIES_RE (^deepseek-v\d+(...)?$) so future V-series and dated variants pass through automatically.
  • tests/hermes_cli/test_model_normalize.py: 70 new test lines — V-series pass-through (bare / vendor-prefixed / case / dated / future), canonical + reasoner-keyword regressions, chat fallback.

Validation

  • 77/77 pass in tests/hermes_cli/test_model_normalize.py (scripts/run_tests.sh).
  • DeepSeek V4 release + ID list verified against api-docs.deepseek.com/news/news260424 and openrouter.ai/deepseek/deepseek-v4-flash.

Closes #15119.

…olding to deepseek-chat

`_normalize_for_deepseek` was mapping every non-reasoner input into
`deepseek-chat` on the assumption that DeepSeek's API accepts only two
model IDs. That assumption no longer holds — `deepseek-v4-pro` and
`deepseek-v4-flash` are first-class IDs accepted by the direct API,
and on aggregators `deepseek-chat` routes explicitly to V3 (DeepInfra
backend returns `deepseek-chat-v3`). So a user picking V4 Pro through
the model picker was being silently downgraded to V3.

Verified 2026-04-24 against Nous portal's OpenAI-compat surface:
  - `deepseek/deepseek-v4-flash` → provider: DeepSeek,
    model: deepseek-v4-flash-20260423
  - `deepseek/deepseek-chat`     → provider: DeepInfra,
    model: deepseek/deepseek-chat-v3

Fix:
- Add `deepseek-v4-pro` and `deepseek-v4-flash` to
  `_DEEPSEEK_CANONICAL_MODELS` so exact matches pass through.
- Add `_DEEPSEEK_V_SERIES_RE` (`^deepseek-v\d+(...)?$`) so future
  V-series IDs (`deepseek-v5-*`, dated variants) keep passing through
  without another code change.
- Update docstring + module header to reflect the new rule.

Tests:
- New `TestDeepseekVSeriesPassThrough` — 8 parametrized cases covering
  bare, vendor-prefixed, case-variant, dated, and future V-series IDs
  plus end-to-end `normalize_model_for_provider(..., "deepseek")`.
- New `TestDeepseekCanonicalAndReasonerMapping` — regression coverage
  for canonical pass-through, reasoner-keyword folding, and
  fall-back-to-chat behaviour.
- 77/77 pass.

Reported on Discord (Ufonik, Don Piedro): `/model > Deepseek >
deepseek-v4-pro` surfaced
`Normalized 'deepseek-v4-pro' to 'deepseek-chat'`. Picker listing
showed the v4 names, so validation also rejected the post-normalize
`deepseek-chat` as "not in provider listing" — the contradiction
users saw. Normalizer now respects the picker's choice.
@teknium1 teknium1 merged commit 4ac731c into main Apr 24, 2026
10 of 11 checks passed
@teknium1 teknium1 deleted the hermes/hermes-5d044ade branch April 24, 2026 12:24
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/cli CLI entry point, hermes_cli/, setup wizard provider/deepseek DeepSeek API labels Apr 24, 2026
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 P1 High — major feature broken, no workaround provider/deepseek DeepSeek API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants