Repository navigation
Studio: add 'Load on selection' toggle to configure load options before loading - #6348
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a deferred-load staging flow ("Load on selection" off) for GGUF models. When disabled, selecting a model stages it as a pending selection, allowing users to configure load options (such as context length, tensor parallelism, and speculative decoding) before performing the actual GPU load. To support this, the backend can now read the native context length directly from the local GGUF header, and the frontend uses this metadata to populate the context slider. The review feedback points out an outdated comment in chat-settings-sheet.tsx that incorrectly states certain options cannot be configured during staging, and suggests updating it to match the actual implementation.
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: 0f0f33858a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f13924475
ℹ️ 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".
…ad-on-selection review
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98700e0c6e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3669c8ad66
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61a0d07385
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97fb7ef6d9
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 109639a625
ℹ️ 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".
|
There are a couple UX gaps here that may be worth addressing before merge. First, when “Load on selection” is disabled, it may not be instantly clear to users that selecting a model does not load it anymore. Consider showing a small popup/dialog after selection that forces per model setting configurations to appear and an explicit load model button. Also, this control appears in the general model selector, but the deferred-load behavior currently applies only to GGUF/local load paths. That can make the UX feel conflicted: the toggle reads like a general model-selection behavior, while non-GGUF selections still load immediately. We should clarify the copy/scope. |
Keep the load-on-selection hint visually anchored to the control and make the on/off behavior explicit without changing the broader deferred-load flow.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 587be286dd
ℹ️ 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".
|
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. |
|
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
CI passes on CI test fork except for inherited failures from main, tested and improved UX to include explicit staging notification and gguf only hint. Great work @oobabooga, merging. |
Bring the branch up to date with main (#6348 'Load on selection' and the GGUF native context-length probe) and resolve the validate-model overlap by keeping BOTH sides: - ValidateModelRequest: main's include_context_length opt-in. - ValidateModelResponse: the PR's requires_security_review AND main's context_length. - /inference/validate: run both the LoRA/security target resolution and the optional GGUF header context-length probe. - types/api.ts: expose both requires_security_review and context_length. Also restore the '@/components/ui/alert' import in chat-settings-sheet.tsx, which main's staged-load Alert block needs (the import block had taken the branch side during auto-merge).
Bring the Select model redesign up to date with main, which now carries the new Hub and the deferred-load staging flow from #6348. - Adopt main's staging as canonical: the store, use-chat-model-runtime and use-staged-model-preparation, the staged Run settings sidebar, and the gguf metadata context reader. Drop the parallel implementation this branch carried so there is a single staging path. - Keep the redesigned single-Hub selector with section pills, the always-on fine-tuned shortcut and empty state, the Custom Folders jump, the folder browser refetch fix and the instant picker tooltips. - Move the 'Load on selection' toggle out of the popover into Settings, Chat so there is one control for the setting.

Currently you can't change a GGUF model's load settings before loading it. The load options (context length, KV cache, tensor parallelism) only show up in the Model menu after the model is already loaded, and picking a model loads it right away.
This PR adds a "Load on selection" toggle to the "Select model" menu. When it's off, picking a model reads its metadata (downloading the file first if needed), fills in the Model menu on the right sidebar, and shows that menu without loading the model. You set the options you want, then click the new "Load model" button.
This is a necessary preliminary step for fine-grained GPU/memory management options, which will be added in a follow-up.
Example
Say I want to load a model with Tensor Parallelism. Today that takes:
The first load is wasted work: the full load time and disk reads, just to unload and reload a moment later. With the toggle off, you set Tensor Parallelism first and load once.
How it works
The toggle defaults to on, so existing one-click behavior is unchanged. When off, picking a GGUF stages it instead of loading:
The download happens once (you need the file regardless) and the GPU load happens once, with the options already applied.
A native (dropped or picked) file is read in place via its path token, with no download. If the header can't be read (a failed download, or an expired native lease), the sidebar still opens without the context slider and the model loads normally, with context coming from the load response.
Scope: every model pick respects the toggle. The main chat selector, the Hub "Load" button, native drag-drop, and "Pick a file from disk" all stage when it's off and load immediately when it's on. External models always load immediately, since there's no file or load option to set.
Backend
read_gguf_context_lengthreads{arch}.context_lengthfrom the header (about 30 ms, cached by path/mtime/size). It reuses the existinggguf_metadataparser and skip logic, so there is no new GGUF parsing.resolve_local_gguf_pathlocates the downloaded shard-1 file in the HF cache, read-only. It never triggers a download. For a native file the resolved canonical path is read directly./validatereturnscontext_lengthonly when the newinclude_context_lengthflag is set, so the normal load preflight pays nothing for it. The probe is best-effort: a header-read failure can't fail validation, and a non-positive ceiling reads as absent.Frontend
pendingSelection, not the loaded model'sggufContextLength, so it can't pollute the loaded model's display.