Skip to main content
Back

PrismML Squeezes a 27B Model Into 6 GB With Ternary Bonsai 2.5

PrismML's new 27B ternary model hits FP16-level tool calling at 5.93 GB, bringing agent-grade intelligence to laptops and phones.

Pro

  • Ternary Bonsai 2.5 27B compresses a 27B agent model to 5.93 GB at 1.76 bits/weight.
  • Averages 77.2 on five tool-calling benchmarks vs 77.7 for FP16, essentially matching full precision.
  • Agentic coding jumped from 63% to 90% of FP16, with SWE-bench Verified at 75.6.
  • MTP draft head plus new kernels deliver ~300 tok/s decode on H200 and B200 GPUs.
  • Runs on PrismML llama.cpp fork, stock llama.cpp (b11556+), MLX, and Hexagon NPU on Galaxy S26 Ultra.
  • Apache 2.0 licensed, 262K context, with demo repo and whitepaper available.

PrismML has released Ternary Bonsai 2.5 27B, a ternary-quantized build of Qwen3.8-27B. It compresses the model’s weights from 53.8 GB in FP16 to 5.93 GB while retaining a reported 77.2 score across five tool-calling benchmarks, compared with 77.7 for FP16.

The smaller checkpoint opens deployment paths on consumer GPUs, Apple silicon, integrated graphics, and mobile NPUs. The 5.93 GB figure covers weights; total memory use also includes the key-value cache, activations, runtime buffers, and any vision components. Context length and backend configuration therefore determine whether a given device can run the model.

Three-value weights reach 1.76 bits

Each model weight is assigned one of three values: -1, 0, or +1. Groups of 128 weights share one FP16 scale factor. A ternary value carries a theoretical log2(3), or about 1.585 bits, of information; scales and packing overhead raise the stored average to 1.76 bits per weight.

Before quantization, each matrix receives a blockwise orthogonal Hadamard rotation that spreads concentrated outliers across more dimensions. The rotated values are easier to represent with three weight levels, while the runtime applies the corresponding transform to activations. PrismML folds the weight-side rotation into the checkpoint, avoiding additional stored bits and weight traffic.

Bonsai 2.5 retains the Bonsai 2 file format. PrismML attributes the quality and performance gains to a revised training recipe, new inference kernels, and an optional multi-token prediction head.

Tool use holds while coding rebounds

PrismML reports a five-benchmark tool-calling aggregate of 77.2 for Bonsai 2.5 and 77.7 for FP16. The evaluation covers tau-2-Bench, tau-3-Bench, BFCL v3, BFCL v4, and AppWorld.

Evaluation Bonsai 2 Bonsai 2.5 Reference
Tool-calling aggregate Not reported 77.2 FP16: 77.7
AppWorld 51.2 90.5 IQ3_XXS: 86.1
Terminal-Bench 2.1 52.8 60.1 Included in coding retention
SWE-bench Verified 60.8 75.6 Included in coding retention
DeepSWE 0 27.0 Included in coding retention

AppWorld requires agents to write Python against nine application APIs. Bonsai 2.5 scores 90.5, up from 51.2 for Bonsai 2 and above the listed IQ3_XXS result of 86.1.

The three coding suites show similarly large gains. PrismML calculates that Bonsai 2.5 retains 90% of FP16 performance across Terminal-Bench 2.1, SWE-bench Verified, and DeepSWE, compared with 63% for Bonsai 2.

Compression still leaves measurable gaps

BFCL v4 remains a weak point: Bonsai 2.5 trails FP16 by 3.6 points and IQ2_S by 0.5. Its five-category general-knowledge average is 82.1, compared with 84.3 for FP16, and math has the largest category gap at roughly 3.1 points.

The model card also reports a slight instruction-following regression from Bonsai 2. These results position the checkpoint most strongly for tool use and agentic coding; applications centered on difficult function calls, math, or strict instruction adherence require workload-specific evaluation.

Draft tokens push decode past 300 tok/s

The release combines rewritten kernels with a multi-token prediction draft head, a small auxiliary layer that proposes several future tokens for the main model to verify together. This reduces the number of full-model decoding passes when enough proposed tokens are accepted.

PrismML reports a 1.5 to 1.8 times MTP decode speedup on NVIDIA GPUs and a 1.1 to 2.1 times gain on the other tested devices. With the new kernels and MTP enabled, six of seven tested NVIDIA GPUs decode 2.3 to 3.0 times faster than they did with the original Bonsai 2 release.

Device Backend and packing Reported decode speed
NVIDIA H200 or B200 CUDA, PTQ1_0 About 306 to 309 tok/s
RTX 5090 or RTX PRO 6000 CUDA, PTQ1_0 About 283 to 312 tok/s
RTX 4090 CUDA, PTQ1_0 About 204 tok/s
Apple M4 Pro Metal, PQ2_0 About 29 tok/s
Intel Core Ultra laptop SYCL, PTQ1_0 About 24.5 tok/s
Galaxy S26 Ultra Hexagon NPU, Q2_0 About 8.8 tok/s

These figures measure token generation, also called decode, rather than prompt ingestion. They use MTP and kernels still under testing. Different devices also use different packings and backends, which prevents an identical cross-platform comparison.

Three packings target different runtimes

Packing Storage layout Runtime path
PTQ1_0 Dense trits at 1.76 bits per weight; 5.93 GB Fastest reported NVIDIA decode; requires the PrismML llama.cpp fork while upstream review is pending
PQ2_0 Each trit stored in a 2-bit slot Used for Apple Metal benchmarks and the MLX export
Q2_0 Standard llama.cpp 2-bit packing Runs on compatible upstream llama.cpp builds

Stock llama.cpp requires release b11556 or newer for Q2_0 because that release added the Hadamard activation transform. Older builds may load the file without warning and then produce unusable output. Check the installed version with llama-cli --version before investigating model-quality problems.

MTP-enabled downloads use separate -mtp.gguf files. PrismML also supplies backend-specific JSON presets for CUDA, Metal, SYCL, and Hexagon.

Run the CUDA build locally

For the fastest reported NVIDIA path, download a binary from the PrismML fork and run the PTQ1_0 checkpoint:

hf download prism-ml/Ternary-Bonsai-2.5-27B-gguf \
  Ternary-Bonsai-2.5-27B-PTQ1_0.gguf --local-dir .
./bin/llama-cli -m Ternary-Bonsai-2.5-27B-PTQ1_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
  • -ngl 99 requests GPU offload for every model layer.
  • -fa on enables Flash Attention.
  • -c 32768 allocates a 32K-token context.
  • --min-p 0 overrides llama.cpp’s default value of 0.05.
  • -n 16384 permits up to 16,384 generated tokens, subject to the total context limit.

The model uses xhigh reasoning effort by default, which favors accuracy and can produce long reasoning traces. PrismML recommends the medium setting when lower latency and shorter responses matter. Small generation caps can stop the model before it reaches a final answer.

The checkpoint advertises a maximum context of 262K tokens, although key-value cache memory grows with context length. It carries an Apache 2.0 license, and its vision tower ships separately as an mmproj file so text-only deployments can omit that component.

Sub-2-bit agents gain practical range

Earlier sub-2-bit releases often preserved language-model metrics while losing performance on long, tool-driven tasks. Bonsai 2 illustrated the problem by retaining 63% of FP16 performance across the three coding benchmarks and scoring zero on DeepSWE. Bonsai 2.5 reports 90% retention at the same bit width, indicating that training and kernel design can recover much of the lost agent performance.

FP16 weights for this 27B model occupy 53.8 GB before runtime memory is counted. The 5.93 GB ternary checkpoint makes shorter-context deployments plausible on gaming GPUs and laptops, while the reported H200 throughput supports higher-volume agent serving. The local agent demo also provides a starting point for repository-scale coding workflows that keep source code on the user’s machine.

Deployment decisions should account for task-specific accuracy, prompt-ingestion speed, MTP acceptance rates, context-cache memory, and backend maturity. PrismML’s results show that ternary weights can support capable tool-calling and coding agents, with measurable tradeoffs in several evaluation categories.