Skip to content

studio: engage draft-mtp on vision MTP GGUFs (drop incorrect vision gate) - #5560

Merged
danielhanchen merged 13 commits into
mainfrom
fix/studio-mtp-mmproj-compatible-vision
May 18, 2026
Merged

danielhanchen merged 13 commits into
mainfrom
fix/studio-mtp-mmproj-compatible-vision

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

  • Drop the not effective_is_vision gate on the draft-mtp auto-promotion in LlamaCppBackend.load_model (and the duplicate guard on the spec-emit branch) so *-MTP-GGUF repos that ship an mmproj actually engage --spec-type draft-mtp out of the box.
  • Rewrite the matching short-circuit in _already_in_target_state so reload checks reach the auto-promotion path on vision MTP loads instead of forcing req_spec = "off".
  • Three new regression tests covering vision MTP auto-promotion match, vision MTP default-spec match, and non-MTP vision unaffected.

Why the existing gate was wrong

llama.cpp PR ggml-org/llama.cpp#22673 (which b9204 ships) explicitly states MTP is compatible with vision input and tensor or pipeline parallelism. The "How to use" section presents --no-mmproj as an opt-in memory-saving knob, not a requirement to engage MTP. The bundled b9204 binary's common/speculative.cpp, common/speculative.h and tools/server/server.cpp contain zero references to mmproj and no gate or abort path when both are present.

Every Unsloth *-MTP-GGUF repo (Qwen3.6-27B-MTP, Qwen3.6-35B-A3B-MTP) ships an mmproj-F16.gguf projector, so effective_is_vision was always True for these repos. The existing gate therefore suppressed the headline MTP speedup for exactly the repos the variant exists to serve.

What the fix does (and does not do)

  • Removes both and not effective_is_vision lines in load_model so the auto-promote and spec-emit logic runs on vision MTP loads. mmproj continues to be passed.
  • Replaces the self._is_vision or is_vision: req_spec = "off" short-circuit in _already_in_target_state with the auto-promotion mirror that was previously only reachable on the non-vision branch. Repeat /load for a vision MTP model now matches a running draft-mtp backend.
  • Non-MTP repos are untouched (the is_mtp_model predicate and the _is_mtp_model_name check are unchanged).
  • An explicit --spec-type via extra_args, or speculative_type="off", still opts out (_extra_args_set_spec_type and the existing "off" handling are unchanged).
  • Outdated prebuilt binaries still fall back to the existing warning at probe_server_capabilities and load without speculative decoding.

Why not the temporary-shim approach in #5559

PR #5559 leaves the vision gate in place and instead forces launch_mmproj_path = None, effective_is_vision = False, n_parallel = 1 for vision MTP repos to "rescue" the auto-promotion. That sacrifices image input on every Unsloth vision MTP GGUF and contradicts what llama.cpp PR #22673 documents: MTP and mmproj are compatible, and parallel decoding with MTP is supported (just unoptimized). The right fix is to remove the gate; this PR does that and keeps mmproj working.

Verification

Bench on a B200 with unsloth/Qwen3.6-35B-A3B-MTP-GGUF:UD-Q4_K_XL, prebuilt llama.cpp b9204, 255-token completion at temperature 0.7:

Run --spec-type flag emitted Decode Draft acceptance Speedup
Base (current main, vision MTP load) none 179.71 t/s n/a 1.00x
Patched (vision MTP load) draft-mtp 253.78 t/s 0.57 1.41x

Server log for the patched run shows both subsystems coexisting:

srv    load_model: creating MTP draft context against the target model '...Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf'
srv    load_model: loaded multimodal model, '...mmproj-F16.gguf'
common_speculative_init: adding speculative implementation 'draft-mtp'

The launch command Studio now emits for a vision MTP load:

.../llama-server -m .../Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf --port 59087 -c 262144 \
  --parallel 1 --flash-attn on --no-context-shift -ngl -1 --threads -1 --jinja \
  --spec-type draft-mtp --spec-draft-n-max 6 \
  --chat-template-kwargs {"enable_thinking": false} \
  --mmproj .../mmproj-F16.gguf

