Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: keep distinct bpw flavors of the same GGUF quant (#5729)

sqersterscc32777f30df
diff --git a/studio/backend/utils/models/model_config.py b/studio/backend/utils/models/model_config.py
index 3381ae0391d..f91b8fb8c97 100644
--- a/studio/backend/utils/models/model_config.py
+++ b/studio/backend/utils/models/model_config.py
@@ -1343,6 +1343,7 @@ def _extract_quant_label(filename: str) -> str:
"model-UD-IQ1_S.gguf" → "UD-IQ1_S"
"model-UD-TQ1_0.gguf" → "UD-TQ1_0"
"MXFP4_MOE/model-MXFP4_MOE-0001.gguf"→ "MXFP4_MOE"
+ "Qwen3.6-IQ4_XS-3.53bpw.gguf" → "IQ4_XS-3.53bpw"
"""
import re
@@ -1358,6 +1359,10 @@ def _extract_quant_label(filename: str) -> str:
r"|Q[0-9]+_[0-9]+" # Standard: Q8_0, Q5_1
r"|Q[0-9]+_K" # Short K-quant: Q6_K
r"|BF16|F16|F32)" # Full precision
+ # Optional bits-per-weight modifier so repos that ship multiple
+ # files at the same base quant (e.g. byteshape's IQ4_XS at 3.53,
+ # 3.97, 4.19 bpw) don't collapse into a single merged variant.
+ r"(-[0-9]+(?:\.[0-9]+)?bpw)?"
)
match = re.search(quant_re, stem, re.IGNORECASE)
# Subdir layouts like ``BF16/foo.gguf`` keep the quant in the directory,
@@ -1372,7 +1377,8 @@ def _extract_quant_label(filename: str) -> str:
break
if match:
prefix = match.group(1) or ""
- return f"{prefix}{match.group(2)}"
+ bpw = match.group(3) or ""
+ return f"{prefix}{match.group(2)}{bpw}"
# Fallback: last hyphen-separated segment
return stem.split("-")[-1]