Skip to content

common: improve GGUF quantization tag regex#22164

Open
v1b3coder wants to merge 1 commit intoggml-org:masterfrom
v1b3coder:fix/gguf-tag-regex
Open

common: improve GGUF quantization tag regex#22164
v1b3coder wants to merge 1 commit intoggml-org:masterfrom
v1b3coder:fix/gguf-tag-regex

Conversation

@v1b3coder
Copy link
Copy Markdown

Summary

Update the GGUF quantization tag regex to correctly identify tags with prefixes.

Motivation

The previous regex [-.]([A-Z0-9_]+)$ was too simple and could fail to correctly identify quantization tags that include prefixes or specific patterns. For example, models like unsloth/gemma-4-31B-it-GGUF:UD-Q8_K_XL use tags like UD-Q8_K_XL, which the previous regex might not have handled optimally or consistently across different naming conventions.

The new regex [-.]((?:[A-Z]+-)?[A-Z][0-9][A-Z0-9_]*)$ allows for an optional uppercase prefix followed by a hyphen, ensuring that tags like UD-Q8_K_XL are correctly captured as the quantization tag.

Update the regex in get_gguf_split_info to better identify quantization tags, allowing for prefixes like 'UD-' in 'UD-Q8_K_XL'. This ensures models with these naming conventions are correctly parsed during download.
@v1b3coder v1b3coder requested a review from a team as a code owner April 20, 2026 12:32
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.

1 participant