Repository navigation
Studio: on low disk, load the largest GGUF quant that fits and show which one loaded - #11052
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39451dbae2
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8706292d58
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b2aa4fa92
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b09068ada
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b09068ada
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review + GitHub Actions low-disk evidencePinned head:
The other four suggestions were declined with reasons on each thread. Real Studio, real low disk. Both runs use the same workflow and probe. The HF cache is a 16 GB loopback ext4 volume with a ballast file, so free space is exactly 7.45 GiB. The probe requests
The Actions runs used head Tests (CPU).
pre-commit.ci failed earlier on this PR, and on #11050, #11046 and #11053, because the kwarg hook reformats about 1,200 files across the repo. The PR's own files pass the hook and |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b09068ada
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Confirmed this hits llama_cpp.py where the low-disk fallback takes the smallest quant and the backend keeps reporting the requested one, so the header and status show a variant that is not running. Will get this reviewed. |
…ne that did not fit The fallback records the served quant in `_hf_variant`, so /status, the Studio header and the load dedup all name what is actually running. `_last_load_intent` was left on the requested quant, and that snapshot is what the crash-respawn watchdog replays and what /api/inference/load inherits as `source.hf_variant` when a request omits the variant. Either one re-resolved the quant that did not fit: on a disk since freed that starts a multi-GB download nobody asked for, and on a disk still tight it can land on a quant other than the one that was serving. The snapshot now carries the served variant too. In the selection itself: when nothing leaves the 5 GB reserve free, variants already complete in the cache tie on new bytes, and the tie went to the smaller one for no saving. The size tie-break now takes the better quant of two that are equally free. Only cached candidates can tie, so nothing else moves. `_gguf_variant_fallback` becomes `_pending_variant_fallback`; one character from `_variant_fallback_warning` was too close for two fields with different lifetimes. Tests: the served-variant case now asserts the replayed snapshot, plus new cases for the cached tie-break and for the joined load warning including which notice the teardown keeps. The frontend test drives the real `loadModel`, so the notice wiring is proven rather than matched in source, and the CLI test pins the warning to stderr.
|
Reviewed the branch and pushed one fix commit (ece000c). Fixed — the respawn intent kept the quant that did not fit. The fallback already recorded the served quant in Fixed — the tie-break threw away a cached quant. When nothing leaves the 5 GB reserve free, variants already complete in the cache tie on new bytes, and Renamed Tests. The served-variant case asserts the replayed snapshot; new cases cover the cached tie-break and the joined Validation. Selection also checked against live Hub metadata rather than fixtures.
And the checkpoint-family filter is a narrowing, so it was checked not to reject legitimate candidates: Comments and docstrings across the branch were cut by ~60% per the repo's comment guidance, and the new frontend test was folded into Not changed, with reasons. I went through the open review threads and agree with the calls already made on them, having checked each against the source:
All four are scope-limiting choices, not defects, so I've left them and resolved the threads. @codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…s now reads `FakeLlamaCppBackend` answers only `_InferenceRuntimeFields` from `__getattr__` and raises for anything else, so the new unguarded `llama_backend.last_load_warning` read in `get_status` is an `AttributeError` under every double-driven status test. It does not show on this branch's own CI because the double gained that guard after this branch forked, which is the drift its docstring asks new shared attributes to be added here to prevent.
|
Merged current
Checked against the merged tree rather than this branch alone: |
|
Ran the merged state through CI on a throwaway PR in my fork (now closed) so this got a full run against current
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Lyxot
left a comment
There was a problem hiding this comment.
Approving. Re-verified against the current main tip rather than the branch's merge base.
Trial-merging the latest main into this head merges cleanly — llama_cpp.py auto-merges even though #11055 also landed in it, and the hunks do not overlap.
On that merged tree:
studio/backend/tests/multi_account/test_chat_shared_resident.pypasses, and droppinglast_load_warningfrom the shared backend double reddens exactly its three sharing cases — so the double entry the new/statusread needs is load-bearing, not decoration.- The backend batch (this PR's tests plus the adjacent llama.cpp suites) is 1024 passed / 1 failed. The one failure is
test_llama_cpp_wait_for_health.py::TestWaitForHealthResilience::test_a_started_shutdown_refuses_to_spawn, which fails identically on cleanmainwith this branch absent, so it is pre-existing and unrelated. - Frontend unit suite: 7717 passed, 0 failed.
- Mutation checks still bite: inverting the
roomyselection to the smallest fitting quant fails two cases, and dropping the replayed-intent rewrite fails the served-variant case.
The workflow runs on this head are all still queued pending approval, so upstream CI has no verdict yet; the equivalent legs were exercised separately and the only red ones traced to unsloth-zoo and to failures already present on main.
…hich one loaded (unslothai#11052) * Studio: fall back to the largest GGUF quant that fits on low disk and report it * Size-check cached variants before counting them as free in the low-disk fallback * Studio: show the low-disk fallback warning in unsloth start and in Studio * Format load warning test for the kwarg hook * Print the load warning only when it belongs to the resolved model * Keep the low-disk fallback on the requested checkpoint * fix(studio): replay the quant the low-disk fallback served, not the one that did not fit The fallback records the served quant in `_hf_variant`, so /status, the Studio header and the load dedup all name what is actually running. `_last_load_intent` was left on the requested quant, and that snapshot is what the crash-respawn watchdog replays and what /api/inference/load inherits as `source.hf_variant` when a request omits the variant. Either one re-resolved the quant that did not fit: on a disk since freed that starts a multi-GB download nobody asked for, and on a disk still tight it can land on a quant other than the one that was serving. The snapshot now carries the served variant too. In the selection itself: when nothing leaves the 5 GB reserve free, variants already complete in the cache tie on new bytes, and the tie went to the smaller one for no saving. The size tie-break now takes the better quant of two that are equally free. Only cached candidates can tie, so nothing else moves. `_gguf_variant_fallback` becomes `_pending_variant_fallback`; one character from `_variant_fallback_warning` was too close for two fields with different lifetimes. Tests: the served-variant case now asserts the replayed snapshot, plus new cases for the cached tie-break and for the joined load warning including which notice the teardown keeps. The frontend test drives the real `loadModel`, so the notice wiring is proven rather than matched in source, and the CLI test pins the warning to stderr. * test(studio): teach the shared backend double the load warning /status now reads `FakeLlamaCppBackend` answers only `_InferenceRuntimeFields` from `__getattr__` and raises for anything else, so the new unguarded `llama_backend.last_load_warning` read in `get_status` is an `AttributeError` under every double-driven status test. It does not show on this branch's own CI because the double gained that guard after this branch forked, which is the drift its docstring asks new shared attributes to be added here to prevent. --------- Co-authored-by: Daniel Han <[email protected]> Co-authored-by: Lyxot <[email protected]>



If the GGUF quant you asked for did not fit on disk, Studio quietly loaded the smallest quant in the repo, often a 1-bit one, even when a much better one would fit. Studio kept showing the quant you asked for, and asking for it again after freeing space did nothing because it thought it was already loaded. This happens with unsloth start and direct load requests.
Now it picks the largest quant that still leaves 5 GB free, the same margin Studio already keeps for downloads. If none leaves that much, it picks the smallest that fits, like before. Studio shows the quant that actually loaded, so asking for the original again after freeing space downloads it. unsloth start prints a warning naming both quants, and Studio shows the same warning when you open it or load a model. Other load warnings, such as a model too big for memory, now show the same way.
With 7.5 GB free and unsloth start hermes --model unsloth/Qwen3-4B-GGUF --gguf-variant BF16, main showed BF16 in the header while a 1-bit quant was running and chat replied with garbage, and running it again after freeing space kept the 1-bit quant. With this change Q4_1 loads, the command and Studio both show the warning, the header shows Q4_1 and chat works. After freeing space BF16 downloads and loads with no warning. Added unit tests that fail on main.