From 8616d43e3105365991004992f164f52cafff70f9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 02:48:08 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/routes/settings.py | 4 +--- studio/backend/tests/test_parallel_slots_per_load.py | 1 - tests/studio/test_model_picker_contracts.py | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/studio/backend/routes/settings.py b/studio/backend/routes/settings.py index f06de5aff9..67699d4e51 100644 --- a/studio/backend/routes/settings.py +++ b/studio/backend/routes/settings.py @@ -174,9 +174,7 @@ class ModelOverridePayload(BaseModel): spec_draft_n_max: Optional[int] = Field(default = None, ge = 1, le = 16) # Parallel decode slots (llama-server --parallel), GGUF-only like the picker. # None follows the server-wide default set at launch. - n_parallel: Optional[int] = Field( - default = None, ge = PARALLEL_SLOTS_MIN, le = PARALLEL_SLOTS_MAX - ) + n_parallel: Optional[int] = Field(default = None, ge = PARALLEL_SLOTS_MIN, le = PARALLEL_SLOTS_MAX) tensor_parallel: bool = False # Validated in bytes below, not by max_length: pydantic counts characters, so a # multi-byte template would pass here and be dropped by the UTF-8 normalizer. diff --git a/studio/backend/tests/test_parallel_slots_per_load.py b/studio/backend/tests/test_parallel_slots_per_load.py index 87fd2091cb..a3da4ea24b 100644 --- a/studio/backend/tests/test_parallel_slots_per_load.py +++ b/studio/backend/tests/test_parallel_slots_per_load.py @@ -156,7 +156,6 @@ def test_override_mirror_matches_shared_bounds(): # The API auto-switch override map mirrors the bounds rather than importing them: # llama_server_args owns the extra-args allow-list that module stays out of. from utils.openai_auto_switch_settings import PARALLEL_SLOTS_MAX, PARALLEL_SLOTS_MIN - assert (PARALLEL_SLOTS_MIN, PARALLEL_SLOTS_MAX) == (PARALLEL_MIN, PARALLEL_MAX) diff --git a/tests/studio/test_model_picker_contracts.py b/tests/studio/test_model_picker_contracts.py index 1306189561..db510e8cd7 100644 --- a/tests/studio/test_model_picker_contracts.py +++ b/tests/studio/test_model_picker_contracts.py @@ -715,9 +715,9 @@ def test_parallel_slots_reach_an_api_load_through_the_server_mirror(): route = (WORKDIR / "studio" / "backend" / "routes" / "settings.py").read_text(encoding = "utf-8") assert "n_parallel: Optional[int] = Field(" in route assert "n_parallel = payload.n_parallel," in route - store = ( - WORKDIR / "studio" / "backend" / "utils" / "openai_auto_switch_settings.py" - ).read_text(encoding = "utf-8") + store = (WORKDIR / "studio" / "backend" / "utils" / "openai_auto_switch_settings.py").read_text( + encoding = "utf-8" + ) assert 'entry["n_parallel"] = n_parallel' in store # GGUF-only, like the picker: a safetensors load has no llama-server slots. gguf_block = store.split(" if is_gguf:", 1)[1]