mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 14:09:36 +08:00
Merge PR #2584: fix: recognize DeepSeek-V4.1-Flash vision support
This commit is contained in:
@@ -293,6 +293,22 @@ MODEL_OVERRIDES: dict[str, dict[str, object]] = {
|
||||
"has_thinking_tags": True,
|
||||
"supports_vision": False,
|
||||
},
|
||||
# DeepSeek-V4.1-Flash is natively multimodal: the vision add-on of the
|
||||
# experimental V4 Flash became part of the main model. ``deepseek-flash``
|
||||
# is its name on DeepSeek's own API; gateways publish dated ids such as
|
||||
# ``deepseek-v4.1-flash-1017``. Keep these overrides narrow so every other
|
||||
# DeepSeek text model stays fail-closed, and keep them vision-only so the
|
||||
# broader ``deepseek`` entry still supplies response-format and
|
||||
# thinking-tag handling. Gateways that namespace model ids (OpenRouter,
|
||||
# resellers on Model Studio) need their own entries, as the Qwen-VL rules
|
||||
# below already do.
|
||||
# https://api-docs.deepseek.com/news/news260910/
|
||||
"deepseek-v4.1-flash": {"supports_vision": True},
|
||||
"deepseek-flash": {"supports_vision": True},
|
||||
"deepseek-v4-flash-vision-exp": {"supports_vision": True},
|
||||
"deepseek/deepseek-v4.1-flash": {"supports_vision": True},
|
||||
"deepseek/deepseek-flash": {"supports_vision": True},
|
||||
"vanchin/deepseek-v4.1-flash": {"supports_vision": True},
|
||||
# Qwen text models often share the same provider/gateway as Qwen-VL.
|
||||
# Keep thinking-tag handling broad, but only mark explicit VL/vision model
|
||||
# names as image-capable so RAG image indexing can fail closed.
|
||||
|
||||
@@ -172,3 +172,32 @@ def test_models_prefix_does_not_change_other_vendor_verdicts() -> None:
|
||||
assert supports_vision("custom", "openai/gpt-3.5-turbo") is False
|
||||
# The bare id keeps resolving exactly as before.
|
||||
assert supports_vision("custom", "gemini-2.5-flash") is True
|
||||
|
||||
|
||||
def test_deepseek_v41_flash_is_vision_capable() -> None:
|
||||
"""DeepSeek-V4.1-Flash is natively multimodal under each of its published ids."""
|
||||
for model in (
|
||||
"deepseek-flash",
|
||||
"deepseek-v4.1-flash",
|
||||
"deepseek-v4.1-flash-1017",
|
||||
"DeepSeek-V4.1-Flash-1017",
|
||||
"deepseek-v4-flash-vision-exp",
|
||||
# Gateways namespace the id; resolution must survive the prefix.
|
||||
"deepseek/deepseek-flash",
|
||||
"deepseek/deepseek-v4.1-flash-1017",
|
||||
"vanchin/deepseek-v4.1-flash-1017",
|
||||
):
|
||||
assert supports_vision("dashscope", model) is True, model
|
||||
assert supports_vision("deepseek", model) is True, model
|
||||
|
||||
|
||||
def test_deepseek_text_models_stay_fail_closed() -> None:
|
||||
"""The vision overrides must not leak to other DeepSeek models."""
|
||||
for model in ("deepseek-chat", "deepseek-reasoner", "deepseek-v3.2"):
|
||||
assert supports_vision("deepseek", model) is False, model
|
||||
|
||||
|
||||
def test_deepseek_vision_override_keeps_sibling_capabilities() -> None:
|
||||
"""Vision-only overrides still fall through to the broader ``deepseek`` entry."""
|
||||
assert has_thinking_tags("deepseek", "deepseek-v4.1-flash-1017") is True
|
||||
assert supports_response_format("deepseek", "deepseek-v4.1-flash-1017") is False
|
||||
|
||||
@@ -191,6 +191,8 @@ def test_should_degrade_only_for_non_vision_model_with_images() -> None:
|
||||
assert should_degrade_to_text("openai_codex", "gpt-5.6-sol", msgs) is False
|
||||
# Qwen3.8-Max is multimodal even though its model ID has no ``-vl`` suffix.
|
||||
assert should_degrade_to_text("dashscope", "qwen3.8-max", msgs) is False
|
||||
# DeepSeek-V4.1-Flash is natively multimodal under its dated gateway id.
|
||||
assert should_degrade_to_text("dashscope", "deepseek-v4.1-flash-1017", msgs) is False
|
||||
# An allowlisted provider (VolcEngine) is trusted even for a model we have
|
||||
# no per-model entry for.
|
||||
assert should_degrade_to_text("volcengine", "doubao-1.5-vision-pro", msgs) is False
|
||||
|
||||
Reference in New Issue
Block a user