Skip to content

Studio: keep one GGUF row per build in repos whose model name contains NVFP4 - #14733

Merged
danielhanchen merged 5 commits into
mainfrom
gguf-nvfp4-model-name-variants
Oct 25, 2026
Merged

danielhanchen merged 5 commits into
mainfrom
gguf-nvfp4-model-name-variants

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Problem

#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 #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 #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 #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 (Studio: list every GGUF build that shares a quant in a custom folder #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 (Studio: list every GGUF build that shares a quant in a custom folder #13957) it named the first build, so that saved selection has to be picked again. Keys saved before Studio: support NVIDIA Nemotron 3.5 Bolt and Super GGUFs #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.

Picker rows before and after

…s NVFP4

NVFP4 became a quant token matched anywhere in a GGUF name, so in community
repos named like Qwen3.8-27B-NVFP4-MTP-GGUF every file got the variant key
NVFP4 and the picker kept one row. NVFP now names the quant only last in the
name (bpw modifier, shard suffix and extension aside), where llama.cpp naming
puts the type; earlier it is part of the model name and those files keep the
keys they had before NVFP was a token. Applied to every copy of the quant
regex (hub, variant service, llama_cpp, model_config, model-identity.ts).
MXFP is unchanged.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T06:40:23.116297Z f15604e Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 4e3565e125

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

The model picker contract test reads _GGUF_KNOWN_QUANT_RE, _GGUF_QUANT_RE and
QUANT_TOKEN_SOURCE as literal patterns to keep the frontend backfill in sync
with the backend. Concatenating a _NVFP_AT_NAME_END constant broke that parse.
Spell the lookahead inline (with [.] so the TS and Python literals are
byte-identical) in every copy.

[skip ci]
@danielhanchen danielhanchen self-assigned this Oct 25, 2026
…ead to the shared gguf_names regex

[skip ci]
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: f15604e747

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

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 25, 2026
@danielhanchen
danielhanchen merged commit 9d45fad into main Oct 25, 2026
22 of 54 checks passed
@danielhanchen
danielhanchen deleted the gguf-nvfp4-model-name-variants branch October 25, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant