A 27B model that decodes at 110 tokens per second in about 7 GB of VRAM sounds like a typo. That is the pitch PrismML makes for Ternary Bonsai 2.5 27B. It is Qwen3.8-27B squeezed to ternary weights, so the whole question is how much you lose and how much card you actually need. If you have been sizing a 12 GB or 8 GB GPU for a 27B model, this is the build that changes the arithmetic.
We ran all of this on a rented RTX 4090 in December 2026, and it works end to end on stock llama.cpp, on the PrismML fork and in Ollama. Below you get measured VRAM at 8K and 32K context, llama-bench numbers and a partial offload sweep for smaller cards. You also get the Ollama tag that downloads the wrong file, and a five prompt spot check against Qwen3.8-27B at Q4_K_M on the same box.
Results first: VRAM and speed on one RTX 4090
Every row below came from the same rented machine, so you can compare the rows directly:
- GPU: RTX 4090 24 GB, driver 580.126.09
- CPU: Intel i7-7700, 4 cores and 8 threads
- RAM: 31 GB
- OS: Ubuntu 24.04
VRAM is the total nvidia-smi reported with the server loaded and idle, which includes about 605 MiB the host was already using before anything started. All rows use full GPU offload, flash attention and -np 1.
| Build | File size | VRAM 8K | VRAM 32K | Decode (tg128) | Runtime |
|---|---|---|---|---|---|
| Bonsai Q2_0 | 7.14 GiB | 8,858 MiB | 10,418 MiB | 86.78 t/s | Stock llama.cpp b12999 |
| Bonsai PTQ1_0 | 5.57 GiB | 7,326 MiB | 8,886 MiB | 110.92 t/s | PrismML fork prism-b12232 |
| Bonsai PTQ1_0-mtp | PTQ1_0 plus MTP head | 8,154 MiB | 9,810 MiB | 179 to 240 t/s on our prompts | PrismML fork prism-b12232 |
| Qwen3.8-27B Q4_K_M | 18.06 GiB | 19,692 MiB | 21,252 MiB | 44.49 t/s | Stock llama.cpp b12999 |
So where does ternary actually win? Look at the decode column. Q2_0 on stock llama.cpp decodes about twice as fast as the Q4_K_M build of the same base model, and PTQ1_0 on the fork is two and a half times as fast. Decode on a single card is bound by how many bytes it reads per token, and you read far fewer bytes from a 5.57 GiB file. Prefill barely moves: every build ran pp512 between 3,187 and 3,532 t/s, so long prompts are not where ternary wins. The MTP row is a range because speculative decoding depends on how many drafted tokens the model accepts, which changes from prompt to prompt.
PTQ1_0 vs PQ2_0 vs Q2_0: which file to download
The Ternary Bonsai 2.5 27B GGUF repo ships the same ternary weights in three packings, and the packing decides which runtime can open the file. That matters more than the size difference, because two of the three will not load in a stock llama.cpp or Ollama build at all.
| File | Bytes | Loads in | Use it when |
|---|---|---|---|
| PTQ1_0 | 5,993,834,848 | PrismML fork only | You want the smallest file and fastest decode on NVIDIA |
| PTQ1_0-mtp | PTQ1_0 plus an MTP head | PrismML fork only | You want speculative decoding on top of PTQ1_0 |
| PQ2_0 | 7,253,354,848 | PrismML fork only | Only if the fork docs recommend it for your backend |
| Q2_0 | 7,673,194,848 | Stock llama.cpp and Ollama | You want upstream binaries and no fork |
PrismML’s model card says Q2_0 needs stock llama.cpp at b11556 or newer, and that older builds load it without complaint and then print garbage, so check your build number before blaming the model. The card also lists PTQ1_0 as the pick on NVIDIA and notes that its upstream support is still under review. The repo also has Q2_0-mtp and PQ2_0-mtp variants that we did not test. We downloaded Q2_0, PTQ1_0 and PTQ1_0-mtp; PQ2_0 only shows up later as the file Ollama grabs by mistake.
Step 1: Get the llama.cpp builds and the GGUF files
We used prebuilt CUDA binaries for both runtimes so the numbers do not depend on local compiler flags. The stock release needs its separate cudart archive unpacked into the same folder, otherwise the CUDA backend has no runtime libraries to load. If you already built llama.cpp from source, our llama.cpp local setup guide covers that route, and any build at b11556 or later will open Q2_0.
mkdir -p ~/bonsai/stock ~/bonsai/prism ~/bonsai/models
cd ~/bonsai
# pin: stock build tested for this guide https://github.com/ggml-org/llama.cpp/releases/tag/b12999
curl -sSL -o stock.tgz https://github.com/ggml-org/llama.cpp/releases/download/b12999/llama-b12999-bin-ubuntu-cuda-12.8-x64.tar.gz
curl -sSL -o cudart.tgz https://github.com/ggml-org/llama.cpp/releases/download/b12999/cudart-llama-b12999-bin-ubuntu-cuda-12.8-x64.tar.gz
tar -xzf stock.tgz -C stock --strip-components=1
tar -xzf cudart.tgz -C stock --strip-components=1
The PrismML fork publishes its own release tarballs. Grab the one that matches your platform from the PrismML llama.cpp releases page; the Linux CUDA build we tested is below.
# pin: fork build tested for this guide https://github.com/PrismML-Eng/llama.cpp/releases/tag/prism-b12232-f702476
curl -sSL -o prism.tgz https://github.com/PrismML-Eng/llama.cpp/releases/download/prism-b12232-f702476/llama-prism-b12232-f702476-bin-linux-cuda-12.4-x64.tar.gz
tar -xzf prism.tgz -C prism --strip-components=1
sudo apt-get install -y libgomp1
That last line is there because both binaries failed on our fresh Ubuntu image with error while loading shared libraries: libgomp.so.1. Minimal cloud and container images often leave out the OpenMP runtime. After installing it, the version check on each build printed this:
version: 1.1.1-dev (build 12999, commit 66f43d51f)
built with GNU 13.3.0 for Linux x86_64
====
version: 0.7.0-dev (build 12232, commit f70247610)
built with GNU 11.4.0 for Linux x86_64
====
Available devices:
CUDA0: NVIDIA GeForce RTX 4090 (24078 MiB, 23083 MiB free)
Now pull the model files straight from Hugging Face. The loop fetches the three files we used; you can drop the two PTQ1_0 entries if you only plan to run stock llama.cpp or Ollama.
cd ~/bonsai/models
for f in Q2_0 PTQ1_0 PTQ1_0-mtp; do curl -sSL -o Ternary-Bonsai-2.5-27B-${f}.gguf https://huggingface.co/prism-ml/Ternary-Bonsai-2.5-27B-GGUF/resolve/main/Ternary-Bonsai-2.5-27B-${f}.gguf; done
sha256sum Ternary-Bonsai-2.5-27B-*.gguf
Compare the hashes against the file pages on Hugging Face before going further. These are the digests of the files we tested:
e0fc5f3d47b9c926d52677d303b19df356a2376614b3e1cb9973865fc04ca431 Ternary-Bonsai-2.5-27B-PTQ1_0-mtp.gguf
929560ec9d37cf3cadd4b00cc87b51c570082a628dd830b4692dc0b2ed18dbbe Ternary-Bonsai-2.5-27B-PTQ1_0.gguf
84496171ca79d4d33fb45612a2afd8303ec494baf916281023b7dc9cb3b3b9fa Ternary-Bonsai-2.5-27B-Q2_0.gguf
Keep the Q2_0 digest handy. It comes back in Step 4, where it is the quickest way to prove which file an Ollama tag really downloaded. The repo also has mmproj files (a Q8_0 one of about 629 MB and a BF16 one), which you only need for image input.
Step 2: Run Ternary Bonsai 2.5 27B Q2_0 on stock llama.cpp
Start with a benchmark, since it tells you in under a minute whether the CUDA backend picked up the file. We ran prefill at 512 and 2,048 tokens and a 128 token decode, three repetitions each.
cd ~/bonsai
LD_LIBRARY_PATH=stock ./stock/llama-bench -m models/Ternary-Bonsai-2.5-27B-Q2_0.gguf -ngl 99 -fa 1 -p 512,2048 -n 128 -r 3
llama-bench reports the architecture as qwen35, which is how upstream labels the Qwen3.8 hybrid attention layout this model inherits:

Decode landed at 86.78 t/s with a spread of only 0.08, so the result is stable. Next, start the server with the sampling PrismML recommends for thinking mode. Pay attention to --min-p 0: llama.cpp defaults min_p to 0.05, and the model card asks you to switch it off.
LD_LIBRARY_PATH=stock ./stock/llama-server -m models/Ternary-Bonsai-2.5-27B-Q2_0.gguf \
-ngl 99 -fa on -c 32768 -np 1 \
--min-p 0 --temp 1.0 --top-p 0.95 --top-k 20 --jinja --port 8080
The -np 1 flag is worth the attention. Without it, llama-server picks its own parallelism and starts four slots that share one unified KV cache, which you can see in the startup log of each run:
== q2_0-c32768-npauto
srv load_model: initializing, n_slots = 4, n_ctx_slot = 32768, kv_unified = 'true'
== q2_0-c32768-np1
srv load_model: initializing, n_slots = 1, n_ctx_slot = 32768, kv_unified = 'false'
Those four slots cost 450 MiB at both context sizes we tried: 9,308 vs 8,858 MiB at 8K, and 10,868 vs 10,418 MiB at 32K. On a 24 GB card nobody notices, but on an 8 GB or 10 GB card 450 MiB is the difference between full offload and spilling layers to the CPU. The model card lists this as a known issue and quotes an RTX 3080 owner who went from 9.5 GB to 7.8 GB with the same flag. If you serve one user, always pass -np 1.
Step 3: Run PTQ1_0 and the MTP build on the PrismML fork
The fork exists because stock llama.cpp has no kernel for the PTQ1_0 or PQ2_0 packings yet. To see what that looks like, we pointed the stock b12999 build at the PTQ1_0 file first:

Type 143 is the fork’s PTQ1_0 tensor type, and stock builds only know types 0 through 43, so the loader stops before allocating anything. That is a clean failure, which is better than the silent garbage an old build gives on Q2_0. Swap to the fork binary and benchmark both files side by side:
LD_LIBRARY_PATH=prism ./prism/llama-bench -m models/Ternary-Bonsai-2.5-27B-PTQ1_0.gguf -m models/Ternary-Bonsai-2.5-27B-Q2_0.gguf -ngl 99 -fa 1 -p 512,2048 -n 128 -r 3
The fork names the packing in the model column, so you can confirm it read the file as ternary at 1.75 bpw:

PTQ1_0 decoded at 110.92 t/s, close to the 112 t/s PrismML publishes for a 4090. One detail surprised us: the same Q2_0 file ran at 92.32 t/s on the fork against 86.78 on stock b12999, while its prefill was about 10% slower on the fork. If you have to stay on Q2_0 for Ollama compatibility, the stock build is the one to keep for long prompts.
The MTP variant adds a multi token prediction head that drafts tokens for the main model to verify. The Bonsai demo speculative decoding notes give the CUDA flags; we added --spec-draft-n-min 0 on top of them:
LD_LIBRARY_PATH=prism ./prism/llama-server -m models/Ternary-Bonsai-2.5-27B-PTQ1_0-mtp.gguf \
-ngl 99 -fa on -c 32768 -np 1 \
--min-p 0 --temp 1.0 --top-p 0.95 --top-k 20 --jinja --port 8080 \
--spec-type draft-mtp --spec-draft-n-min 0 --spec-draft-n-max 3 --spec-draft-p-min 0.1
Across our five test prompts, generation ran between 179.3 and 239.7 t/s, against 109.2 to 109.7 t/s for plain PTQ1_0 on the same prompts. That is roughly a 2x gain, a bit above the 1.5 to 1.8x PrismML quotes for NVIDIA, and it tracked the acceptance rate closely. The Python prompt had 819 of 996 drafted tokens accepted and ran at 218.9 t/s, while the bash prompt accepted only 635 of 1,062 and ran slowest at 179.3 t/s.
MTP costs VRAM: 8,154 MiB at 8K and 9,810 MiB at 32K, about 900 MiB above plain PTQ1_0. If you are trying to squeeze into a small card, there is another lever on the fork. Quantizing the KV cache at 32K with -ctk q8_0 -ctv q8_0 brought PTQ1_0 down from 8,886 to 7,926 MiB, and the pq2_0m cache type that only the fork offers took it to 7,204 MiB. We measured those two only for memory, not answer quality, so treat them as a fit test rather than a default.
Step 4: Run Ternary Bonsai 2.5 27B in Ollama
Ollama runs the Q2_0 file and nothing else from this repo, because it bundles stock llama.cpp kernels. The reporter on Ollama issue #19976 notes Q2_0 support from 0.40.6, and the release notes for that version list “gguf: add the q2_0 tensor and file types”. We installed v0.40.21 from the release tarball, which is zstd compressed:
sudo apt-get install -y zstd
curl -sSL -o ollama-linux-amd64.tar.zst https://github.com/ollama/ollama/releases/download/v0.40.21/ollama-linux-amd64.tar.zst # pin: build tested for this guide #https://github.com/ollama/ollama/releases/tag/v0.40.21
sudo tar --zstd -xf ollama-linux-amd64.tar.zst -C /usr
ollama serve
Leave ollama serve running in one terminal and use a second one for the pulls. There are three ways to get the model in, and the obvious one is broken:
- The
:Q2_0tag: pulls the wrong file - The exact filename tag, or the frob upload: works
- A local Modelfile import: works, and you set the sampling
We tried all three in that order, and the sections below show what each one stored on disk.
Why the :Q2_0 tag fails with “unsupported tensor output.weight size overflows”
Most people try ollama pull hf.co/prism-ml/Ternary-Bonsai-2.5-27B-GGUF:Q2_0 first, and the Ollama section of the model card itself suggests that tag. It downloads, it verifies, and then it refuses to run. Look at the blob size in the capture: 7,253,354,848 bytes is the PQ2_0 file, not Q2_0.

So the error is not a Q2_0 bug in Ollama. The quant tag is matched against filenames by substring, and Q2_0 also matches PQ2_0, so the Hugging Face manifest hands Ollama the fork-only file. That matches what an Ollama maintainer said in #19976: “Not an ollama issue, HuggingFace is sending a manifest that points at the wrong file.” Delete that model with ollama rm and use one of the two routes below.
Pull by exact filename, or use frob/ternary-bonsai-2.5
Naming the full GGUF filename as the tag removes the ambiguity, and a commenter on #19976 confirmed it works. The other shortcut is frob/ternary-bonsai-2.5, a community upload by the same maintainer, posted as a convenience. A community upload of model weights deserves a provenance check, and another commenter on the issue raised exactly that. So we checked the digest ourselves:
ollama pull hf.co/prism-ml/Ternary-Bonsai-2.5-27B-GGUF:Ternary-Bonsai-2.5-27B-Q2_0.gguf
ollama pull frob/ternary-bonsai-2.5
sha256sum ~/bonsai/models/Ternary-Bonsai-2.5-27B-Q2_0.gguf
ollama show --parameters frob/ternary-bonsai-2.5
The frob pull fetched layer 84496171ca79, and the full SHA-256 of the file we downloaded from the PrismML repo starts with the same digest:

The weights in the frob upload are byte-for-byte the PrismML Q2_0 file, and its parameters already set temperature 1, top_k 20, top_p 0.95 and min_p 0. The exact filename pull stored the same blob too, with no parameters block, which means Ollama defaults. Our first cold run on that route loaded in 1 minute 4 seconds and answered the cron prompt with a six field line, 15 0/4 * * * *, after 2,343 tokens of thinking. A warm rerun with the same defaults answered 15 */4 * * * at 82.10 t/s, and a second ran at 82.52 t/s, so one bad sample is not proof the defaults hurt, but we would not leave sampling to chance.
Import the GGUF with a Modelfile
The route we would use is a local Modelfile, because you control the sampling and the context size and you already verified the hash of the file in Step 1. Create the Modelfile in the models folder:
cd ~/bonsai/models
vim Modelfile
Add these lines. The num_ctx value keeps the KV cache to 16K; raise it if your card has room.
FROM ./Ternary-Bonsai-2.5-27B-Q2_0.gguf
PARAMETER temperature 1.0
PARAMETER top_p 0.95
PARAMETER top_k 20
PARAMETER min_p 0
PARAMETER num_ctx 16384
Then build and run it:
ollama create bonsai27b-q2 -f Modelfile
ollama run --verbose bonsai27b-q2 "Write the crontab schedule for a job that runs at minute 15 of every 4th hour, starting at midnight. Reply with the schedule line only."
ollama ps
Because the frob and exact filename pulls already stored the blob, ollama create reused the layer instead of copying 7.7 GB again:

The answer was correct, 15 */4 * * *, and decode ran at 82.29 t/s, the same speed llama-server gave on this file. Total VRAM was 9,574 MiB at 16K context, against 11,482 MiB for the exact filename pull, which ran at 32K because Ollama sizes its default context from VRAM. The Ollama context length docs give 4K under 24 GiB, 32K from 24 to 48 GiB and 256K above that, so on a 12 GB card you get 4K unless you set num_ctx. For more Ollama commands, such as ollama ps or keeping a model loaded, see our Ollama commands cheat sheet.
Step 5: Will it fit a 12 GB or 8 GB card?
We did not have a 12 GB or 8 GB card, so we measured the next best thing: how much VRAM each configuration actually uses, and what happens to speed as you push layers onto the CPU with -ngl. The sweep used Q2_0 on stock b12999 at 8K context with -np 1. Our CPU is an old 4 core i7-7700, so a faster desktop CPU will lose less speed when layers spill, but the shape of the curve will not change.

The cliff is steep. Decode is 82.47 t/s with every layer on the GPU and 14.31 t/s at -ngl 56, which keeps nearly everything on the card and still saves only about 1 GB. Pushing more layers off keeps sliding: 8.45 t/s at 48 layers, 5.80 at 40 and 3.07 at 16. The rule that falls out of this is simple: the model is usable only when it fits completely, so plan for full offload.
For a 12 GB card the answer is yes, every Bonsai configuration we ran on llama-server fits fully. The largest was Q2_0 at 32K with the default four slots, at 10,868 MiB total on our box. Ollama at 32K was the tightest run of all, at 11,482 MiB, so on 12 GB keep Ollama at 16K as in the Modelfile above. Qwen3.8-27B at Q4_K_M does not fit: at -ngl 32 it used 10,866 MiB and decoded at 2.5 t/s, which is not something you would use interactively.
For an 8 GB card it is tight. PTQ1_0 at 8K with -np 1 measured 7,326 MiB total, and about 605 MiB of that was the idle baseline on our machine, so the model itself used about 6,720 MiB, roughly 6.6 GiB. On a card that also drives your desktop, budget for whatever your display server already uses. Q2_0 at full offload measured 8,858 MiB total, which will not fit an 8 GB card, and the sweep shows what partial offload costs. If you are still picking hardware, our guide to the best GPU for local LLMs lays out the VRAM tiers.
Step 6: Bonsai 2.5 vs Qwen3.8 27B Q4 on the same prompts
Speed is easy to measure; quality loss is what you actually worry about with ternary weights. We sent the same five prompts to each build through llama-server with the sampling settings from the model card at 32K context. Each prompt has a checkable answer:
- A Python nginx log parser with an assert
- A tool call to read the hostname
- A one-line bash command for the 5 largest files
- A crontab schedule
- JSON extraction
We ran each Python answer as written, in an isolated interpreter, rather than eyeballing it. The baseline file is Qwen3.8-27B-Q4_K_M.gguf from the ggml-org/Qwen3.8-27B-GGUF repo on Hugging Face, SHA-256 starting 53c76c79. The results are in the table below.
| Prompt | Bonsai Q2_0 | Bonsai PTQ1_0 | PTQ1_0-mtp | Qwen3.8 Q4_K_M |
|---|---|---|---|---|
| Python parser, assert run | Pass | Pass | Pass | Pass |
| Tool call for hostname | One call, three commands | Two calls | One call | One call |
| Largest files in /var/log | Correct | Correct | Correct | Correct |
| Cron at :15 every 4th hour | 15 0,4,8,12,16,20 * * * | 15 */4 * * * | 15 0-20/4 * * * | 15 0/4 * * * |
| JSON extraction | Correct | Correct | Correct | Correct |
| Wall time, all 5 prompts | 31.3 s | 31.8 s | 18.8 s | 56.1 s |
All three Bonsai builds gave usable answers on all five prompts. The cron row is the interesting one, and it went the other way from what you might expect. The crontab(5) man page documents step values only after a range or an asterisk, as in 0-23/2 or */2, so the Bonsai answers are all valid, while the Qwen answer 0/4 relies on syntax the man page does not document. Five prompts cannot rank models, but they are enough to say the ternary build did not fall apart on code, tools or structured output.
Look at the wall time row too. PTQ1_0 decodes about 33% faster than Q2_0, yet it took slightly longer over the five prompts because it generated 3,168 tokens against 2,397 for Q2_0, mostly in longer reasoning. Faster tokens do not guarantee faster answers when the model thinks more. MTP cuts the total to 18.8 seconds, and the Q4_K_M baseline took 56.1 seconds. Here is the benchmark for the baseline on the same card:

Qwen at Q4_K_M is an 18.06 GiB file that decodes at 44.49 t/s and needs 21,252 MiB at 32K, so on 24 GB it works but leaves little headroom. If you have a 24 GB card and would rather run the base model, our Qwen3.8 27B local setup is the comparison point. If you want to compare runtimes rather than quantizations, the Ollama, vLLM and llama.cpp comparison covers that choice.
What broke on the way
Four things failed during the run, and each one has an error you can search for. None of them were bugs in the model itself; two are about which file or build you point at it.
error while loading shared libraries: libgomp.so.1
Both the stock and fork binaries link against the GNU OpenMP runtime, and the Ubuntu image we rented did not have it. Install libgomp1 with apt and both binaries start. You will hit this on most minimal container and cloud images, so it is worth adding to whatever script provisions your box.
tensor ‘output.weight’ has invalid ggml type 143
This means you loaded a PTQ1_0 file into stock llama.cpp, or into a tool that bundles stock kernels, such as Ollama. Either switch to the PrismML fork or download Q2_0 instead. Until the PTQ1_0 support PrismML is upstreaming gets merged, this error is expected on every stock build.
unsupported tensor “output.weight” size overflows
This is the Ollama :Q2_0 tag pulling the PQ2_0 file, as Step 4 shows. Check with ls -l ~/.ollama/models/blobs/: a 7,253,354,848 byte blob is the wrong file, while the right one is 7,673,194,848 bytes. Remove the model and pull it by exact filename or import it with a Modelfile.
A slow, rambling first Ollama answer
Our first Ollama run took 2 minutes 11 seconds and reported 58.31 t/s, mostly because the model took over a minute to load cold and then reasoned for 2,343 tokens. Once warm, load time dropped to about 5 seconds and decode matched llama-server at 82 t/s. Judge speed on the second run, and set the sampling parameters from the model card rather than trusting defaults. Why would you benchmark a model that is still reading itself off the disk?
What we would run on our own card
On any NVIDIA card with 12 GB or more, we would run PTQ1_0-mtp on the PrismML fork with -np 1. It was the fastest build we measured by a wide margin, and it still fit in under 10 GB at 32K. If you need stock binaries, Ollama or a tool that only speaks upstream GGUF, Q2_0 on stock llama.cpp is the safe pick and still decodes about twice as fast as Q4_K_M. On an 8 GB card, try PTQ1_0 at 8K first, and quantize the KV cache before you think about partial offload, because the sweep shows how fast speed collapses once layers leave the GPU.
If ternary 27B is still too heavy for your hardware, smaller local models are covered in our guides to running Inkling 2 Mini locally and Qwen3.8 Flash Next on your own machine.