Repository navigation
common : fix -hf tag matching inside longer quant names - #31620
Merged
Merged
Conversation
":F16" picked a BF16 file when the repo had both, since "BF16" contains "F16". The same applied to ":Q4_XS" vs "IQ4_XS". The tag now has to start at a token boundary in the path. Assisted-by: dsh:llama.cpp/ggml-org/GLM-5.3-Flash-GGUF (Mac Studio, M5 Ultra, 256GB)
ServeurpersoCom
approved these changes
Nov 3, 2026
ServeurpersoCom
left a comment
Contributor
There was a problem hiding this comment.
LGTM, and good to see the real listings harness bite: 17 pins had frozen the F16 -> BF16 bug!
Non-blocking suggestion: the left boundary could also accept _. The harness only pins spec-conformant names so it does not cover this, but some real repos use it as separator, e.g. stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S ships step3p5_flash_Q4_K_S-00001-of-00012.gguf, where :Q4_K_S would no longer match since an explicit tag has no fallback. (^|[-./_]) would keep it working while still separating F16/BF16 and Q4_XS/IQ4_XS.
Some repos separate the quant with an underscore, e.g. stepfun-ai/Step-3.5-Flash-GGUF-Q4_K_S ships step3p5_flash_Q4_K_S-00001-of-00012.gguf, which :Q4_K_S no longer matched. Add _ to the token boundary and pin the tag and default lookup cases.
ngxson
approved these changes
Nov 3, 2026
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
-hf <repo>:F16picked the BF16 model when a repo had both, because the tag was matched anywhere in the path: the patternF16[.-]also matches insideLlama-2-7B-BF16.gguf. The tag now has to start at a token boundary (start of path or after-,.,/), which also stops:Q4_XSfrom matchingIQ4_XSand similar. A tag no file carries now resolves nothing with the usual error listing the available files, instead of silently downloading the wrong dtype.tests/test-model-resolution.cpp: new F16/BF16 and Q4_XS/IQ4_XS cases, a pinned listing for ggml-org/Llama-2-7B-GGUF which ships both, and 17 pins corrected that had frozen the old behavior. The suite passes on all 172 pinned real listings.
Requirements
dsh:llama.cppMac Studio, M5 Ultra, 256GB◷ 33.5m · ⚙ 19.3s · ↑ 91k · ↓ 66k · ⇈ 423.6 tok/s · ⇊ 36.1 tok/s · ≡ 112 · ⌨ 12