fix(deepseek): only fold deepseek-* spellings onto deepseek-flash

Names outside the family (qwen3.8-max typed on the DeepSeek provider) now
pass through so the validator rejects them, instead of silently running
Flash under a different label.
This commit is contained in:
Teknium
2026-09-10 03:37:28 -07:00
parent 70ed17e3d8
commit 696d078959
+4 -3
View File
@@ -105,12 +105,13 @@ _DEEPSEEK_V_SERIES_RE = re.compile(r"^deepseek-v\d+([-.].+)?$")
def _normalize_for_deepseek(model_name: str) -> str:
"""Map a model input to a DeepSeek-accepted id: canonicals and ``deepseek-v<digit>…`` pass
through (dated variants and future V-series work without a release); retired aliases and
everything else become ``deepseek-flash``."""
through (dated variants and future V-series work without a release); retired aliases and other
``deepseek-*`` spellings become ``deepseek-flash``. Names outside the family pass through
untouched so the validator can reject them instead of silently running Flash."""
bare = _strip_vendor_prefix(model_name).lower()
if bare in _DEEPSEEK_CANONICAL_MODELS or _DEEPSEEK_V_SERIES_RE.match(bare):
return bare
return "deepseek-flash"
return "deepseek-flash" if bare.startswith("deepseek") else bare
def _strip_vendor_prefix(model_name: str) -> str: