Repository navigation
Drop an MTP sidecar llama-server cannot load as --model-draft - #10197
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. |
…draft Preferring an embedded MTP head over a repo-root `mtp-*.gguf` fixed one half of unslothai#10169. The reported repository publishes both halves, and the other half still aborts the launch: `RVN-Q6_K-mtp.gguf` reports `qwen35.nextn_predict_layers = 1` and now takes no sidecar, while `RVN-Q6_K.gguf` and its `-vision` and `-multilingual` siblings omit the key entirely. Those headless quants still pair with `mtp-RVN.gguf`, which carries 16 tensors, no `token_embd.weight` and no `nextn_shared_target_tensors`, so llama-server exits with "tensor 'token_embd.weight' not found" and the spawn retry drops speculative decoding for a load that had a working configuration available. The resolved drafter is now judged as well as the target. A file that ships neither `token_embd.weight` nor `<arch>.nextn_shared_target_tensors` is dropped and the load continues without it. Only `token_embd` is checked: the rest of the required set is per-architecture, qwen4exp creates no `output_norm` tensor at all, and a published Flash-Next head ships `token_embd` without one, so a tighter refusal would reject drafters that work. Split sets and unreadable headers are left for llama-server to judge. The check runs before the fit prices anything, so a drafter that will not launch cannot push layers off the GPU for VRAM it never needs. The dropped file is recorded as suppressed, since it stays on disk and the caller keeps detecting it: without that record every repeat Apply tears down a healthy server. For the same reason the `drafter_not_found` refetch rule stands down for a suppressed drafter, which refetching would only find again. DSpark and DFlash sidecars are untouched; they borrow `token_embd` from the target by design. The virtualised-Metal drop now records only the drafter it actually removed. It can fire on a drafter supplied through llama.cpp arguments with none of ours launched, where the unconditional assignment cleared the record above. The memory estimate applies the same judgement. `_estimate_gguf_required_gb` prices a load independently of the launch planner, and it charged a configured `mtp-*.gguf` for every drafting mode, so a sidecar the load now drops still cost VRAM in the panel and in the chat-load admission guard, which could refuse a load that fits while training runs.
792ce64 to
9ae7238
Compare
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
|
Checked main and nothing inspects the drafter file itself, so a head-only |
|
Confirmed main never inspects the sidecar itself, so a head-only |
…ole split set Three changes on top of the drop this branch adds. The drop itself is right: on llama-server b10909-mix-bea84f7, a head-only sidecar passed as --model-draft beside its target ends the launch with "check_tensor_dims: tensor 'token_embd.weight' not found", and one carrying nextn_shared_target_tensors serves. Both verdicts measured, not inferred, over the four shapes repositories publish plus a false flag, a flag under the wrong architecture prefix, and a head with no output_norm. The rule moves to utils/models/gguf_metadata.py, where every other GGUF header read already lives. It was reading the header through gguf.GGUFReader, which maps the whole file, with no cache, on two paths: the load and _estimate_gguf_required_gb. That second one is reached from POST /api/inference/estimate-memory, which documents itself as safe to call on every settings change, and from kv-cache-estimate, which prices the file term up to three times per request per picker row. The projector capability read two lines above it goes through the (path, mtime, size) cache; this now does too, over the same streaming parser _parse_gguf_has_classifier_head uses, so no mmap and no gguf import on a request path. Repairing a rejected sidecar in place is still picked up, since the key carries mtime and size. split.count > 1 no longer exempts a file from the check. llama-server opens sibling shards by FILENAME, so a lone file whose header merely claims to be a split set was accepted untested and then ended the launch anyway. The verdict now comes from colocated_split_shards, the same helper _gguf_has_classifier_head fans out over: a complete set is judged across every shard, so embeddings living in shard 2 keep the set, and a set whose shards are not all here still fails open. The auto-Vulkan-crash replay that comes up on CPU returns before the commit block, so it kept the previous load's _mtp_draft_path and _mtp_draft_suppressed_path. That was inert while only virtualised Metal could suppress a drafter, since an auto-Vulkan fallback cannot happen there. An unloadable sidecar can be suppressed on any platform, and a carried-over suppressed path stands the drafter_not_found refetch down for a load that dropped nothing of its own.
|
Reviewed this against a real llama-server rather than from the source, because the premise turns on a detail the shipped binary decides. Pushed three changes in bca0212; the drop itself is correct and stays. The premise holds, and the metadata branch is load-bearingI built the drafter shapes as real GGUFs and passed each one to
So the error string in the description is the real one, and the shared-target branch is not a guess: that flag is what admits a head into What changed
The rule moved to The CPU-fallback return now records the drafter. The auto-Vulkan-crash replay returns before the commit block, so it kept the previous load's On your two open repliesBoth are fair. The refetch guard is right for the paravirtual drop as well, and it arguably fixes a live bug there: an The one thing I would still like is a distinct reason. A dropped-but-present sidecar reports Validation
|
# Conflicts: # studio/backend/utils/models/gguf_metadata.py
…ays what is wrong The suppression record said THAT a drafter was dropped but not WHY, and two separate consumers need to know: whether repairing the file should reload, and which fallback reason the client is told. Both drops now carry a reason, "unloadable" or "paravirtual". Repairing a rejected sidecar in place did nothing until an unrelated reload. The dedupe counts a deliberately dropped drafter as launched and compares resolved paths, so replacing a head-only mtp-*.gguf with a self-contained one at the same path still reports the model as already loaded and the header check never reran. It is re-asked now, but only for the unloadable drop: the paravirtual one is a property of the build, so the same bytes would be dropped again and the reload would buy nothing. The predicate is cached on (path, mtime, size), so an untouched file is not reparsed. A present, unopenable sidecar reported drafter_not_found, which tells a local load to place a file that is already on disk and offers a remote load a refetch this branch deliberately stands down. It also sits in the frontend's RETRYABLE_SPEC_FALLBACKS, so Apply kept sending a reload the backend then deduped through already_loaded. It reports drafter_unloadable now, with copy that names the real remedy. The field is Optional[str], so an older client falls through to the generic message rather than breaking, and the new reason is absent from the retry set by construction. Tests: repairing an unloadable drafter in place reloads, repairing a paravirtually suppressed one does not, the reason is reported for a dropped sidecar and still drafter_not_found for a genuinely absent one, and drafter_unloadable is not repairable client-side. 1202 passed across the studio backend suites this touches.
|
@codex security review |
…ains itself The fallback that records a reason was reachable only for the name-only Gemma shape. RVN-Q6_K.gguf, the quant this branch exists for, reports no nextn_predict_layers and carries no -mtp in its name, so the sidecar beside it was its only MTP signal: clearing mtp_draft_path made is_mtp_model read false, _mtp_drafter_missing recognised Gemma alone, and neither Auto nor forced MTP reached _fallback_drafter_not_found. Speculative decoding went off with spec_fallback_reason null, so the panel had nothing to show for it. The dropped path is kept as a signal in both predicates, gated on the drop having happened. is_mtp_model sees it so the MTP arms are entered at all, and _mtp_drafter_missing sees it so the arm taken is the fallback rather than _emit_mtp: emitting MTP with no drafter is what aborts llama-server, which is the failure this branch removes. A model that never had a sidecar is untouched, and a Gemma name already satisfied the first clause, so neither existing path changes. Tests: the reported non-Gemma quant now reports drafter_unloadable under both auto and forced mtp and emits no --model-draft, and a plain quant with no sidecar at all still records no reason. 1205 passed across the studio backend suites this touches.
…er runs The re-check added in 00eecb7 answers on the next /load, and `adoptable` in use-chat-model-runtime skips /load entirely when residentSpeculativeNeedsRepair says there is nothing to repair. With drafter_unloadable outside the retry set, replacing the sidecar in place did exactly what the settings sheet tells the user to do and then nothing happened, because the request that would have noticed was never sent. The comment on that gate already says as much: a repairable speculative fallback is the one case where an identical request is not a no-op. So it belongs in the set. An unchanged file still dedupes, which is what makes declining the shortcut cheap rather than a teardown: the re-check asks the predicate, gets the same verdict, and _runtime_matches_intent adopts, so the load returns through already_loaded without touching the server. That safety is the earlier commit's doing, and it is why this cannot loop. No sendsGgufPath exclusion, unlike drafter_not_found. That one is guarded on `intent.gguf_path is None` because it drives a refetch; this re-check sits in the drafter comparison, guarded on `intent.gguf_path is not None or intent.compare_mtp_draft`, so a standalone .gguf load reaches it too. Frontend suite: 105 passed in resident-config-match.test.ts, and the whole studio/frontend suite shows the same 226 pre-existing failures as the merge base, zero new.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed670b6e00
ℹ️ 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".
| _mtp = getattr(config, "gguf_mtp_file", None) | ||
| if not ( | ||
| _mtp and Path(_mtp).is_file() and not _mtp_drafter_loads_standalone(str(_mtp)) | ||
| ): |
There was a problem hiding this comment.
Invalidate cached estimates when drafter contents change
When an unloadable sidecar has already been estimated and the user follows the new guidance to replace it in place, this content-dependent predicate is not necessarily reevaluated: _gguf_resident_file_gb caches the result for 30 seconds using the main model path and settings, without the MTP sidecar's identity or metadata version in its key. During that window the memory panel continues omitting the now-loadable drafter and its potentially large runtime reserve even though the backend rechecks and launches it; include the sidecar's file identity in the cache key or invalidate the cached estimate after replacement.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Accurate as a description, but below the bar for a change here, and I checked the two things that would have raised it.
The admission guard does not share that cache. routes/inference.py:13501 calls _estimate_gguf_required_gb directly rather than going through _gguf_resident_file_gb, so the 409-against-training path and the load itself always recompute and always see the repaired file. Had the guard read the cached value this would be a 409-class bug and I would have fixed it. What is left is the memory PANEL showing a figure up to 30 s stale after the file is swapped underneath it, and it under-reports rather than over-blocks, so it cannot refuse a load that fits.
And the cache omits file identity for every file it keys on, not just the sidecar: the key is (identifier, gguf_variant, str(main), disable_vision, speculative_type, extras, token fingerprint, local_only), with no mtime or size for the main weight either. Replace the main GGUF in place today, on main, and the same 30 s window applies. Keying only the drafter's identity would make this one term sharper than the weights term beside it, which is the inconsistency rather than the fix.
So: transient, self-healing in 30 s, display-only, guarded where it counts, and a pre-existing property of that cache rather than something this branch introduces. Happy to reconsider if you can point at a consumer of the cached value that refuses or resizes a load.
…dropped The unloadable-drafter drop cleared the configured path whenever the detected sidecar could not load standalone, without first checking whether llama_extra_args already names its own --model-draft. Draft flags are last-wins, so the user's file is the one llama-server opens and the rejected sibling is never passed; dropping it anyway made the load read as drafterless and _build_speculative_flags emitted the ngram or default fallback before the extras were appended, so a valid override stopped running as MTP at all. Skip the drop when the extras own the draft path, matching the idiom the adjacent paravirtual drop already uses.
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
Same code, fewer lines: collapse the multi-line explanations to their load-bearing sentence and drop the restatements. The measured llama-server behaviour behind the predicate is kept, since nothing in the tree records it otherwise.
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
The kwarg-spacing hook rewrites one line in _split_fits_capacity that #10197 left unformatted, so pre-commit.ci fails on every open PR: it runs --all-files against the PR merged into main, and the drift arrives from main rather than from the PR. Reproduced on a clean checkout of main with no PR applied. Formatting only, no semantic change.
* fix(studio): drop an MTP sidecar llama-server cannot load as --model-draft Preferring an embedded MTP head over a repo-root `mtp-*.gguf` fixed one half of #10169. The reported repository publishes both halves, and the other half still aborts the launch: `RVN-Q6_K-mtp.gguf` reports `qwen35.nextn_predict_layers = 1` and now takes no sidecar, while `RVN-Q6_K.gguf` and its `-vision` and `-multilingual` siblings omit the key entirely. Those headless quants still pair with `mtp-RVN.gguf`, which carries 16 tensors, no `token_embd.weight` and no `nextn_shared_target_tensors`, so llama-server exits with "tensor 'token_embd.weight' not found" and the spawn retry drops speculative decoding for a load that had a working configuration available. The resolved drafter is now judged as well as the target. A file that ships neither `token_embd.weight` nor `<arch>.nextn_shared_target_tensors` is dropped and the load continues without it. Only `token_embd` is checked: the rest of the required set is per-architecture, qwen4exp creates no `output_norm` tensor at all, and a published Flash-Next head ships `token_embd` without one, so a tighter refusal would reject drafters that work. Split sets and unreadable headers are left for llama-server to judge. The check runs before the fit prices anything, so a drafter that will not launch cannot push layers off the GPU for VRAM it never needs. The dropped file is recorded as suppressed, since it stays on disk and the caller keeps detecting it: without that record every repeat Apply tears down a healthy server. For the same reason the `drafter_not_found` refetch rule stands down for a suppressed drafter, which refetching would only find again. DSpark and DFlash sidecars are untouched; they borrow `token_embd` from the target by design. The virtualised-Metal drop now records only the drafter it actually removed. It can fire on a drafter supplied through llama.cpp arguments with none of ours launched, where the unconditional assignment cleared the record above. The memory estimate applies the same judgement. `_estimate_gguf_required_gb` prices a load independently of the launch planner, and it charged a configured `mtp-*.gguf` for every drafting mode, so a sidecar the load now drops still cost VRAM in the panel and in the chat-load admission guard, which could refuse a load that fits while training runs. * Judge an MTP drafter from the cached header reader, and across its whole split set Three changes on top of the drop this branch adds. The drop itself is right: on llama-server b10909-mix-bea84f7, a head-only sidecar passed as --model-draft beside its target ends the launch with "check_tensor_dims: tensor 'token_embd.weight' not found", and one carrying nextn_shared_target_tensors serves. Both verdicts measured, not inferred, over the four shapes repositories publish plus a false flag, a flag under the wrong architecture prefix, and a head with no output_norm. The rule moves to utils/models/gguf_metadata.py, where every other GGUF header read already lives. It was reading the header through gguf.GGUFReader, which maps the whole file, with no cache, on two paths: the load and _estimate_gguf_required_gb. That second one is reached from POST /api/inference/estimate-memory, which documents itself as safe to call on every settings change, and from kv-cache-estimate, which prices the file term up to three times per request per picker row. The projector capability read two lines above it goes through the (path, mtime, size) cache; this now does too, over the same streaming parser _parse_gguf_has_classifier_head uses, so no mmap and no gguf import on a request path. Repairing a rejected sidecar in place is still picked up, since the key carries mtime and size. split.count > 1 no longer exempts a file from the check. llama-server opens sibling shards by FILENAME, so a lone file whose header merely claims to be a split set was accepted untested and then ended the launch anyway. The verdict now comes from colocated_split_shards, the same helper _gguf_has_classifier_head fans out over: a complete set is judged across every shard, so embeddings living in shard 2 keep the set, and a set whose shards are not all here still fails open. The auto-Vulkan-crash replay that comes up on CPU returns before the commit block, so it kept the previous load's _mtp_draft_path and _mtp_draft_suppressed_path. That was inert while only virtualised Metal could suppress a drafter, since an auto-Vulkan fallback cannot happen there. An unloadable sidecar can be suppressed on any platform, and a carried-over suppressed path stands the drafter_not_found refetch down for a load that dropped nothing of its own. * Record why a drafter was suppressed, so a repair reloads and the UI says what is wrong The suppression record said THAT a drafter was dropped but not WHY, and two separate consumers need to know: whether repairing the file should reload, and which fallback reason the client is told. Both drops now carry a reason, "unloadable" or "paravirtual". Repairing a rejected sidecar in place did nothing until an unrelated reload. The dedupe counts a deliberately dropped drafter as launched and compares resolved paths, so replacing a head-only mtp-*.gguf with a self-contained one at the same path still reports the model as already loaded and the header check never reran. It is re-asked now, but only for the unloadable drop: the paravirtual one is a property of the build, so the same bytes would be dropped again and the reload would buy nothing. The predicate is cached on (path, mtime, size), so an untouched file is not reparsed. A present, unopenable sidecar reported drafter_not_found, which tells a local load to place a file that is already on disk and offers a remote load a refetch this branch deliberately stands down. It also sits in the frontend's RETRYABLE_SPEC_FALLBACKS, so Apply kept sending a reload the backend then deduped through already_loaded. It reports drafter_unloadable now, with copy that names the real remedy. The field is Optional[str], so an older client falls through to the generic message rather than breaking, and the new reason is absent from the retry set by construction. Tests: repairing an unloadable drafter in place reloads, repairing a paravirtually suppressed one does not, the reason is reported for a dropped sidecar and still drafter_not_found for a genuinely absent one, and drafter_unloadable is not repairable client-side. 1202 passed across the studio backend suites this touches. * Keep a dropped sidecar as an MTP signal, so the motivating quant explains itself The fallback that records a reason was reachable only for the name-only Gemma shape. RVN-Q6_K.gguf, the quant this branch exists for, reports no nextn_predict_layers and carries no -mtp in its name, so the sidecar beside it was its only MTP signal: clearing mtp_draft_path made is_mtp_model read false, _mtp_drafter_missing recognised Gemma alone, and neither Auto nor forced MTP reached _fallback_drafter_not_found. Speculative decoding went off with spec_fallback_reason null, so the panel had nothing to show for it. The dropped path is kept as a signal in both predicates, gated on the drop having happened. is_mtp_model sees it so the MTP arms are entered at all, and _mtp_drafter_missing sees it so the arm taken is the fallback rather than _emit_mtp: emitting MTP with no drafter is what aborts llama-server, which is the failure this branch removes. A model that never had a sidecar is untouched, and a Gemma name already satisfied the first clause, so neither existing path changes. Tests: the reported non-Gemma quant now reports drafter_unloadable under both auto and forced mtp and emits no --model-draft, and a plain quant with no sidecar at all still records no reason. 1205 passed across the studio backend suites this touches. * Let a repaired drafter reach the backend, or the content re-check never runs The re-check added in 00eecb7 answers on the next /load, and `adoptable` in use-chat-model-runtime skips /load entirely when residentSpeculativeNeedsRepair says there is nothing to repair. With drafter_unloadable outside the retry set, replacing the sidecar in place did exactly what the settings sheet tells the user to do and then nothing happened, because the request that would have noticed was never sent. The comment on that gate already says as much: a repairable speculative fallback is the one case where an identical request is not a no-op. So it belongs in the set. An unchanged file still dedupes, which is what makes declining the shortcut cheap rather than a teardown: the re-check asks the predicate, gets the same verdict, and _runtime_matches_intent adopts, so the load returns through already_loaded without touching the server. That safety is the earlier commit's doing, and it is why this cannot loop. No sendsGgufPath exclusion, unlike drafter_not_found. That one is guarded on `intent.gguf_path is None` because it drives a refetch; this re-check sits in the drafter comparison, guarded on `intent.gguf_path is not None or intent.compare_mtp_draft`, so a standalone .gguf load reaches it too. Frontend suite: 105 passed in resident-config-match.test.ts, and the whole studio/frontend suite shows the same 226 pre-existing failures as the merge base, zero new. * Keep an advanced-argument --model-draft when the detected sidecar is dropped The unloadable-drafter drop cleared the configured path whenever the detected sidecar could not load standalone, without first checking whether llama_extra_args already names its own --model-draft. Draft flags are last-wins, so the user's file is the one llama-server opens and the rejected sibling is never passed; dropping it anyway made the load read as drafterless and _build_speculative_flags emitted the ngram or default fallback before the extras were appended, so a valid override stopped running as MTP at all. Skip the drop when the extras own the draft path, matching the idiom the adjacent paravirtual drop already uses. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Tighten the comments added by this change Same code, fewer lines: collapse the multi-line explanations to their load-bearing sentence and drop the restatements. The measured llama-server behaviour behind the predicate is kept, since nothing in the tree records it otherwise. --------- Co-authored-by: danielhanchen <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Summary
mtp-*.ggufshipping neithertoken_embd.weightnor<arch>.nextn_shared_target_tensorscannot be opened as--model-draftand is dropped instead of aborting the launchWhy
#10181 fixed one half of #10169: a main GGUF reporting
<arch>.nextn_predict_layers > 0now takes no separate drafter. The reported repository publishes both halves, and the other half still fails.nextn_predict_layersmainRVN-Q6_K-mtp.ggufRVN-Q6_K.ggufmtp-RVN.gguftoken_embd.weight, no shared flagSelecting a plain quant, or one of its
-visionand-multilingualsiblings, still downloads the 1.69 GB sidecar and passes it as--model-draft. llama-server loads a draft model as a complete model, so it exits withtensor 'token_embd.weight' not found, and the spawn retry then drops speculative decoding for a load that had a working configuration available. Nothing onmaininspects the drafter file itself.What changed
_mtp_drafter_loads_standalonereads the drafter's header and reports whether it carries the embeddings a draft model needs, either its owntoken_embd.weightor<arch>.nextn_shared_target_tensorsto borrow the target's. Only that tensor is checked, because the rest of the required set is per-architecture:qwen4expcreates nooutput_normtensor at all, and the published Flash-Next head shipstoken_embdwithout one, so a stricter refusal would reject drafters that work. Split sets, whose first shard does not list every tensor, and unreadable headers fail open and leave the verdict to llama-server.The check sits in
load_modeldirectly after the embedded-head drop, which is before any sizing. Charged to the budget, a drafter that will not launch would move layers off the GPU for VRAM it never needs, and on a tighter budget cost the load its speculative decoding entirely.The dropped path goes into the existing suppression record. The sidecar stays on disk and the caller and route keep detecting it, so without that record the detected path never matches the launched
Noneand every repeat Apply reloads. For the same reason thedrafter_not_foundrefetch rule stands down for a suppressed drafter: the fetch did find the file, and refetching returns it again.DSpark and DFlash sidecars are untouched. They borrow
token_embdfrom the target by design and use their own--spec-type.One adjacent fix: the virtualised-Metal drop now records only the drafter it actually removed. It can fire on a drafter supplied through raw llama.cpp arguments with none of ours launched, where the unconditional assignment cleared the record made above.
Validation
python -m pytest studio/backend/tests/test_mtp_drafter_companion.py \ studio/backend/tests/test_llama_cpp_placement.py \ studio/backend/tests/test_mmproj_placement_policy.py \ studio/backend/tests/test_llama_cpp_mtp_detection.py \ studio/backend/tests/test_metal_paravirtual_guard.py -q995 passed. Tests cover the predicate against the four shapes repositories publish (bare head extract, a head with its own embeddings, a
-shared-head, one shard of a split set), the launch on a headless target with and without a usable drafter, the pricing order, the dedupe, and the suppression record the virtualised-Metal drop must preserve.Each was mutation-checked: reverting the drop branch, forcing the predicate true, removing the refetch clause, removing the suppression seed, or restoring the unconditional paravirtual assignment each fails exactly the test that covers it.
The headers in the table above were read directly from the reported repository over HTTP range requests rather than inferred.
Before and after in the UI (added during review)
Two isolated Studio installs, one built from this PR's merge base
14a2545beand one from head00eecb7a2, each home SHA-stamped so neither side can serve a stale bundle. The fixture is a local folder holding two real GGUFs written with the shipped writer: a 2.54 GiBgemma-4-12b-it-Q4_K_M.ggufand a 1.66 GiB head-onlymtp-gemma-4-12b-it.ggufcarrying neithertoken_embd.weightnor<arch>.nextn_shared_target_tensors. The same directory is handed to both sides by path, so both halves price identical bytes. Model picker, Run settings, Estimated Memory Usage:The panel charged the sidecar's 1.66 GiB and reserved a 30 GiB draft KV cache for it, so the estimate was 31.66 GiB above what the load actually asks for. That is the figure the chat-load admission guard reads, which is how this reached a 409 against a running training job.
POST /api/inference/estimate-memoryatn_ctx8192 moves with it,weights_bytes4.199 GB to 2.539 GB; the panel's own figures are larger because it prices Auto, which resolves to the model's native 131,072 tokens across 4 slots.