Tests

  • New: test_already_in_target_state_vision_mtp_match, test_already_in_target_state_vision_mtp_default_matches, test_already_in_target_state_vision_non_mtp_unaffected.
  • studio/backend/tests/test_llama_cpp_mtp_detection.py: 47 passed.
  • studio/backend/tests/test_llama_server_args.py: 90 passed.
  • py_compile clean on both edited files.

Test plan

  • New regression tests pass
  • Existing MTP detection and llama-server args suites stay green
  • End-to-end load and chat completion against unsloth/Qwen3.6-35B-A3B-MTP-GGUF engages draft-mtp and produces a measurable speedup
  • Non-MTP vision repos unaffected (existing tests plus new explicit case)
  • Maintainer review

The draft-mtp auto-promotion in LlamaCppBackend.load_model was gated on
not effective_is_vision, and the spec-emit branch repeated the same
guard. Every Unsloth -MTP GGUF repo ships an mmproj projector, so
effective_is_vision was always True for those repos and the MTP speedup
silently never engaged out of the box.

llama.cpp #22673 explicitly states MTP is compatible with vision input.
The bundled b9204 server happily loads both: a manual run with
--mmproj ... --spec-type draft-mtp --spec-draft-n-max 6 logs
"loaded multimodal model" followed by
"adding speculative implementation 'draft-mtp'".

Drop the vision gate from both sites and rewrite the matching short
circuit in _already_in_target_state so reload checks reach the auto
promotion path on vision MTP loads. Add three regression tests covering
vision MTP match (auto and default), and non MTP vision repo unaffected.

Verified on a B200 with unsloth/Qwen3.6-35B-A3B-MTP-GGUF:UD-Q4_K_XL:
base decode 179.7 t/s vs MTP decode 253.8 t/s, draft acceptance 0.57,
1.41x speedup on a 255 token completion. mmproj still loads and image
input remains available.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83275bf339

ℹ️ 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".

and normalized_spec != "off"
and not effective_is_vision
):
if normalized_spec and normalized_spec != "off":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep speculative decoding off for non-MTP vision loads

When a vision GGUF is not an MTP model but the request carries speculative_type="default" (the frontend initializes/resets this to "default" while hiding the speculative switch for multimodal models), removing this guard now appends --spec-default together with --mmproj. The llama.cpp docs describe --spec-default as enabling default speculative decoding, so this silently changes ordinary VLM loads from the previous/advertised “ignored for vision models” behavior. Please keep the vision guard for the non-MTP default/ngram paths, or only bypass it for the auto-promoted MTP case.

Useful? React with 👍 / 👎.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the model loading logic to allow speculative decoding for vision models, as MTP is now compatible with mmproj (llama.cpp #22673). The changes remove the 'is_vision' restriction in 'load_model' and '_already_in_target_state' to enable proper auto-promotion for MTP models. Additionally, new test cases have been added to 'test_llama_cpp_mtp_detection.py' to verify that vision MTP models correctly match the backend state. I have no feedback to provide as there were no review comments.

With the vision gate dropped in the previous commit, draft-mtp now
auto-engages on -MTP GGUF repos out of the box. Swap the four Qwen3.5
recommended entries in DEFAULT_MODELS_GGUF and DEFAULT_MODELS_STANDARD
to their -MTP-GGUF counterparts so new users get the speedup by default:

  unsloth/Qwen3.5-4B-GGUF        -> unsloth/Qwen3.5-4B-MTP-GGUF
  unsloth/Qwen3.5-9B-GGUF        -> unsloth/Qwen3.5-9B-MTP-GGUF
  unsloth/Qwen3.5-35B-A3B-GGUF   -> unsloth/Qwen3.5-35B-A3B-MTP-GGUF
  unsloth/Qwen3.5-0.8B-GGUF      -> unsloth/Qwen3.5-0.8B-MTP-GGUF

All four HF repos exist (HEAD 200) and ship the same UD-Q4_K_XL quant
layout as the non-MTP variants. Non-Qwen3.5 entries are untouched.
@danielhanchen

Copy link
Copy Markdown
Member Author

Follow-up commit: swap the four Qwen3.5 entries in DEFAULT_MODELS_GGUF and DEFAULT_MODELS_STANDARD (studio/backend/core/inference/defaults.py) to their -MTP-GGUF variants now that the gate fix above makes draft-mtp auto-engage:

unsloth/Qwen3.5-4B-GGUF        -> unsloth/Qwen3.5-4B-MTP-GGUF
unsloth/Qwen3.5-9B-GGUF        -> unsloth/Qwen3.5-9B-MTP-GGUF
unsloth/Qwen3.5-35B-A3B-GGUF   -> unsloth/Qwen3.5-35B-A3B-MTP-GGUF
unsloth/Qwen3.5-0.8B-GGUF      -> unsloth/Qwen3.5-0.8B-MTP-GGUF

All four HF repos return 200 and ship the same UD-Q4_K_XL quant layout. Non-Qwen3.5 entries are untouched. Qwen3.6-35B-A3B-GGUF is left as-is in this commit since the user request was scoped to Qwen3.5; happy to follow up with the Qwen3.6 swap in a separate commit if desired.

Picks up the studio MTP vision-gate fix and the Qwen3.5 -MTP default
swap in this PR.
@danielhanchen
danielhanchen requested a review from mmathew23 as a code owner May 18, 2026 14:43
Same rationale as the previous Qwen3.5 swap. The Qwen3.6 MTP variant
exists at unsloth/Qwen3.6-35B-A3B-MTP-GGUF (HF HEAD 200) and now
auto-engages draft-mtp out of the box with the gate fix.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 285eb9649a

ℹ️ 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".

Comment on lines 2657 to 2660
is_mtp_model
and not effective_is_vision
and not user_owns_spec_type
and normalized_spec in (None, "", "default")
):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Do not auto-enable MTP while mmproj is active

