TL;DR
Prism ML published Ternary Bonsai 2.5 27B on November 24, 2026: a Qwen3.8-27B derivative stored as ternary weights (each weight is -1, 0 or +1, with one FP16 scale per group of 128) in GGUF files from 5.58 GiB. We did not run it. What we did is read the model card, pull the GGUF header of the Q2_0 file, and work out what the 27B actually costs in memory on your own machine.
Three things matter for an edge deployment. First, the weights are only part of the bill: the header shows 64 blocks with a full-attention layer every 4th block, 4 KV heads and a head size of 256, so only 16 layers grow a KV cache, at exactly 64 KiB per token in f16. Second, that makes the cache cost 2 GiB at 32K, 8 GiB at 128K and 16 GiB at the full 262,144 tokens, which is nearly three times the PTQ1_0 weights at the top end. Third, the file you pick decides the runtime you need: Q2_0 runs on stock llama.cpp b11556 or newer, while PTQ1_0 and PQ2_0 need the PrismML llama.cpp fork.
What exactly did Prism ML release?
The repository prism-ml/Ternary-Bonsai-2.5-27B-GGUF is Apache 2.0 and lists Qwen/Qwen3.8-27B as its base model. It ships three packings of the same ternary model, each with and without a multi-token prediction (MTP) draft head, plus an optional vision projector. These are the sizes from the file listing (GiB = 2^30 bytes):
| File | Size (GiB) | Runtime |
|---|---|---|
PTQ1_0 | 5.58 | PrismML llama.cpp fork |
PTQ1_0-mtp | 5.81 | PrismML llama.cpp fork |
PQ2_0 | 6.76 | PrismML llama.cpp fork |
PQ2_0-mtp | 6.98 | PrismML llama.cpp fork |
Q2_0 | 7.15 | Stock llama.cpp b11556+ |
Q2_0-mtp | 7.37 | Stock llama.cpp b11556+ |
mmproj-Q8_0 | 0.59 | Vision input only |
mmproj-BF16 | 0.87 | Vision input only |
Two facts fall out of this table. The MTP head costs 0.22 GiB in every packing (6,232,818,944 minus 5,993,834,848 bytes for PTQ1_0), which is small next to the 1.5x to 1.8x decode speedup the card reports on NVIDIA GPUs. And the vision tower is a separate file, so text-only serving never loads it. If you only need chat and tool calls on a laptop, the 0.59 GiB projector is simply not part of your budget.
Why do the three packings differ by 1.6 GiB?
They hold the same ternary values. The card describes PTQ1_0 as dense trits at 1.76 bits per weight, PQ2_0 as each trit in a 2-bit slot, and Q2_0 as llama.cpp's standard 2-bit type. A ternary value carries log2(3), about 1.585 bits of information, so the dense packing is close to the floor, and the 2-bit slots spend the difference on simpler kernels. The Q2_0 file is 1.56 GiB larger than PTQ1_0, and that gap buys compatibility: it is the only one that loads in an unmodified llama.cpp.
The card is explicit about the risk in that choice. Stock builds older than b11556 load the Q2_0 file without any warning and produce garbage, because the weights live in a Hadamard-rotated basis and the runtime must apply the matching transform to activations. The header shows the marker for this: the file carries prism.hadamard.* keys with a block size of 1024 and sign widths of 5120, 6144 and 17408, which match the hidden size and the two inner widths of the network. Before you ship an app that bundles its own llama.cpp, print llama-cli --version and confirm the build number.
# stock llama.cpp, build b11556 or newer hf download prism-ml/Ternary-Bonsai-2.5-27B-gguf Ternary-Bonsai-2.5-27B-Q2_0.gguf --local-dir . llama-cli -m Ternary-Bonsai-2.5-27B-Q2_0.gguf -ngl 99 -fa on -c 32768 \ --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 -p "Explain quantum computing in simple terms." -n 16384 Note --min-p 0 and -n 16384. llama.cpp applies min_p=0.05 by default, which differs from the sampling the card used for its benchmarks. The model also thinks by default at xhigh reasoning effort, so a small output cap such as 256 tokens ends generation mid-thought, before any answer appears.
How much KV cache does a 27B with 16 attention layers need?
This is the part of an edge plan that file sizes hide. We read the GGUF header of the Q2_0 file directly. The relevant keys:
| Header key | Value |
|---|---|
qwen35.block_count | 64 |
qwen35.full_attention_interval | 4 |
qwen35.attention.head_count / head_count_kv | 24 / 4 |
qwen35.attention.key_length / value_length | 256 / 256 |
qwen35.context_length | 262144 |
qwen35.ssm.inner_size / state_size / time_step_rank | 6144 / 128 / 48 |
With a full-attention layer every 4th block, 16 of the 64 blocks keep a conventional KV cache. The other 48 are linear-attention (state-space style) layers whose memory does not grow with context. For one token in f16 the cache is:
layers, kv_heads, head_dim = 16, 4, 256 bytes_per_token = layers * kv_heads * head_dim * 2 * 2 # K and V, 2 bytes each print(bytes_per_token) # 65536 = 64 KiB per token print(bytes_per_token * 32768 / 2**30) # 2.0 GiB at 32K print(bytes_per_token * 262144 / 2**30) # 16.0 GiB at 262,144 A dense model with the same head layout on all 64 layers would need four times that, 8 GiB at just 32K. The hybrid design is why a 27B model is plausible on a 12 GB card at all. The linear layers add a fixed recurrent state; by our estimate (48 layers, assuming f32 state, 48 heads of 128 by 128 plus a 3-wide convolution buffer) it is about 150 MiB regardless of context. Treat that figure as our estimate, not a number from the card.
The chart applies the standard llama.cpp cache formats: q8_0 uses 34 bytes per 32 values against 64 for f16, and q4_0 uses 18. That cuts the 128K cache from 8 GiB to 4.25 GiB and 2.25 GiB. Cache quantization can move task quality, so test it on your own prompts before you trust it for agent loops.
Which file fits which machine?
Adding weights, the roughly 0.15 GiB recurrent state, and the cache gives a floor for resident memory. The table shows GiB as f16 cache / q8_0 cache. It excludes compute buffers, the vision projector, the MTP head and the OS, so leave real headroom.
| File | 8K | 32K | 64K | 128K | 262K |
|---|---|---|---|---|---|
| PTQ1_0 | 6.2 / 6.0 | 7.7 / 6.8 | 9.7 / 7.9 | 13.7 / 10.0 | 21.7 / 14.2 |
| Q2_0 | 7.8 / 7.6 | 9.3 / 8.4 | 11.3 / 9.4 | 15.3 / 11.5 | 23.3 / 15.8 |
Reading it plainly: PTQ1_0 with a q8_0 cache reaches 64K context at 7.9 GiB, which is inside an 8 GB GPU on paper but leaves very little for compute buffers. At 12 GB, PTQ1_0 holds 128K with a q8_0 cache (10.0 GiB). At 16 GB, Q2_0 with q8_0 reaches the full 262K (15.8 GiB) only with no margin, so 128K is the realistic ceiling there. A 24 GB card runs either file at 128K with an f16 cache. These are arithmetic floors, not measurements.
The card also documents a server pitfall that moves these numbers. In automatic mode the Prism llama.cpp server can start with four slots sharing a unified KV cache. A community report on an RTX 3080 10 GB measured about 9.5 GB of total GPU use before adding -np 1 and about 7.8 GB after, desktop included. If you serve one user, pass -np 1.
How good is it for agents, according to the vendor?
All benchmark numbers below are reported by Prism ML in its model card and whitepaper. We did not reproduce them. The setup is thinking mode at xhigh effort against other low-bit builds of the same Qwen3.8 base.
On tool calling the average over five benchmarks (tau2-Bench, tau3-Bench, BFCL v3, BFCL v4, AppWorld) is 77.2 for Bonsai 2.5 at 5.93 GB, against 77.7 for FP16 at 53.8 GB, and 75.3 for GSQ-RCO IQ3_XXS, a build 1.7x larger. The jump from the previous Bonsai 2 is the story: AppWorld went from 51.2 to 90.5 and tau3-Bench from 69.1 to 73.9. On agentic coding the card reports Terminal-Bench 2.1 at 60.1, SWE-bench Verified at 75.6 and DeepSWE at 27.0 (from 0.0), a 54.2 average that it describes as 90% of FP16's 60.5. Across 16 general benchmarks the average is 82.1 against 84.3 for FP16.
One detail is useful for anyone choosing a quantization: the card shows GSQ-RCO IQ2_XS scoring 79.5 on tau2-Bench but 46.5 on AppWorld, with the cause being scripts that guess API calls and declare success before seeing output. A single benchmark can hide that failure mode, so for an agent product run a multi-step tool task of your own, not only a chat prompt.
How do I set this up as a local agent backend?
A pragmatic path, assuming a single user and an NVIDIA GPU:
- Pick the file by runtime. If you control the binary, use
PTQ1_0from the PrismML fork, which the card says decodes faster on every NVIDIA GPU measured. If you need stock llama.cpp, useQ2_0on b11556 or newer. - Start at 32K context, not 262K. Measure resident memory with
nvidia-smior your OS monitor and compare to the table above. - Add
-np 1for single-user serving and-fa onfor flash attention, as in the card's commands. - Try the MTP variant only after the plain file works. It adds 0.22 GiB and needs the speculative decoding setup from the Bonsai-demo repository.
- Set the reasoning effort deliberately.
mediumgives shorter answers than the defaultxhigh, which matters when every token is generated on a laptop. - Run your own tool-calling regression set before and after any cache quantization change.
FAQ
Can I run Ternary Bonsai 2.5 27B on a 12 GB GPU?
By arithmetic, yes at moderate context. PTQ1_0 is 5.58 GiB and a q8_0 cache at 128K adds 4.25 GiB, for about 10.0 GiB before compute buffers. You need the PrismML llama.cpp fork for that file.
Does the Q2_0 file work in regular llama.cpp?
Yes, from release b11556 onward. Older builds load it silently and generate garbage, so check the version first.
Why does a 27B model need so little KV cache?
Only 16 of its 64 blocks use full attention. At 4 KV heads and head size 256, that is 64 KiB per token in f16, a quarter of what a dense 64-layer model with the same heads would use.
Is the 77.2 tool-calling score independently confirmed?
We have not reproduced it. It comes from the vendor's card and whitepaper, so treat it as the vendor's reported figure and run your own task suite.
Do I need the mmproj file?
Only for image input. The vision tower ships separately at 0.59 GiB (Q8_0) or 0.87 GiB (BF16), and text-only serving never loads it.
What does the MTP variant add?
A draft head of about 0.22 GiB for speculative decoding. The card reports a 1.5x to 1.8x decode speedup on NVIDIA GPUs.
Links
- Model card and files: https://huggingface.co/prism-ml/Ternary-Bonsai-2.5-27B-GGUF
- Run scripts and whitepaper: https://github.com/PrismML-Eng/Bonsai-demo
- PrismML llama.cpp fork: https://github.com/PrismML-Eng/llama.cpp
- Stock llama.cpp releases: https://github.com/ggml-org/llama.cpp/releases