4Geeks chosen to deliver AI education in the Bahamas alongside Harvard, Oxford, and Columbia.See more
7 min read

What Is Ternary Bonsai 2.5? A 27B Coding Model in 6 GB

Ternary Bonsai 2.5 squeezes Qwen3.8 27B into about 5.9 GB for local agentic coding. What ternary weights mean, PrismML's reported scores, hardware fit, and how to run it.

Ternary Bonsai 2.5 is a 27 billion parameter open weights model from PrismML, released on November 24, 2026. It squeezes Qwen3.8 27B down to about 5.9 GB, so it can run agentic coding work on a single consumer GPU or a recent laptop. Its weights are ternary: each one is stored as negative one, zero or positive one, plus a shared scale. PrismML says that keeps most of the full model's coding and tool calling ability at roughly a ninth of the size. This guide explains what ternary means in plain words, what hardware fits, how to run it with llama.cpp or MLX, how to plug it into a coding agent, and when a hosted API is still the better call. All numbers are PrismML's own, from its announcement and Hugging Face model card, checked November 25, 2026.

What ternary weights mean

A language model is mostly a huge grid of numbers called weights. In a normal FP16 model, each weight takes 16 bits. Ternary Bonsai stores each weight as one of three values: negative one, zero or positive one. Every group of 128 weights shares one FP16 scale factor. That works out to 1.76 bits per weight in PrismML's densest packing.

The payoff is size. The model card puts the file at 5.93 GB, against 53.8 GB for the FP16 model. Smaller weights also mean less memory traffic per token, which is a big part of why small models feel fast on a single GPU.

There's a catch you should expect: squeezing a model this hard usually costs quality, especially on long, multi step tasks where one bad action derails everything. Version 2.5 is PrismML's attempt to win back that agentic ability. It keeps the same format and size as Ternary Bonsai 2 and focuses training on tool use and coding.

What PrismML reports

These are vendor numbers from PrismML's own evaluation, not independent results. Treat them as a starting point for your own tests.

BenchmarkQwen3.8 27B (full precision)Bonsai 2 27BBonsai 2.5 27B
SWE-bench Verified80.660.875.6
Terminal-Bench 2.170.852.860.1
DeepSWE v1.130.1027
AppWorld93.251.290.5
LiveCodeBench v687.683.883.0

On the model card, PrismML also reports an average of 77.2 across five tool calling benchmarks, against 77.7 for FP16, and says the model keeps about 90% of FP16 on its three agentic coding benchmarks, up from 63% for Bonsai 2.

On speed, the announcement reports 204 tokens per second on an RTX 4090 and 291 on an H100. Both use multi token prediction (MTP), a small draft head that guesses upcoming tokens to speed up output. Without MTP, the card lists about 112 tokens per second on an RTX 4090.

What hardware fits

PrismML says the model runs on NVIDIA and Intel GPUs through llama.cpp and on Apple devices through MLX. A few practical notes from the model card:

  • NVIDIA GPUs: the weights alone take 5.93 GB, and context length and server settings add to that. The card cites a community report on an RTX 3080 with 10 GB: about 9.5 GB in use, dropping to about 7.8 GB after limiting the server to one request at a time with -np 1.
  • Apple Silicon: PrismML benchmarked an M5 Pro at about 30 tokens per second with llama.cpp and about 22 with MLX.
  • Context: up to 262,144 tokens, but a longer context needs more memory. Start at 32K.

PrismML also lists laptops with Apple Silicon or Intel Core Ultra chips as targets. Treat the file size as the floor, not the total. Your context length, other apps and the runtime all need memory too.

How to run it

The model ships in three packings, and the right one depends on your llama.cpp build:

FileRuns onSizeWhen to pick it
PTQ1_0PrismML's llama.cpp fork5.93 GBFastest decode on NVIDIA GPUs
PQ2_0PrismML's llama.cpp forklarger, 2 bits per weightApple Metal, and the source of the MLX export
Q2_0Stock llama.cpp, release b11556 or newer7.67 GBYou want the official llama.cpp build

With stock llama.cpp, download the Q2_0 file from Hugging Face and run it with the sampling settings PrismML recommends:

bash
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 this repo's test setup." -n 16384

Check your version first with llama-cli --version. The model card warns that older stock builds load Q2_0 without any error and then produce garbage.

With PrismML's fork, grab a prebuilt release from PrismML-Eng/llama.cpp and use the PTQ1_0 file with the same flags. For server mode, tool calling and the faster MTP setup, PrismML points everyone to its Bonsai-demo scripts, which it keeps more current than the card.

On a Mac with MLX, use the MLX 2 bit pack, which bundles its own loader.

Two settings trip people up. It's a reasoning model that thinks by default at the xhigh effort level, so a small output cap like 256 tokens cuts it off mid thought. And llama.cpp sets min_p to 0.05 by default, so pass --min-p 0 as the card does.

Plugging it into a coding agent

The usual path is to run llama-server instead of llama-cli. llama.cpp's server exposes an OpenAI compatible API on your machine, and many coding agents and editors let you point to a custom OpenAI compatible endpoint. Bonsai-demo ships run scripts for serving and tool calling, so start there rather than guessing flags.

A sensible first test: give it a small, real bug in a private repo, like a failing unit test, and compare the result with the hosted model you use today. PrismML's own demo does exactly this, reproducing and fixing a pytest regression. Keep a human review step before anything gets merged.

Where it falls short of the full model

Even by PrismML's numbers, the compressed model trails full precision Qwen3.8 27B on several coding benchmarks: 75.6 vs 80.6 on SWE-bench Verified and 60.1 vs 70.8 on Terminal-Bench 2.1. It also scores slightly lower on LiveCodeBench v6 than Bonsai 2 did. On general capability, the card reports an average of 82.1 against 84.3 for FP16.

Pick a hosted API instead when:

  • You need the strongest possible coding result on large, unfamiliar codebases.
  • Your hardware is the bottleneck. A slow local model can cost more time than it saves.
  • You need many requests at once. A single local GPU serves one or a few users well, not a whole team.

Pick Ternary Bonsai 2.5 when code or documents can't leave the device, when you want to work offline, or when per token API bills add up on repetitive agent loops.

Licensing and the bigger trend

PrismML released the weights under the Apache 2.0 license, so you can use them commercially. Check the NOTICE file on Hugging Face for upstream attribution.

Small, strong local models are a fast moving trend. For two other recent examples, see what is Inkling 2 Mini, an open looped model that runs on a laptop, and what is Muse Glimmer. For more tools grouped by job, browse our AI tools hub.

Knowing how to choose, run and evaluate a model like this is a core skill for building with AI. If you want to go from running models to shipping agents and AI apps, see how AI Engineering works.

Sources, checked November 25, 2026: Introducing Ternary Bonsai 2.5 27B (PrismML, November 24, 2026) and the Ternary Bonsai 2.5 27B GGUF model card on Hugging Face. All benchmark and speed figures are PrismML's own.

Want to go from running models to shipping AI apps?

Get information on AI Engineering, a cohort program where you build agents, RAG systems and production AI apps with mentorship.

Frequently Asked Questions