[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-05-22 14:36:25 +00:00
commit de3032eb07
3 changed files with 10 additions and 17 deletions

View file

@ -5318,7 +5318,9 @@ def _extract_response_format(payload):
def _build_openai_passthrough_body(
payload, backend_ctx = None, model_identifier: str | None = None,
payload,
backend_ctx = None,
model_identifier: str | None = None,
) -> dict:
"""Assemble the llama-server request body from a ChatCompletionRequest.
@ -5346,7 +5348,8 @@ def _build_openai_passthrough_body(
except Exception as exc:
logger.warning(
"openai_passthrough.family_defaults_lookup_failed model=%s err=%s",
model_identifier, exc,
model_identifier,
exc,
)
# Per-request enable_thinking already lifted from extra_body upstream.
if payload.enable_thinking is not None:

View file

@ -45,9 +45,7 @@ class TestLoadInferenceConfig:
assert cfg["chat_template_kwargs"] == {"reasoning_effort": "medium"}
def test_nemotron_load_surfaces_dict(self):
cfg = load_inference_config(
"unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF"
)
cfg = load_inference_config("unsloth/NVIDIA-Nemotron-3-Super-120B-A12B-GGUF")
assert cfg["chat_template_kwargs"] == {"enable_thinking": True}
def test_qwen3_load_returns_none_for_kwargs(self):
@ -73,14 +71,10 @@ class TestLoadInferenceConfig:
class TestTemperatureBumps:
def test_devstral_temperature_lowered_to_card_value(self):
# Devstral-Small-2 card recommends T=0.15.
cfg = load_inference_config(
"unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF"
)
cfg = load_inference_config("unsloth/Devstral-Small-2-24B-Instruct-2512-GGUF")
assert cfg["temperature"] == 0.15
def test_ministral_temperature_below_one_tenth(self):
# Ministral-3 card says "temperature below 0.1 for production".
cfg = load_inference_config(
"unsloth/Ministral-3-8B-Instruct-2512-GGUF"
)
cfg = load_inference_config("unsloth/Ministral-3-8B-Instruct-2512-GGUF")
assert cfg["temperature"] < 0.1

View file

@ -32,9 +32,7 @@ class TestFamilyDefaults:
body = _build_openai_passthrough_body(
payload, model_identifier = "unsloth/gpt-oss-120b-GGUF"
)
assert body.get("chat_template_kwargs") == {
"reasoning_effort": "medium"
}
assert body.get("chat_template_kwargs") == {"reasoning_effort": "medium"}
def test_nemotron_family_default_reaches_outbound(self):
payload = _make_payload()
@ -67,9 +65,7 @@ class TestPerRequestOverrides:
assert body["chat_template_kwargs"]["reasoning_effort"] == "high"
def test_extra_body_chat_template_kwargs_wins_outright(self):
payload = _make_payload(
chat_template_kwargs = {"reasoning_effort": "low"}
)
payload = _make_payload(chat_template_kwargs = {"reasoning_effort": "low"})
body = _build_openai_passthrough_body(
payload, model_identifier = "unsloth/gpt-oss-120b-GGUF"
)