mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/usestrix/strix.git
synced 2026-09-20 08:03:42 +08:00
Revert "fix(models): reasoning support follows the model, not the route"
This reverts commit 110b40e05a.
This commit is contained in:
@@ -837,17 +837,7 @@ def model_supports_reasoning(model_name: str) -> bool:
|
||||
entry = litellm.model_cost.get(name)
|
||||
if entry is None and "/" in name:
|
||||
entry = litellm.model_cost.get(name.rsplit("/", 1)[1])
|
||||
if entry is not None:
|
||||
return bool(entry.get("supports_reasoning"))
|
||||
# Reasoning is a property of the model, not of the route: a model only
|
||||
# mapped under other providers (``zai/glm-5.3`` for ``openai/glm-5.3``)
|
||||
# still reasons through an OpenAI-compatible gateway.
|
||||
bare_name = name.rsplit("/", 1)[-1]
|
||||
return any(
|
||||
bool(candidate.get("supports_reasoning"))
|
||||
for key, candidate in litellm.model_cost.items()
|
||||
if key.endswith(f"/{bare_name}") and isinstance(candidate, dict)
|
||||
)
|
||||
return bool(entry and entry.get("supports_reasoning"))
|
||||
|
||||
|
||||
def is_recommended_or_frontier_model(model_name: str) -> bool:
|
||||
|
||||
@@ -12,7 +12,6 @@ from strix.config.models import (
|
||||
_NonStreamingModel,
|
||||
_TurnGuardModel,
|
||||
is_recommended_or_frontier_model,
|
||||
model_supports_reasoning,
|
||||
request_timeout_extra_args,
|
||||
routes_through_litellm,
|
||||
supports_strict_tool_schemas,
|
||||
@@ -24,19 +23,6 @@ def test_recommended_models_are_accepted(model_name: str) -> None:
|
||||
assert is_recommended_or_frontier_model(model_name)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model_name",
|
||||
["openai/glm-5.3", "glm-5.3", "hosted_vllm/glm-5.3", "openai/kimi-k3", "openai/qwen3.8-max"],
|
||||
)
|
||||
def test_reasoning_support_follows_the_model_not_the_route(model_name: str) -> None:
|
||||
assert model_supports_reasoning(model_name)
|
||||
|
||||
|
||||
def test_reasoning_support_rejects_unknown_models() -> None:
|
||||
assert not model_supports_reasoning("openai/no-such-model-xyz")
|
||||
assert not model_supports_reasoning("openai/gpt-4.1")
|
||||
|
||||
|
||||
def test_request_timeout_extra_args_positive() -> None:
|
||||
assert request_timeout_extra_args(300) == {"timeout": 300}
|
||||
assert request_timeout_extra_args(10) == {"timeout": 10}
|
||||
|
||||
Reference in New Issue
Block a user