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: name unknown GGUF quant types below the bundled type count (#14124)

Daniel Han1e2ceddeb301
diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.py
index e2048ce18a7..8b8e933c2eb 100644
--- a/studio/backend/core/inference/llama_cpp.py
+++ b/studio/backend/core/inference/llama_cpp.py
@@ -22968,12 +22968,16 @@ class LlamaCppBackend:
# A type this build lacks (prism-ml PQ2_0 / PTQ1_0 = 142 / 143) or packs differently (group-128 Q2_0, #11259).
# A truncated download fails later instead, as "data is not within the file bounds".
- bad_type = re.search(r"tensor '([^']*)' has invalid ggml type (\d+)", scan_tail)
+ # Bundled IQ1_XS..IQ1_XXXS = 64-66, so ids 43-63 fail later as an empty block-size-0 slot (#13908).
+ bad_type = re.search(
+ r"tensor '([^']*)' (?:has invalid ggml type (\d+)|of type (\d+) .*?not a multiple of block size \(0\))",
+ scan_tail,
+ )
bad_layout = re.search(r"tensor '[^']*' has offset \d+, expected \d+", scan_tail)
if bad_type or bad_layout:
detail = (
f"tensor '{_short(bad_type.group(1))}' uses quantization type "
- f"{bad_type.group(2)}, which this build does not have"
+ f"{bad_type.group(2) or bad_type.group(3)}, which this build does not have"
if bad_type
else "its tensor layout does not match this build's quantization types"
)
diff --git a/studio/backend/tests/test_llama_cpp_start_failure_classification.py b/studio/backend/tests/test_llama_cpp_start_failure_classification.py
index 599db9a32dd..9a5b031eb6d 100644
--- a/studio/backend/tests/test_llama_cpp_start_failure_classification.py
+++ b/studio/backend/tests/test_llama_cpp_start_failure_classification.py
@@ -229,6 +229,13 @@ class TestOllamaAndFallback:
"gguf_init_from_reader: failed to read tensor info\n",
"quantization type 142",
),
+ # #13908, KittenML/kitten-tts-2 TQ2_1 on b11696-mix: an id below the bundled count.
+ (
+ "gguf_init_from_reader: tensor 'blk.0.ffn_down.weight' of type 43 ((null)) has "
+ "6144 elements per row, not a multiple of block size (0)\n"
+ "gguf_init_from_reader: failed to read tensor info\n",
+ "quantization type 43",
+ ),
# #11259 report: a group-128 Q2_0 tensor where the build defines group-64 Q2_0.
(
"gguf_init_from_reader: tensor 'dspark.fc.weight' has offset 337718592, "
@@ -265,6 +272,17 @@ class TestOllamaAndFallback:
assert "GGUF file is valid" in msg
assert "cannot read this GGUF" not in msg
+ def test_known_type_with_ragged_rows_keeps_the_generic_message(self):
+ # A type this build has, with a row length its blocks do not divide: a damaged file.
+ out = (
+ "gguf_init_from_reader: tensor 'blk.0.ffn_down.weight' of type 12 (q4_K) has "
+ "6100 elements per row, not a multiple of block size (256)\n"
+ "gguf_init_from_reader: failed to read tensor info\n"
+ )
+ msg = _classify(out, "/models/m.gguf", "local/m", 1)
+ assert "GGUF file is valid" in msg
+ assert "cannot read this GGUF" not in msg
+
def test_generic_oom_keeps_memory_message(self):
msg = _classify(_OOM_OUT, "/models/big.gguf", "local/big")
assert "enough memory" in msg.lower()