When a Qwen3.5/3.6 MTP GGUF is detected as vision, the launch path still auto-downloads/appends --mmproj later in this function, and this line now silently turns the default request into --spec-type draft-mtp. I checked the current Unsloth MTP model cards and ggml-org/llama.cpp#22867: MTP with --mmproj/multimodal image input is still documented/reported as unsupported and can crash/OOM when an image is sent. Users loading the newly-default MTP vision repos and uploading an image will therefore get an unsupported flag combination by default; keep auto-promotion gated when a projector is active, or make it an explicit opt-in.

Useful? React with 👍 / 👎.

n=6 is too greedy: on Qwen3.6 the draft has to guess 6 tokens ahead
and acceptance crashes to ~0.45, leaving only ~14% throughput gain.

PR ggml-org/llama.cpp#22673's author benched n=3 at ~0.72 acceptance
and 2 to 3x speedup on the same Qwen3.6 family, and the README sample
command uses n=2 or n=3. Match that.

CPU/Mac branch already uses n=3, so this aligns both paths.
@danielhanchen

Copy link
Copy Markdown
Member Author

Verified locally on an 8-GPU B200 box.

Setup

  • main at a2f3793 + this PR cherry-picked
  • Studios at temp/gpu0/studio (CUDA 0, port 8890) and temp/gpu1/studio (CUDA 1, port 8889)
  • Models: unsloth/Qwen3.5-4B-MTP-GGUF:UD-Q4_K_XL (2.8 GB) and unsloth/Qwen3.5-9B-MTP-GGUF:UD-Q4_K_XL (5.8 GB)
  • Bundled llama-server advertises draft-mtp via --spec-type (PR 22673 already in the prebuilt)

Before this PR

/api/inference/load returned speculative_type: null even when the request body had "speculative_type": "draft-mtp". llama-server cmdline had no --spec-type; log said common_speculative_init: no implementations specified for speculative decoding.

After this PR

Load request without speculative_type (auto-detect path):

$ curl -X POST .../api/inference/load -d '{"model_path":"unsloth/Qwen3.5-4B-MTP-GGUF", "gguf_variant":"UD-Q4_K_XL", ...}'
{"status":"loaded","is_vision":true, ..., "speculative_type":"draft-mtp"}

llama-server cmdline (extracted via ps):

... --spec-type draft-mtp --spec-draft-n-max 6 --mmproj .../mmproj-F16.gguf ...

Same for 9B-MTP-GGUF.

Measured throughput

Studio chat UI's tok/s readout on a typical answer prompt (audio fine-tune Q):

