Dense 31B on one 24 GB card — with lossless multi-token-prediction self-speculation (+18%).
PARAMETERS
31B
ARCHITECTURE
Dense
QUANT
Q4_K_M / Q6_K mix
VRAM
24 GB (or any budget via unified memory)
Gemma 4 31B is a frontier-quality dense model that just fits a 24 GB consumer card at 4-bit. IronWorks runs it graph-captured at 26.7 tok/s and adds two capabilities llama.cpp does not have in this form:
MTP self-speculation: the Gemma 4 assistant (MTP) head drafts multiple tokens per verify pass. Greedy output is byte-identical to plain decode and measured +18% faster; with temperature sampling the verifier uses exact speculative-sampling acceptance (Leviathan/Chen) for +8% on general content — losslessly, in both regimes.
Unified memory: --vram-budget runs the model token-exact at ANY VRAM budget by streaming cold layers from pinned host memory — placement changes speed, never output.
# CLI (CUDA build)
cargo install ironworks-cli --features cuda
# or build from source
git clone https://github.com/nervosys/IronWorks && cd IronWorks
cargo build --release -p ironworks-cli --features cudaiwx complete -m gemma-4-31b-it-Q4_K_M.gguf --gpu \
-p "Prove there are infinitely many primes." -n 512Point --mtp-model at the Gemma 4 assistant-head GGUF. temperature 0 → greedy verify (output == plain greedy); temperature >0 → sampling verify (output ~ target sampling).
iwx complete -m gemma-4-31b-it-Q4_K_M.gguf --gpu \
--mtp-model gemma-4-31b-it-assistant-Q4_0.gguf \
--speculative-tokens 4 \
-p "Write an essay on GPU memory hierarchies." -n 1024Caps VRAM for the large per-layer matrices; over-budget layers stream from pinned host memory each token. Output is byte-identical at any budget.
iwx complete -m gemma-4-31b-it-Q4_K_M.gguf --gpu \
--vram-budget 12G \
-p "Hello" -n 256iwx serve -m gemma-4-31b-it-Q4_K_M.gguf --port 8080 \
--kv-cache-dir ~/.cache/ironworks/kv| METRIC | MEASURED | NOTES |
|---|---|---|
| Decode (graph, tg128) | 26.66 tok/s | eager 24.51; llama.cpp reference ~39 — structural fusion work in progress |
| MTP self-spec (greedy) | 28.43 tok/s (+18%) | byte-identical output, accept 0.986; IronWorks-only mode |
| MTP self-spec (sampling) | +8% on general content | exact speculative sampling, accept 0.547 |
| 12 GB budget | 1.86 tok/s, deterministic | 39 layers resident + 21 streamed; token-exact |
RTX 3090 Ti, single GPU, greedy, clock-locked, same-session A/B/A for MTP, 2026-06-13.
Keep benchmark contexts ≤512 on 24 GB cards at full residency — KV growth past ~24 GB triggers Windows WDDM demotion on any engine.