Repository navigation
Studio: list every GGUF build that shares a quant in a custom folder - #13957
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. |
|
I put together a small test-only commit that may be useful alongside this change. It adds one file, with no production changes. Two controls I'd keep with the grouping update:
All three focused tests passed against the unchanged pure grouping/key helpers from |
|
Reached Codex review convergence at oobabooga#381. |
# Conflicts: # studio/backend/utils/models/model_config.py
Review and repair evidenceTested head: Observed behavior
UI evidenceThe UI comparison uses the PR branch merge base above and behavior head Observed facts: Verification
Performance on 1,000 synthetic paths was 10.807 ms/call at the original PR head and 15.328 ms/call after the collision guard, an additional 4.521 ms in the filesystem listing path. |
…ion and access [skip ci]
… in the management API [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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: ffa788416f
ℹ️ 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".
| variants = [ | ||
| variant | ||
| for variant in variants | ||
| if getattr(variant, "filename", None) | ||
| and _split_set_is_loadable(Path(load_dir) / variant.filename) |
There was a problem hiding this comment.
Preserve withheld keys when every split build is torn
When a custom folder contains only incomplete split sets, this filtering removes every variant, after which _local_gguf_entry returns None and discards the withheld keys it just computed. If one build is still resident in llama.cpp while its files and every sibling become torn (for example, shard 2 is deleted after loading), the refreshed index then has no negative entry; _loaded_satisfies("local/model:beta-Q4_K_M") sees the matching base, finds neither a pin nor a withheld marker, and treats the non-quant-shaped suffix as satisfied, so resident alpha weights can serve a beta request. Keep a withheld-only index record, or otherwise retain these negative build keys, even when no build is currently loadable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not fixing: this needs shard files deleted under a loaded model until every build in the folder is torn; keeping an entry with no servable build would advertise an unloadable model.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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 |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
…uping Merge origin/main (e795149, 102 upstream commits) and combine both index features in _LocalGgufEntry: parked scan-folder copies stay listed as alternates beside an incomplete cache skeleton, and the resolver now also groups every GGUF build that shares a quant in a custom folder (unslothai#13957).
…s NVFP4 (unslothai#14733) ## Problem unslothai#13899 made `NVFP4` a quant token (`(?:MX|NV)FP[0-9]+`) so the Nemotron 3.5 Super `NVFP4/` folder resolves to its weights. The token is matched anywhere in the name, so in community repos whose model name contains `-NVFP4-` it became the first quant token of every file and every file got the variant key `NVFP4`. The picker keeps one row per key, so all but one build became unselectable, and `...-NVFP4-Experts-Only-Q8_0.gguf` was keyed `NVFP4` instead of `Q8_0`. Rows in the HF picker (real Hub listings): | Repo | Files | Before unslothai#13899 | main | This PR | |---|---|---|---|---| | esatapedico/Qwen3.8-27B-NVFP4-MTP-GGUF | 9 | 9 | 1 | 9 | | michaelw9999/Qwen3.6-35B-A3B-NVFP4-MTP-GGUF | 2 | 2 | 1 | 2 | | llmfan46/Qwen3.6-35B-A3B-uncensored-heretic-NVFP4-Experts-Only-GGUF | 2 | 2 | 1 | 2 | | utautako/Qwen3.8-27B-NVFP4-MTP-Q8attn-GGUF | 2 | 2 | 1 | 2 | | CompiledThoughts/Qwen3.8-Flash-Next-NVFP4-Q8_0 | 1 | 1 (`Q8_0`) | 1 (`NVFP4`) | 1 (`Q8_0`) | ## Change `NVFP` now names the quant only where llama.cpp naming puts the type: last in the name, with only a bpw modifier, a shard suffix or the extension after it (`Model-NVFP4.gguf`, `NVFP4/Model-NVFP4-00001-of-00003.gguf`, `Model-UD-NVFP4.gguf`, `Model-NVFP4_MOE.gguf`, a stored `NVFP4` key). An `NVFP` followed by more name parts is part of the model name, so those files get exactly the keys they had before unslothai#13899 (the stem, or `Q8_0` where a later token names the quant). The rule is a lookahead on the `NVFP` alternative, applied to every copy of the quant regex so the picker, download plans, size listing, load resolution and the frontend label agree: `utils/gguf_names.py` (`GGUF_QUANT_RE`, the shared pattern that `hub/utils/gguf.py`, `core/inference/llama_cpp.py` and `utils/models/model_config.py` now import), `_extract_quant_label` in `utils/models/model_config.py`, `hub/services/models/gguf_variants.py`, and `model-identity.ts`. `MXFP` is unchanged: it was a token before unslothai#13899 and still matches anywhere, so keys stored for MXFP repos (`MXFP4`, `MXFP4_MOE`, `...-MXFP4-BF16`) keep resolving. ## Tests - New `tests/test_gguf_nvfp4_model_name_variants.py` (49 tests): row counts and keys for the five listings above, each key resolving to exactly its own file in `_resolve_variant_gguf_files` and in `build_gguf_variant_plans`, all regex mirrors agreeing, plus unsloth-style names (`NVFP4/` shards, `-NVFP4.gguf`, `-MXFP4_MOE`, `UD-MXFP4_MOE`, bpw suffix) and NVFP4-suffixed drafters. On main 29 fail (the 20 unsloth-style and drafter cases pass on both); on this branch all 49 pass. - New `frontend/tests/gguf-nvfp4-quant-label.test.ts` (2 tests): 1 fails on main, both pass here. `model-identity.test.ts` and `audio-loaded-quant-key.test.ts` pass. - Related backend GGUF suites (variant rows, bpw rows, split builds, delete keeps sibling builds, local resolution, dependency keys, resolve quant, Nemotron 3.5, MTP drafter, imatrix, routing, preflight, offline cache, LTX-2.5, cached routes, companions, cache switch): 1238 passed, 12 failed, 2 skipped on this branch. The 12 failures are the same test ids on main (8 in `test_mtp_drafter_companion.py` need the `gguf` package, 2 in `test_cached_gguf_routes.py`, 2 in `test_video_ltx25_gguf.py`) and are unrelated. - `test_a_custom_folder_lists_every_build_at_one_quant` (unslothai#13957) used these Qwen3.8 NVFP4-MTP names as its shared-quant fixture and pinned the first build to the `NVFP4` key. It now uses names that end in `-NVFP4`, so it still covers a custom folder splitting builds at one NVFP4 quant, and passes on main and here; the real Qwen3.8 names in a custom folder are covered by a new test that lists each build under its own name. ## Not covered - Two different model stems that both end in `-NVFP4` in one HF repo still share the `NVFP4` row, the same as two stems at `Q4_K_M` today: remote and HF cache listings keep one key per quant by design, and only custom folders split such builds. - A key saved on main for one of the affected repos (`NVFP4`) no longer names a file there. For a Hub repo it was already ambiguous, since it picked one build out of all of them. For a custom folder (unslothai#13957) it named the first build, so that saved selection has to be picked again. Keys saved before unslothai#13899 load as they did then. - The frontend `chat-adapter.ts` regex never learned `NVFP` and is untouched. ## Before / after Model Hub picker for `esatapedico/Qwen3.8-27B-NVFP4-MTP-GGUF`, merge base `c9fab474c` vs head `47e9858b9`, two isolated Studio installs. Before: one `NVFP4` row (16 GB) for the nine builds. After: nine rows, one per build, each at its own size (ORIG 34 GB down to VERY-LOW 16 GB). The variants API agrees: 1 row -> 9 rows.  --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Fixes #13926.
Problem
#13899 taught the quant regex
NVFP4, so every file in the reporter's custom folder (Qwen3.8-27B-NVFP4-MTP-HIGHEST.gguf,-LOW,-MEDIUM,-MID-HIGH,-MID-HIGH_enru) now gets the keyNVFP4. The lister keeps one file per key, so the picker shows a singleNVFP4row that loads-HIGHEST, and the other four cannot be selected. Before #13899 each file was its own row. Differently named builds at standard quants in custom folders already collapsed the same way, for exampleLlama-3-8B-Instruct-Q4_K_M.ggufbesideLlama-3-8B-abliterated-Q4_K_M.gguf.Fix
Outside the HF cache,
list_local_gguf_variantsnow keys files withgguf_variant_keys_by_checkpoint, which deletion already uses to tell builds that share a quant apart.NVFP4 · Qwen3.8-27B-NVFP4-MTP-HIGHEST./gguf-variantsnow returns the chosen row's own key asdefault_variant, instead of deriving it again from the filename. Without this, a folder with a torna-Q4_K_M-00001-of-00002.ggufand a wholez-Q4_K_M.ggufwould default toQ4_K_M, the torn build.HF cache snapshots still list one build per quant (#13327), because their keys must match the remote listing and are stored in download manifests and pins.
gguf_variant_keyis unchanged.Verification
Studio before and after the change, with a custom folder holding the issue's five filenames (copies of a small real GGUF):
NVFP4rowNVFP4 · <build>rows, all "downloaded"-HIGHESTreachableThe new tests fail on main and pass with the change. Five existing tests for HF snapshots now build their snapshot under an HF cache path instead of a plain temp directory; their assertions are unchanged. Across 108 GGUF-related backend test files, 8877 passed. One timing test unrelated to GGUF listing failed (
test_tunnel_safe_long_post.py), and it passes when its file runs alone.Before / after
A custom LM Studio-style folder holding five copies of a small GGUF under the issue's filenames (
Qwen3.8-27B-NVFP4-MTP-HIGHEST/LOW/MEDIUM/MID-HIGH/MID-HIGH_enru.gguf), Studio built at the merge base and at this branch. The quant menu goes from oneNVFP4row to fiveNVFP4 · Qwen3.8-27B-NVFP4-MTP-<build>rows (the menu truncates the build name;/api/models/gguf-variantsreturns the full labels). Loading each listed key started llama-server on that key's own file; before, only-HIGHESTwas reachable.