Repository navigation
Studio: per-model launch flags, model discovery, and a settings UI for auto-switch - #6430
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces per-model launch overrides (such as llama_extra_args and max_seq_length) when auto-switching models, along with corresponding API endpoints, database persistence, and a frontend settings UI. The feedback highlights three key improvements: explicitly checking for None on max_seq_length to avoid ignoring 0, making the model retrieval endpoint case-insensitive to align with the local resolver, and improving frontend input validation to prevent empty strings from being silently coerced to 0 seconds.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8db6a7bc9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…idle-input empty guard)
…obe/embedding models from discovery)
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Thanks for this, it is a clean extension and the atomic per-entry override merge plus the I pushed three hardening fixes to the base branch (
Two small things left for this PR: 1. Case-insensitive 2. Empty idle field should not coerce to 0. One design question (no change requested). Codex flagged that a partial override which sets only The other automated suggestions (storing an explicit |
…, align with his review
|
Thanks! Merged your three fixes in. The two small ones (case-insensitive retrieve, empty idle field) were already in the branch. And I took your call on the partial override and kept the inherit behavior. Branch is updated. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cff9c699e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
… into studio-openai-auto-switch-model
cd338b3
into
unslothai:studio-openai-auto-switch-model
Builds on the opt-in OpenAI model auto-switch in this branch and adds the user-facing layer on top: per-model launch flags, model discovery via
/v1/models, and a settings UI. Off by default, so drop-in behavior is unchanged until enabled.What this adds
llama_extra_argsandmax_seq_lengthare applied when a model is auto-switched, so a swapped model loads the way the user configured it instead of with bare defaults. Configured viaGET/PUT /api/settings/openai-auto-switch/overrides, keyed by the model id/v1/modelsadvertises. Stored with an atomic per-entry merge so two PUTs for different models can't drop each other./v1/modelsdiscovery. When auto-switch is on,/v1/modelslists every downloaded GGUF it can swap to (and retrieve resolves them), so a client can discover what to request instead of seeing only the loaded model. Off keeps the default listing (loaded model only) unchanged.Screenshot
The "Model auto-switch" section, General tab (enable toggle, idle auto-unload, and the hint shown while it is off):
Verification
studio/backend/tests/test_openai_auto_switch.py: the existing suite plus new tests for the overrides (apply, partial apply, store round-trip, route validation), and the discovery list and retrieve paths. Frontend typecheck and biome clean.llama-serverunder both. The two features this PR adds match llama-swap:/v1/modelsadvertises every swap-eligible model (Studio listed all 7 downloaded GGUFs, llama-swap its 2 configured), and a per-model context override loads at that size (8192, same as llama-swap's--ctx-size). The auto-switch core (swap-by-model; an unknown model serves the loaded one, where llama-swap 404s) was re-confirmed unchanged after the rebase.Notes
/v1/modelsreports./v1/chat/completions, so active use resets the timer and a model is never unloaded mid-response.