Repository navigation
Studio: keep unrunnable speech GGUFs out of the model pickers - #9433
Conversation
llama.cpp cannot load llama-csm at all, so treating speech as a loadable media answer let it win _gguf_folder_task the moment it sorted first, hiding a runnable denoiser sharing the folder. Rank it with the unsupported diffusion archs instead, which keeps a speech-only folder tagged as speech. Apply the same gate to the filesystem rows: a CSM file found in LM Studio, ./models or a scan folder is just as undecodable, and isLocalCheckpoint let it route to Audio regardless of format. Co-Authored-By: Claude Opus 5 <[email protected]>
The gate these rows pass through re-infers the family from the id, so a CSM file stored as /models/orpheus/custom.gguf matched "orpheus", never saw "csm", and was listed as routable -- the pick then evicted the chat model and only then reported the row unsupported. The name is the weaker evidence here. _local_model_task and _repo_gguf_task both task a GGUF by reading its architecture, and _arch_to_task returns text-to-speech only for llama-csm (_SPEECH_GGUF_ARCHS), the one arch llama.cpp has no decoder for. So on an inventory row `isGguf && task === "text-to-speech"` already means undecodable, whatever the file is called. taskFromGgufArch marks the rows whose task came from that read, and outranks the curated name match as well: a curated id echoed by a folder name says nothing about the bytes. Orpheus GGUFs report a plain `llama` arch and arrive tagged text-generation, so they are untouched. Applied to the cached-GGUF list too, which is tasked the same way and had the same hole.
…apping by position
…mplete A read that raised was skipped and an unreadable header answers None, and neither cleared complete. So a folder holding a readable csm quant beside a sibling it could not classify answered text-to-speech with full confidence, and the arch-task gate then hid the row that unread sibling was on. Third way into the same failure, after the walk deadline and the candidate cap. The scan saw the file, it just never learned what it was, which is the same standing as a file the walk never reached.
|
Codex Review: Didn't find any major issues. Swish! 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f729531e7
ℹ️ 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".
| !localAudioRowIsUndecodableGguf({ | ||
| audioType: m.audioType, | ||
| exportType: m.exportType, | ||
| isDirectGguf: m.isDirectGguf, |
There was a problem hiding this comment.
Honor
isGguf when filtering local CSM rows
When loraModels includes rows produced by chatLocalModelOptions, LM Studio, models-dir, and custom .gguf files carry isGguf: true but normally leave isDirectGguf unset and have no exportType or audioType. Passing only isDirectGguf therefore makes localAudioRowIsUndecodableGguf treat these entries as non-GGUF, so the dedicated filesystem lists hide the CSM row but its duplicate remains selectable in the Fine-tuned section and still reaches the load-time refusal. Include m.isGguf in this format decision, or preserve the backend task/audio classification on these local options.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The premise holds: loraModels really is [...fromLoras, ...localModels], and local-model-options.ts sets isGguf for ollama or a .gguf path while setting neither exportType nor audioType.
Rejecting because of what follows from that. localAudioRowIsUndecodableGguf is isGguf && audioType === 'csm', and those rows carry no audioType either, so passing m.isGguf flips the first conjunct and the second still fails. That remedy would read as a fix and change nothing, so it is not one worth shipping.
The residual defect also fails safe. Such a row cannot route to Audio, since audioPipelineTagFor returns undefined without an audioType, so the pick takes the ordinary chat load path where non_chat_gguf_refusal_for_intent raises 400 before acquire_for(CHAT). For a local .gguf that is a local header read, so no Hub call and no download, and the in-load backstop fires before Phase 1 teardown as well. Nothing is evicted, nothing is fetched, and the message names the fix. The cost is one toast.
Your second remedy is the real one and it is feasible: LocalModelInfo already carries task, populated through _local_model_task and _arch_to_task, which returns the speech task for a csm arch. But plumbing it means a new field on a shared option type plus a signature change to the policy predicate and its four call sites. That is disproportionate to a toast inside a review round, so it goes with the variant-expander item as a follow-up rather than here.
Also amending the stale comment above that filter, which says audioType is read off the checkpoint so the gate holds regardless of path. True for training and exported rows, not for the local rows now mixed into the same list, which is the confusion behind this item.
The comment claimed audioType comes off the checkpoint so the gate holds for any row whatever its path says. True for exported rows, and false for the local rows this same list carries: chatLocalModelOptions sets neither audioType nor exportType, so a local CSM quant stays listed and is refused at load instead. Comment only. Catching those here needs the backend task plumbed onto the local options rather than another format signal, which is a follow-up.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5488569358
ℹ️ 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".
| # cap, or a read budget that ran out after the csm quant sorted first would otherwise hide the | ||
| # runnable sibling it never got to. Every other verdict is safe to give on a partial read: the | ||
| # worst case is a row filed on the wrong page, not one the user cannot find at all. | ||
| return unsupported or fallback or (speech if complete else None) |
There was a problem hiding this comment.
Filter speech variants from mixed GGUF bundles
When a cached repo contains both a runnable chat GGUF and a llama-csm GGUF, this fallback classifies the whole repo as text generation so it remains in the chat picker, but /gguf-variants still returns every entry from response.variants without architecture filtering (routes/models.py:3656-3675). Expanding that row therefore continues to offer the speech checkpoint and selecting it only reaches the new load-time refusal. Preserve the runnable parent row, but exclude the individually identified speech variants from its variant list.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is the variant-expander leak, which is a correct observation and is already tracked as a follow-up rather than part of this PR. It came up twice earlier in this review and the reasoning has not changed.
The row-level gate and the variant list are separate surfaces. This PR closes the row level, and closing the variant level means adding a per-file verdict to GgufVariantDetail, populating it in list_local_gguf_variants, which today reads no architecture at all, and giving normalizeGgufVariantsResponse something to filter on. That is a new nullable field on a public API response plus the frontend plumbing to match, and it cannot express 'unanswered' for a remote listing without further design.
Filtering inside list_local_gguf_variants instead is not a shortcut: the same list drives the delete and update rows, so hiding entries there silently breaks those.
It also fails safe today. non_chat_gguf_refusal_for_intent resolves the exact picked quant through _resolve_variant_gguf_files and refuses per file before llama-server launches and before anything is evicted or downloaded, so selecting the speech child costs an error toast that names the Transformers build to use instead.
Adding a public API contract to someone else's PR at review time is the wrong move, so it stays a follow-up.
The size pairing and the speech verdict both range-read the first 256 KiB of the same file, and /images/download-plan runs them back to back on every hub pick. The `or` only skips the second when the first refuses, so the ordinary case -- a flux.2 GGUF that pairs correctly -- spent two requests, each carrying its own 15s bound, on a picker the user is sitting in front of. They share one read now, keyed and aged like the speech memo beside it so no new staleness is introduced. The revalidation paths deliberately keep reading directly: re-reading a republished header is their entire purpose, and answering them from the memo would hand them the bytes they exist to get past.
|
Codex Review: Didn't find any major issues. Keep them coming! 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". |
Before / afterThe surface is the composer's On Device list off Before, the sesame row sits under OTHER MODELS and can be picked. After, it is gone and the Qwen3 row is untouched.
|
Reaching the shared speech verdict through utils.models.gguf_metadata runs utils.models.__init__, which imports model_config, which imports yaml. That made PyYAML a hard import dependency of core.inference.llama_cpp, and the repo's own Source lint job went red on it: tests/studio/load_freeze/ test_load_orchestrator.py imports the backend and that runner does not ship PyYAML. The constants move to utils/gguf_archs.py, a leaf module with no package baggage, and gguf_metadata re-exports them, so every existing caller keeps its import and there is still exactly one definition. The test asserts the identity rather than equality, and runs the import in a subprocess with yaml blocked, since this session has already imported it.
Follow-up to the PyYAML fix. Re-exporting the two names from utils.models.gguf_metadata kept the old import paths working, but scripts/verify_import_hoist.py blocks a re-export outside a package __init__ (HOISTED-IMPORT-UNUSED), and the repo's Source lint job is right to: leaving them reachable through utils.models means the next importer reintroduces exactly the chain the fix removed. The three callers now import from utils.gguf_archs directly, and the test asserts the names are NOT reachable through the package.

Some text-to-speech GGUFs declare architectures llama.cpp doesn't implement. Nothing in Studio can load them not chat, and not the Audio page, which runs those families through Transformers rather than llama.cpp. They were still being offered as chat models: after download, the cached-GGUF listing tagged the unknown architecture text-generation, so the model showed up in the picker, downloaded and launched, and died in llama-server with "this model type cannot be run… try a different model." Picking the same model from Hub search was already blocked by its text-to-speech tag.
Since no engine here can load the file, the row is now hidden rather than routed somewhere the same thing already done for image architectures the Images backend can't assemble. Image and video GGUFs keep their current behaviour of staying listed and routing to their page on click, because those actually run.