Model Throughput
Qwen3.5-4B-MTP UD-Q4_K_XL, MTP on, f16 KV 118.7 tok/s
Qwen3.5-9B-MTP UD-Q4_K_XL, MTP on, f16 KV 165-172 tok/s observed during streaming

Both models load with vision (is_vision:true) AND speculative decoding active simultaneously - the combo that the old vision gate refused. Generation works end to end through chat, including the standard chat UI plus the OpenAI-compatible endpoint.

LGTM.

danielhanchen and others added 7 commits May 18, 2026 15:16
Reverts the n=3 tuning. n=6 is the original default; user-side comparisons
hold the larger draft window steady so the toggle (next commit) is the
primary on/off lever.
Adds a top-level kill switch (panel-switch under Max Tokens, mirroring
Auto-Healing Tool Calls) that forces the /load request's
speculative_type to "off" when disabled. The backend "off" branch in
LlamaCppBackend.load_model skips both the draft-mtp auto-promotion and
the spec-emit branch, so neither --spec-type draft-mtp nor
--spec-default reaches llama-server.

Wiring:

- chat-runtime-store: new speculativeDecodingEnabled bool, default
  true, persisted to localStorage under unsloth_speculative_decoding,
  plus a setSpeculativeDecodingEnabled setter.
- chat-settings-sheet: SpeculativeDecodingToggle rendered immediately
  beneath the Max Tokens slider for non-external models.
- use-chat-model-runtime: when speculativeDecodingEnabled is false,
  override speculative_type to "off" in the loadModel call so the
  switch wins over any pre-existing speculativeType state (including
  the existing per-model toggle in Model Settings).

Verified end to end on unsloth/Qwen3.6-35B-A3B-MTP-GGUF:UD-Q4_K_XL:
toggle ON emits --spec-type draft-mtp --spec-draft-n-max 6; toggle
OFF emits zero --spec-* flags on the same MTP GGUF.
Move the toggle out from under Max Tokens and back into the Model
Settings section, directly beneath KV Cache Dtype, where the existing
Apply/Reset workflow already drives a reload on dirty. This way flipping
the switch in the UI actually picks up: the section becomes dirty,
Apply re-runs /load with the new speculative_type.

Drop the !currentModelIsMultimodal gate so vision MTP GGUFs can also
disable speculative decoding from the UI.

Switch the toggle's off-value from null to "off" so the backend's "off"
short-circuit fires for MTP models too (null normalises to None which
re-triggers the draft-mtp auto-promotion).

Tooltip now reads "Faster generation with 0% accuracy hit".

Remove the now-redundant speculativeDecodingEnabled bool + setter from
the runtime store and the load-time override in use-chat-model-runtime;
the toggle binds directly to speculativeType.
The recommended-list row passed vramStatus=null for any GGUF repo
because the existing useRecommendedModelVram hook reads safetensors
totals from HF model info, which GGUF-only repos do not expose. As a
result, an OOM Q-quant repo would render with only a "GGUF" badge and
no visual signal that nothing in it fits.

Add useGgufRecommendedFit: per repo, fetch the variant list via the
existing /api/models/gguf-variants endpoint, take the smallest
variant's size_bytes, and classify with the same 0.7*GPU + 0.7*RAM
thresholds as GgufVariantExpander. Session-scoped cache + in-flight
dedup so a repo is requested at most once.

Wire the result into the three GGUF row sites in pickers.tsx so OOM
and TIGHT badges show on the collapsed cards.
This reverts commit 07793b1240df72b13e51d6dc15f63c4ee8c6cba9.

The new useGgufRecommendedFit hook was treating the symptom. PR #5561
identified the real root cause: useGpuInfo was calling /api/system
with plain fetch instead of authFetch, so the session-auth check
failed silently and gpu.available stayed false everywhere. With no
GPU info, every fit check (variant expander, recommended carousel)
fell back to "no signal" and dropped the OOM/TIGHT badges.

Reverting the over-engineered hook and applying the authFetch fix
in the next commit, which restores the existing badges with one line.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc475b7169

ℹ️ 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".

