Ternary Bonsai 2.5 27B6.23 GB of PTQ1_0-mtp on 12 GB
PrismML’s PTQ1_0 file fits in VRAM with MTP and a 96k window. Decode reaches 89.9 tok/s with thinking off.
- Decode · Empty context, thinking off
- 89.9tok/sstock 47.6
- Prefill · 8k prompt
- 572tok/sstock 603
- Context
- 96k tokens
TUNED STOCK FLAGS
Run it
./serve.sh
| Model | prism-ml/Ternary-Bonsai-2.5-27B-GGUF on Hugging Face · Apache-2.0 |
|---|---|
| Weights | GGUF PTQ1_0-mtp, 6.23 GB from prism-ml/Ternary-Bonsai-2.5-27B-GGUFTernary-Bonsai-2.5-27B-PTQ1_0-mtp.gguf at 28a7093cc |
| Engine | llama.cpp prism-b12232-f702476 |
| Placement | Model and KV caches in VRAM. |
| Hardware | RTX 3060 12 GB · 62 GB RAM · i5-12500 |
| API | OpenAI-compatible /v1 on port 8108 |
| Key flags | VARIANT=base|q2|uncensored|uncensored-mtp|lora TB_PROFILE=default|long|full|card|stock -ctk q8_0 -ctv q8_0 -ctkd q8_0 -ctvd q8_0 -ub 512 --spec-type draft-mtp --spec-draft-n-max 3 --spec-draft-p-min 0 |
- The default PTQ1_0 file requires PrismML’s fork. The full profile disables MTP to fit. Created using Bonsai by Prism ML.
Measured results
| Metric | Conditions | Measured | Stock | Ceiling | Source line |
|---|---|---|---|---|---|
| Decode | Empty context, thinking off | 89.9 tok/s | 47.6 | RESULTS.md:52 | |
| Empty context, thinking on | 65.7 tok/s | 47.4 | RESULTS.md:53 | ||
| 90k depth | 55.7 tok/s | RESULTS.md:54 | |||
| Prefill | 8k prompt | 572 tok/s | 603 | RESULTS.md:55 | |
| Needles | 49k and 92k prompts | 3/3 found | RESULTS.md:57 | ||
| Decode | Locally grafted uncensored MTP, thinking off | 93.5 tok/s | RESULTS.md:91 |
Reproductions
None yet. If you ran this on your own 3060, report your numbers and they appear here with your hardware.
Thanks
- PrismML Ternary Bonsai weights, MTP head and image projector.
- PrismML llama.cpp fork PTQ1_0 runtime and CUDA kernels.
- AtomicChat The Q4_K_M file the Nemotron-Labs-Image recipe serves, and the tested llama.cpp revision it runs on.
- Qwen The 15 mtp.* tensors grafted back into the 3D coder came from Qwen3.5-4B; Kintsugi-27B is built on Qwen3.8-27B.
- Unsloth The Mainline_Support files are the max-speed options of the Inkling recipe (41.4 tok/s whole-on-GPU); UD-Q3_K_XL was the smaller-expert test on Flint.
- llama.cpp (ggml-org and contributors) The engine for Flint, the 3D coder and Inkling-2-Mini, and the base of the Kintsugi fork.
- ggml-org Flint-Q4_K_M.gguf and Inkling-2-Mini-IQ4_NL.gguf are the files the two recipes serve; the Q8_0 files are the KLD references.
- 0xSero / Sybil Solutions The tuning method behind the Flint and Inkling recipes; its q8_0 KV gotcha is one we confirmed on Flint.
Full write-up
This recipe serves PrismML's Ternary Bonsai 2.5 27B on the RTX 3060 12 GB with every layer in VRAM.
The model is Qwen3.8-27B (64 layers, 3 Gated DeltaNet : 1 full attention, 262k native window) re-trained to ternary
weights in a rotated (Hadamard) basis. The weights take 1.75 bits each, so the trunk is 5.4 GB. The -mtp files
add the model's multi-token-prediction head.
Every 3- and 4-bit file of this base model needs part of the model in RAM on a 12 GB card
(../qwen38-27b-family/). This one leaves room for three things:
- the MTP head. With every layer on the GPU the verify step is cheap, so MTP n=3 roughly doubles decode, to ~90 tok/s.
- a long window. On PrismML's llama.cpp fork, q8_0 or q4_0 K/V costs MTP nothing. The default serves 96k with MTP, long 192k
with MTP, and full the native 262k with needles found at 248k.
- an uncensored variant at the same speed. AtomicChat's baked uncensored file has no MTP head. Copying its 36
edited matrices into prism-ml's MTP file brings it back to 93.5 tok/s.
Numbers and quality are in RESULTS.md. The experiment log is PLAN.md, the ceilings are in
THEORY.md, and the raw data is in runs/.
Result
| Single user | Stock (llama-server -m … --jinja) |
This recipe (default) | long |
full |
|---|---|---|---|---|
| Decode, thinking off | 47.6 tok/s | 89.9 tok/s (1.9×) | 90.3 | 47.2 |
| Decode, thinking on | 47.4 tok/s | 65.7 tok/s (1.4×) | 64.9 | 47.0 |
| Decode deep in the window | – | 55.7 at 90k | 36.8 at 180k | 8.2 at 241k |
| Prefill 8k / 32k | 603 / – tok/s | 572 / 503 tok/s | 562 / 496 | 588 / 515 |
| Prefill near the window (TTFT) | – | 387 at 90k (241 s) | 273 at 186k (680 s) | 242 at 248k (17 min) |
| Window | 56,832 (fit's choice, shared by 4 slots) | 98,304, q8_0 K/V | 196,608 q4_0 | 262,144 q4_0 |
| Needles at ~50% / ~95% | – | 3/3 / 3/3 | 3/3 / 3/3 | 3/3 / 3/3 |
| Card (incl. desktop) | 11.0 GB | 11.36 GB | 11.46 GB | 11.58 GB |
- Plain decode: 47.5 tok/s, 83% of the 57.0 tok/s ceiling (6.0 GB read per token at 342 GB/s).
- MTP: accepts 80% of drafts on code and ~50% with thinking on.
- The card's own MTP preset (
TB_PROFILE=card: 16k, f16) runs at 91.7 / 71.0. The default matches it with 6× the window. - codeeval: 8/8. The q8_0 K/V of the default sits at the KLD floor, so its only change from the published model is MTP, which is lossless.
- Image input through the mmproj works: 3/3 on a shapes-and-colours test.
- On the same card:
- the same base model as IQ3_XXS (
../qwen38-27b-family/) decodes at 16.6 tok/s at 32k and 7.5 at 128k; - Kintsugi-27B (
../kintsugi-27b/) runs ~16 plain and 35–60 with its drafter.
Which config
TB_PROFILE= |
MTP | Window, K/V | Decode d0 / deep | Prefill 8k | Card | Use |
|---|---|---|---|---|---|---|
default |
n=3 | 96k q8_0 | 89.9 / 55.7 (90k) | 572 | 11.36 GB | chat, coding, agents: lossless |
long |
n=3 | 192k q4_0, ub 256 | 90.3 / 36.8 (180k) | 562 | 11.46 GB | big documents and repos; q4_0 K/V is lossy (KLD 0.005) |
full |
– | 262k q4_0, ub 256 | 47.2 / 8.2 (241k) | 588 | 11.58 GB | the whole native window; slow at the far end |
card |
n=3 | 16k f16 | 91.7 / – | 550 | 8.8 GB | prism-ml's consumer-GPU preset, as published |
stock |
– | fit's choice | 47.6 / – | 603 | 11.0 GB | the baseline |
VARIANT= |
File, engine | Decode (32k) off / on | Notes |
|---|---|---|---|
base |
prism-ml PTQ1_0-mtp, PrismML fork | 89.9 / 65.5 | default |
q2 |
prism-ml Q2_0-mtp, stock llama.cpp | 50.7 / 40.6 | no fork needed; same weights (KLD at the floor); 1.6 GB larger, so windows 48k / 96k / 131k |
uncensored |
AtomicChat's baked PTQ1_0 | 47.5 / 47.3 | the published file; no MTP head |
uncensored-mtp |
the same edit + prism-ml's MTP head (local copy, tools/graft_mtp.py) |
93.5 / 68.1 | refusals 20/20 answered, codeeval 7/8 |
lora |
base + AtomicChat's LoRA ×1.25 at runtime | 84.8 / 66.4 | 3× the baked file's KLD and +4.3% code perplexity |
TB_MMPROJ=1 loads the vision projector (+0.6 GB). The windows drop to 64k / 131k / 192k (default / long / full).
The VRAM figures leave 0.7–0.9 GB of the card free, so close other GPU programs before long or full.
Use it
# 1. weights (pinned; ../scripts/hf_get.sh fetches, resumes and checks sha256) ../notes/batch2/downloads.tsv # prism-ml/Ternary-Bonsai-2.5-27B-GGUF @ 28a7093cc -> $MODELS/ternary-bonsai-27b/prism-ml/ # Ternary-Bonsai-2.5-27B-PTQ1_0-mtp.gguf (e0fc5f3d…), -Q2_0-mtp.gguf (b0f83de8…), -mmproj-Q8_0.gguf (6807ede6…) # AtomicChat/Ternary-Bonsai-2.5-27B-Uncensored-GGUF @ 500fdfc33 -> $MODELS/ternary-bonsai-27b/atomicchat/ # Ternary-Bonsai-2.5-27B-Uncensored-PTQ1_0.gguf (f6b5f856…), -Uncensored-LoRA.gguf (0573a04f…) # 2. engine: PrismML-Eng/llama.cpp tag prism-b12232-f702476, CUDA build # git -C $SCRATCH/llama.cpp/src-r2 fetch prismml --tags # HF_UI_VERSION=b12017 ./build-r2.sh prism-b12232=prism-b12232-f702476 # -> prism-b12232-f70247610/bin # (VARIANT=q2 runs on stock master-225a5345b instead) # 3. optional, for VARIANT=uncensored-mtp: the local copy with the MTP head (6.2 GB, ~1 min, stdlib only) python3 -I tools/graft_mtp.py $MODELS/ternary-bonsai-27b/prism-ml/Ternary-Bonsai-2.5-27B-PTQ1_0-mtp.gguf \ $MODELS/ternary-bonsai-27b/atomicchat/Ternary-Bonsai-2.5-27B-Uncensored-PTQ1_0.gguf \ $MODELS/ternary-bonsai-27b/local/Ternary-Bonsai-2.5-27B-Uncensored-PTQ1_0-mtp-graft-local.gguf # (expects 36 replaced tensors, sha256 29331c54…; --check lists them without writing) # 4. serve (through gpu_run, OpenAI-compatible on 127.0.0.1:8108, model name ternary-bonsai-27b) ./serve.sh # default: 96k q8_0, MTP n=3 TB_PROFILE=long ./serve.sh # 192k q4_0, MTP n=3 TB_PROFILE=full ./serve.sh # 262k q4_0, no MTP VARIANT=uncensored-mtp ./serve.sh # uncensored at full speed TB_MMPROJ=1 ./serve.sh # image input TB_DRY=1 ./serve.sh # print the llama-server command
The default command:
llama-server -m Ternary-Bonsai-2.5-27B-PTQ1_0-mtp.gguf --no-mmproj -ngl 99 --fit off -c 98304 -np 1 -t 6 -b 2048 -ub 512 \ -fa on -ctk q8_0 -ctv q8_0 --spec-type draft-mtp --spec-draft-n-min 0 --spec-draft-n-max 3 --spec-draft-p-min 0 \ -ctkd q8_0 -ctvd q8_0 --jinja --reasoning-format deepseek --reasoning on \ --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 --repeat-penalty 1.0 --presence-penalty 0 --host 127.0.0.1 --port 8108
Notes for these flags:
- -np 1: the auto setting makes 4 slots that share the window.
- -ctkd/-ctvd: these matter. Without them the MTP context keeps its own K/V at f16, which costs 0.9 GB at 224k.
- Samplers: the card's thinking-mode set.
- Thinking: the chat template thinks at effort xhigh by default. Pass "chat_template_kwargs": {"reasoning_effort": "medium"},
or "enable_thinking": false, per request. TB_THINK=off turns thinking off server-wide.
Limits
- Deep decode in
fullis slow: 8.2 tok/s at 241k, 25% of its bytes ceiling. The single-token attention over a long q4_0 cache is the limit. MTP's verify amortises it, which is whylongkeeps 36.8 at 180k. MTP does not fit at 262k (the draft's recurrent-state copies need another 0.6 GB). - Long prompts take minutes: prefill is compute bound at 240–590 tok/s on this card, so a 186k prompt takes 11 min before the first token.
- Lossy profiles: q4_0 K/V (
long,full) has 10× the KLD floor (0.005 wiki). - Not measured:
- error against the original BF16 model (no reference on disk);
- concurrency;
- answers above 8k tokens.
- The PrismML testing-kernel env knobs (
GGML_CUDA_FWHT_MMQ=1 GGML_CUDA_FWHT_MMQ_GLU=1, ...) give +5–7% prefill but take 0.8 GB of VRAM, so the profiles leave them off. - Memory cap: the 24 GB
gpu_runcap counts the mmap'd file's page cache (10–16 GB here, 23.7 GB with two files in cache).
Licences
- The model: Apache-2.0 (card and NOTICE), built from Qwen3.8-27B (Apache-2.0).
- PrismML asks for attribution when the model is redistributed or deployed publicly: "Created using Bonsai by Prism ML."
- The MTP head started from Qwen3.8-27B's MTP head (via Unsloth's UD-Q4_K_M conversion) and was fine-tuned by Prism ML.
- AtomicChat's uncensored file and LoRA: Apache-2.0. The
uncensored-mtplocal copy is a derivative of both repositories' files. It is not redistributed here;tools/graft_mtp.pyrebuilds it. - The uncensored variants answer requests a stock assistant refuses. That is their purpose; what they are used for is the user's responsibility.
Tools
| Tool | What it does |
|---|---|
serve.sh |
the launcher: VARIANT=, TB_PROFILE=, MTP, window, K/V, mmproj; holds the GPU lock while serving |
tools/graft_mtp.py |
builds the uncensored-mtp copy: prism-ml's MTP file with AtomicChat's edited tensors copied in; checks names, types and shapes, --check only lists |
tools/srv.sh <label> [ENV=…] -- <cmd> |
one server start/stop through ../scripts/with_server.sh on port 8108; records the command and env in runs/ |
tools/gpu_batch.sh, tools/launch.sh, tools/chain.sh |
one GPU-lock hold per batch (GPU_RUN_MEM=24G), detached, logged to runs/batches/ |
tools/srvtest.py |
prefill, decode (with draft acceptance) and needle client on llama-server's own timings |
tools/measure.sh <label> <window> |
the measurement set: prefill 8k/32k/92%, decode empty and deep, needles 50%/95%, codeeval, greedy, memory |
tools/image_test.py |
image input check through the mmproj (stdlib-drawn PNG, three shapes) |
tools/kld.sh |
KL divergence of a change against the PTQ1_0-mtp file on the fork |
tools/greedy.py, tools/longans.py |
temperature-0 answers to fixed prompts; long answers with loop flags |
tools/codeeval_lenient.py |
../scripts/codeeval.py's tasks also counting bare unfenced code |
tools/gguf_info.py |
GGUF header and tensor summary (runs/gguf-*.txt) |
tools/mkconfigs.py |
writes configs/<label>.json from each run's command, env and ledger rows |
tools/mem.sh, tools/concurrent.py |
memory and startup of a running server; N simultaneous requests |
Credits
- PrismML, for Ternary Bonsai 2.5 27B: the ternary training, the PTQ1_0 and Q2_0 GGUFs, the MTP head, the mmproj, the llama.cpp fork with its CUDA ternary, FWHT and MTP kernels, and the consumer-GPU MTP preset and sampler settings in Bonsai-demo. Created using Bonsai by Prism ML.
- AtomicChat, for the uncensored edit, both baked and as a LoRA.
- Qwen, for Qwen3.8-27B, its architecture and MTP design; and Unsloth, whose conversion the MTP head started from.
- llama.cpp and ggml-org, for the engine, the upstream Q2_0 and Hadamard
runtime support that lets the
q2variant run on stock master, MTP speculative decoding andllama-perplexity. - Sibling recipes:
../qwen35-9b-heretic/and../qwen38-27b-family/for the batch tooling and the earlier MTP and K/V findings this one rechecked. - Method: 0xSero's inference-optimisation-skill: ceilings first, one change at a time between controls, output gated as well as speed.
recipe.json · Markdown · Folder with scripts and raw runs · Full results log