Inkling-2-Mini Pi GGUF

Quantized by Ruben Torney (RTorney).

A GGUF quant of Inkling-2-Mini built to run on a Raspberry Pi 5 (16 GB) with llama.cpp on the CPU. It is tuned for fewer bytes read per token rather than the smallest file, because on the Pi decode speed is set by memory bandwidth (~11 GB/s) and the whole model fits in RAM anyway.

File Size Use
Inkling-2-Mini-pi-speed-B.gguf 11.55 GB recommended: better quality than UD-Q2_K_XL, fewer bytes per token
Inkling-2-Mini-pi-speed-Blite.gguf 11.32 GB speed variant: ~14 % fewer bytes per token than B, but lower quality than UD-Q2_K_XL
Inkling-2-Mini-phone-P2.gguf 8.93 GB 1-bit experts, for phones (Termux) and RAM-tight devices; clearly lower quality

Text only: the vision encoder (mmproj) is not included.

Quality (measured)

KL divergence against Unsloth's UD-Q8_K_XL, measured on a PC (RTX 3090) with llama-perplexity --kl-divergence: context 1024, 100 chunks, 51,200 scored tokens of code and technical notes, disjoint from the imatrix corpus.

Quant Size Mean KLD Median KLD KLD p99 Same top-1 PPL
Unsloth UD-Q2_K_XL 9.14 GB 0.0439 0.0049 0.425 93.0 % 3.100
Pi speed B (this repo) 11.55 GB 0.0387 0.0039 0.387 93.3 % 3.087
Pi speed B-lite (this repo) 11.32 GB 0.0573 0.0064 0.549 91.9 % 3.142

Phone P2 (1-bit experts), screening run on the first 25 of the same chunks (12,800 tokens):

Quant Size Mean KLD Median KLD KLD p99 Same top-1 PPL
Phone P2 (this repo) 8.93 GB 0.0902 0.0114 0.850 90.0 % 3.226
Quant B, same 25 chunks 11.55 GB 0.0359 0.0051 0.324 93.5 % 3.145

The reference PPL is 3.014. B-lite was measured with the experts of blocks 0โ€“9 on the CPU (VRAM budget), B fully on the GPU. Our evaluation text is easier than the one Unsloth publishes numbers on, so compare the two rows with each other, not with other model cards.

Bytes read per token (estimated)

The estimate is computed from the actual tensor composition, without the KV cache. It counts 8 of 128 experts, 48 layer applications (the 6โ€“17 core runs 3 times), the full head and one embedding row.

Quant Total Experts Attention Head Loop controllers Ceiling at 11 GB/s
Unsloth UD-Q2_K_XL 2.93 GB 1.02 1.25 0.26 0.34 ~3.8 tok/s
Pi speed B 2.61 GB 1.26 0.74 0.38 0.17 ~4.2 tok/s
Pi speed B-lite 2.24 GB 1.26 0.57 0.26 0.09 ~4.9 tok/s

Not yet measured on a Raspberry Pi. Run scripts/pi-bench.sh to get real numbers.

Recipe

The quant was made with llama-quantize --pure --allow-requantize --imatrix from UD-Q8_K_XL, using the tensor types in recipe.txt:

Tensors Type
Expert gate_up, blocks 0โ€“19 Q2_K
Expert gate_up, blocks 20โ€“23 Q3_K
Expert down, blocks 0โ€“19 NVFP4, as in the source, copied losslessly
Expert down, blocks 20โ€“23 IQ4_NL
Attention (q/k/v/gate/output/rel) Q4_K
Embedding Q8_0 (one row read per token, so it costs RAM, not bandwidth)
Output head Q6_K
Loop controllers, sink/conv projections BF16, as in the source
Router, norms, conv F32, as in the source

Two choices drive the result:

  • Down projections stay 4-bit. A 2-bit down (Q2_0) collapsed quality: mean KLD 0.156, 86.9 % top-1.
  • Attention is Q4_K instead of Q8_0. Attention is read at each of the 48 applications per token, so this is where most of the bytes are saved.

Phone P2 is B's layout with all expert gate_up in 1-bit: IQ1_M in the looped core (blocks 6โ€“17, run 3 times per token), IQ1_S elsewhere; attention Q4_K, loop controllers Q8_0 (recipe-phone.txt). IQ1_M in the core beat every all-IQ1_S variant tried (KLD 0.090 vs 0.096โ€“0.105).

B-lite is B with attention in Q3_K, the output head in Q4_K and the loop controllers (blk.N.loop_*) in Q8_0; everything else is identical (recipe-Blite.txt for the per-tensor overrides; the head is converted to Q4_K at quantize time). Attention in Q3_K is what costs most of the quality.

Importance matrix:

  • Corpus: 245,760 tokens of mixed code, chat-template text, English and French.
  • Coverage: all 128 experts in all 24 blocks (6,144 / 6,144), at least 119 tokens per expert.

Run on a Raspberry Pi 5

Inkling-2-Mini needs Unsloth's llama.cpp fork. The scripts rebuild the exact source tree used here: upstream b12572 plus the 30 pinned commits in scripts/pins-b12572.txt, checked against scripts/mix-tree.txt.

./scripts/pi-setup.sh                 # clone + native build (NEON + dotprod, OpenMP)
./scripts/pi-run.sh ~/models/Inkling-2-Mini-pi-speed-B.gguf server   # OpenAI-compatible server on :8080
./scripts/pi-bench.sh                 # llama-bench, prefill and decode

The scripts now use a q8_0 KV cache with flash attention by default (KV=f16 restores f16). On quant B this cost nothing measurable (KLD 0.0360 vs 0.0359 on 25 chunks) and halves the KV bytes read per token at long context. Prefill with a quantized KV is not yet measured on the Pi.

Recommended settings:

  • 4 threads and -lm mmap+mlock; raise the memlock limit first.
  • 8k context.
  • Active cooling and the 27 W PSU, so the Pi does not throttle under 4-core load.
  • No swap and no zram.
  • On a GPU machine with experts kept on the CPU (-ot), add --no-op-offload: without it this fork gives NaN perplexity and KLD. CPU-only runs, as on the Pi, should not be affected; this was not checked.

pi-run.sh listens on all interfaces without an API key. Keep it on a trusted network, or add --api-key.

Run on Android (Termux)

See termux/README-termux.md (in French): termux/setup.sh builds the same llama.cpp tree on the phone, termux/run.sh checks free RAM, pins the big cores and serves the chat UI on http://127.0.0.1:8080, termux/bench.sh runs llama-bench. Tested target: Galaxy S24 Ultra. Not yet measured on a phone.

Credits and license

  • Base model: Inkling-2-Mini by Thinking Machines, Apache 2.0.
  • Source GGUF: Unsloth's UD-Q8_K_XL; the llama.cpp support comes from Unsloth's fork.
  • This quant: recipe, importance matrix, evaluation and Pi scripts by Ruben Torney. Apache 2.0, same as the base model.
Downloads last month
-
GGUF
Model size
26B params
Architecture
inkling2
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for RTorney/Inkling-2-Mini-Pi-GGUF

Quantized
(228)
this model