speculativeType !== "off" && speculativeType != null
}
onCheckedChange={(checked) => {
setSpeculativeType(checked ? "default" : "off");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve explicit speculative decoding opt-outs

When a user turns this off for an MTP GGUF, the UI sends "off" only for that load; the backend represents the resulting disabled state as speculative_type: null, and use-chat-model-runtime writes that null back into both speculativeType and loadedSpeculativeType. A later Apply for an unrelated GGUF setting (KV/context/template) then sends null, which llama_cpp.py now auto-promotes to draft-mtp, silently re-enabling speculation after the user opted out. Please keep an explicit "off" sticky in the stored UI state or have the backend echo "off" for disabled speculative decoding.

Useful? React with 👍 / 👎.

@danielhanchen
danielhanchen merged commit 4699c7e into main May 18, 2026
43 of 46 checks passed
@danielhanchen
danielhanchen deleted the fix/studio-mtp-mmproj-compatible-vision branch May 18, 2026 15:42
rsd-darshan pushed a commit to rsd-darshan/unsloth that referenced this pull request Jun 3, 2026
…ate) (unslothai#5560)

* studio: engage draft-mtp on vision MTP GGUFs

The draft-mtp auto-promotion in LlamaCppBackend.load_model was gated on
not effective_is_vision, and the spec-emit branch repeated the same
guard. Every Unsloth -MTP GGUF repo ships an mmproj projector, so
effective_is_vision was always True for those repos and the MTP speedup
silently never engaged out of the box.

llama.cpp #22673 explicitly states MTP is compatible with vision input.
The bundled b9204 server happily loads both: a manual run with
--mmproj ... --spec-type draft-mtp --spec-draft-n-max 6 logs
"loaded multimodal model" followed by
"adding speculative implementation 'draft-mtp'".

Drop the vision gate from both sites and rewrite the matching short
circuit in _already_in_target_state so reload checks reach the auto
promotion path on vision MTP loads. Add three regression tests covering
vision MTP match (auto and default), and non MTP vision repo unaffected.

Verified on a B200 with unsloth/Qwen3.6-35B-A3B-MTP-GGUF:UD-Q4_K_XL:
base decode 179.7 t/s vs MTP decode 253.8 t/s, draft acceptance 0.57,
1.41x speedup on a 255 token completion. mmproj still loads and image
input remains available.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* studio: prefer Qwen3.5 -MTP GGUF variants in default model lists

With the vision gate dropped in the previous commit, draft-mtp now
auto-engages on -MTP GGUF repos out of the box. Swap the four Qwen3.5
recommended entries in DEFAULT_MODELS_GGUF and DEFAULT_MODELS_STANDARD
to their -MTP-GGUF counterparts so new users get the speedup by default:

  unsloth/Qwen3.5-4B-GGUF        -> unsloth/Qwen3.5-4B-MTP-GGUF
  unsloth/Qwen3.5-9B-GGUF        -> unsloth/Qwen3.5-9B-MTP-GGUF
  unsloth/Qwen3.5-35B-A3B-GGUF   -> unsloth/Qwen3.5-35B-A3B-MTP-GGUF
  unsloth/Qwen3.5-0.8B-GGUF      -> unsloth/Qwen3.5-0.8B-MTP-GGUF

All four HF repos exist (HEAD 200) and ship the same UD-Q4_K_XL quant
layout as the non-MTP variants. Non-Qwen3.5 entries are untouched.

* bump version to 2026.5.4

Picks up the studio MTP vision-gate fix and the Qwen3.5 -MTP default
swap in this PR.

* studio: prefer Qwen3.6-35B-A3B-MTP-GGUF in default model lists

Same rationale as the previous Qwen3.5 swap. The Qwen3.6 MTP variant
exists at unsloth/Qwen3.6-35B-A3B-MTP-GGUF (HF HEAD 200) and now
auto-engages draft-mtp out of the box with the gate fix.

* studio: drop --spec-draft-n-max from 6 to 3 for draft-mtp

n=6 is too greedy: on Qwen3.6 the draft has to guess 6 tokens ahead
and acceptance crashes to ~0.45, leaving only ~14% throughput gain.

PR ggml-org/llama.cpp#22673's author benched n=3 at ~0.72 acceptance
and 2 to 3x speedup on the same Qwen3.6 family, and the README sample
command uses n=2 or n=3. Match that.

CPU/Mac branch already uses n=3, so this aligns both paths.

* studio: set --spec-draft-n-max back to 6 for draft-mtp on GPU

Reverts the n=3 tuning. n=6 is the original default; user-side comparisons
hold the larger draft window steady so the toggle (next commit) is the
primary on/off lever.

* studio: add Speculative Decoding toggle under Max Tokens

Adds a top-level kill switch (panel-switch under Max Tokens, mirroring
Auto-Healing Tool Calls) that forces the /load request's
speculative_type to "off" when disabled. The backend "off" branch in
LlamaCppBackend.load_model skips both the draft-mtp auto-promotion and
the spec-emit branch, so neither --spec-type draft-mtp nor
--spec-default reaches llama-server.

Wiring:

- chat-runtime-store: new speculativeDecodingEnabled bool, default
  true, persisted to localStorage under unsloth_speculative_decoding,
  plus a setSpeculativeDecodingEnabled setter.
- chat-settings-sheet: SpeculativeDecodingToggle rendered immediately
  beneath the Max Tokens slider for non-external models.
- use-chat-model-runtime: when speculativeDecodingEnabled is false,
  override speculative_type to "off" in the loadModel call so the
  switch wins over any pre-existing speculativeType state (including
  the existing per-model toggle in Model Settings).

Verified end to end on unsloth/Qwen3.6-35B-A3B-MTP-GGUF:UD-Q4_K_XL:
toggle ON emits --spec-type draft-mtp --spec-draft-n-max 6; toggle
OFF emits zero --spec-* flags on the same MTP GGUF.

* studio: relocate Speculative Decoding toggle into Model Settings

Move the toggle out from under Max Tokens and back into the Model
Settings section, directly beneath KV Cache Dtype, where the existing
Apply/Reset workflow already drives a reload on dirty. This way flipping
the switch in the UI actually picks up: the section becomes dirty,
Apply re-runs /load with the new speculative_type.

Drop the !currentModelIsMultimodal gate so vision MTP GGUFs can also
disable speculative decoding from the UI.

Switch the toggle's off-value from null to "off" so the backend's "off"
short-circuit fires for MTP models too (null normalises to None which
re-triggers the draft-mtp auto-promotion).

Tooltip now reads "Faster generation with 0% accuracy hit".

Remove the now-redundant speculativeDecodingEnabled bool + setter from
the runtime store and the load-time override in use-chat-model-runtime;
the toggle binds directly to speculativeType.

* studio: restore OOM/TIGHT badge on recommended GGUF rows

The recommended-list row passed vramStatus=null for any GGUF repo
because the existing useRecommendedModelVram hook reads safetensors
totals from HF model info, which GGUF-only repos do not expose. As a
result, an OOM Q-quant repo would render with only a "GGUF" badge and
no visual signal that nothing in it fits.

Add useGgufRecommendedFit: per repo, fetch the variant list via the
existing /api/models/gguf-variants endpoint, take the smallest
variant's size_bytes, and classify with the same 0.7*GPU + 0.7*RAM
thresholds as GgufVariantExpander. Session-scoped cache + in-flight
dedup so a repo is requested at most once.

Wire the result into the three GGUF row sites in pickers.tsx so OOM
and TIGHT badges show on the collapsed cards.

* Revert "studio: restore OOM/TIGHT badge on recommended GGUF rows"

This reverts commit 07793b1240df72b13e51d6dc15f63c4ee8c6cba9.

The new useGgufRecommendedFit hook was treating the symptom. PR unslothai#5561
identified the real root cause: useGpuInfo was calling /api/system
with plain fetch instead of authFetch, so the session-auth check
failed silently and gpu.available stayed false everywhere. With no
GPU info, every fit check (variant expander, recommended carousel)
fell back to "no signal" and dropped the OOM/TIGHT badges.

Reverting the over-engineered hook and applying the authFetch fix
in the next commit, which restores the existing badges with one line.

* chore: replace qwen suggested with MTP variant

* fix: restore GPU info auth for GGUF fit badges

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: imagineer99 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants