How to Run Ternary Bonsai 2.5 27B Locally on Your Own GPU
Run Prism ML's Ternary Bonsai 2.5 27B locally: clone the repo, run setup, start llama-server. File size is 5.93 GB, and VRAM use was about 14 GB in testing.
For Engineering and IT

How do you run Ternary Bonsai 2.5 27B on your own GPU?
Clone Prism ML's Bonsai-demo repository, run the setup script it ships (which downloads the model and installs prerequisites), then start the model with llama-server. The model file is 5.93 GB, but VRAM use was higher in testing, at about 14 GB with the context length used. In one hands-on test with a 48 GB workstation GPU, the model used about 14 GB at the context length tested. That makes a GPU with 16 GB or more the realistic target. The model card does not publish a minimum VRAM figure.
TL;DR
- Ternary Bonsai 2.5 27B is a 27-billion-parameter model from Prism ML, built on Qwen3.8-27B, that shrinks to 5.93 GB on disk.
- In a hands-on test, the running server used about 14 GB of VRAM at the tested context length, so the file size alone understates what you need.
- Setup is clone the repo, run the setup script, start llama-server. Prism ML says its Bonsai-demo repo is the source of truth and is kept current.
- Use the PTQ1_0 file on NVIDIA GPUs, PQ2_0 on Apple Silicon, and Q2_0 only with a recent stock llama.cpp.
- It handled a real bug fix, math, and document extraction well in testing, but failed a multilingual handwriting task and invented a detail in a long creative answer.
- If you serve one user at a time on a small GPU, add
-np 1to the server command to avoid extra VRAM use.
What is ternary Bonsai 2.5 27B?
It is a language model whose weights are stored in a very compressed form. Most models store each weight (one of the billions of numbers that make up the model) as a detailed number. In this model, every weight is one of three values: -1, 0, or +1. Each group of 128 weights shares one scaling number. That is called ternary, and it brings the average cost to 1.76 bits per weight.
The result is a 27.36B-parameter model (language, vision tower, embeddings) in 5.93 GB. It keeps the Qwen3.8-27B hybrid-attention design, supports up to 262K tokens of context, and ships under the Apache 2.0 license. This release is aimed at agentic work: tasks where the model calls tools, edits code, and works through many steps.
It has two reasoning levels: xhigh (the default, most accurate) and medium (shorter answers, better balance of speed and accuracy). The model card says low is not supported.
What hardware do you need?
The card lists the backends: llama.cpp (CUDA, Metal, CPU, SYCL) and MLX on Apple Silicon. It does not give a minimum VRAM number, so here is what is known and what is inference.
- Weights: 5.93 GB for the PTQ1_0 file.
- Observed running footprint: about 14 GB of VRAM in a hands-on test, at the context length that tester used, on a 48 GB GPU.
- Context costs memory. The model supports 262K tokens, but a longer context needs more memory. The card's examples use 32,768.
- Vision is optional. The vision tower ships as a separate
mmprojfile that loads only for image input, so text-only use skips it.
Treat 16 GB of VRAM as the sensible starting point for GPU use, and expect to lower the context if you hit a limit. That is a judgment call, not a published spec. You can also run on CPU with -ngl 0, though it will be much slower.
How do you set it up step by step?
Prism ML's model card says the Bonsai-demo repo has the tested setup for every backend, pinned binaries, and run scripts. Follow it over any blog post, including this one, because it changes as the runtimes change.
- Clone the repo. Get https://github.com/PrismML-Eng/Bonsai-demo with git.
- Run the setup script described in its README. In the test we are drawing on, this one step downloaded the model and installed the prerequisites.
- Start the server with the llama-server run script from the repo. It picks flags for your hardware.
- Open the llama.cpp web interface to chat, or point an agent tool at the server. The tester connected it to Hermes Agent.
If you would rather set things up by hand, the model card gives these commands. Download the NVIDIA-friendly file:
hf download prism-ml/Ternary-Bonsai-2.5-27B-gguf Ternary-Bonsai-2.5-27B-PTQ1_0.gguf --local-dir .
Run a quick test:
./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
Here -ngl 99 puts every layer on the GPU, -c sets the context, and --min-p 0 overrides llama.cpp's default of 0.05. Keep -n large (16384 here). The model thinks before it answers, and a cap like 256 tokens stops it mid-thought with no answer.
Which file should you download?
| File | Runs on | Best for |
|---|---|---|
| PTQ1_0 | Prism ML's llama.cpp fork | NVIDIA GPUs. Smallest file (5.93 GB) and faster decode on every NVIDIA GPU measured |
| PQ2_0 | Prism ML's llama.cpp fork | Apple Silicon. The format benchmarked on Metal |
| Q2_0 | Stock llama.cpp (build b11556 or newer) | People who want to avoid the fork |
Check your build if you use stock llama.cpp. The card warns that older builds load Q2_0 with no warning and produce garbage. Run llama-cli --version first. PTQ1_0 and PQ2_0 will not load at all in stock llama.cpp.
The MTP variants add a draft head that guesses several tokens ahead so the main model can check them. Prism ML says this speeds up decoding by 1.5 to 1.8 times on NVIDIA GPUs.
Why is VRAM higher than the file size?
Three things add to the weights: the context cache, the compute buffers, and the server's parallel request slots. The model card lists a known issue here. If you use the Prism llama.cpp server for one request at a time on a GPU with limited VRAM, add -np 1 to your llama-server command. That stops the server from reserving memory for several simultaneous requests. If you are one person on one card, add it.
How well does it actually work?
Prism ML's published numbers are strong for the size. Across five tool-calling benchmarks, Bonsai 2.5 averages 77.2 against 77.7 for FP16. On agentic coding it keeps about 90% of FP16, with SWE-bench Verified at 75.6. General capability averages 82.1 against 84.3. These are the vendor's own figures, so treat them as a starting point.
Here is what one hands-on test found, using Hermes Agent as the harness:
- Bug fix: In a made-up health dashboard, outbreak alerts never fired because the alarm baseline included the current week's spike. The model confirmed the bug and delivered a one-line fix in about 10 minutes, without looping or breaking its reasoning. The alerts then showed correctly.
- Math from an image: Both the first problem and a harder follow-up came back correct.
- Document extraction: Given a printed land transfer document, it returned a JSON object where all seven fields matched the page.
- Image to code: Asked to turn a sketch of a kebab cone into a single HTML file, it took around 15 minutes and produced an average result. The tester called it acceptable for a ternary model.
- Multilingual handwriting: Mostly failed. It quoted a line not on the note, mislabeled languages, and garbled many translations.
- Long creative answer: Well written, but it invented a doorway scene that was not in the photo.
The pattern is clear. Structured, checkable work (fixing code, extracting fields, solving a problem) went well. Open-ended image reading and rare languages did not. The tester also doubted the 90% coding figure, saying their own impression was lower, though they did not measure it.
What does this mean for you?
If you work with sensitive data, a model that fits on one workstation GPU means documents, contracts, and internal code can stay on your own machine. The document extraction test is the closest match: pull fields out of a page into JSON, with nothing leaving the building.
If you are a developer or an analyst who scripts things, this is a cheap way to try an agent that edits code and calls tools without paying per token. Start with a small, well-defined task, like the one-line bug fix above.
If you are not technical, you do not need to run this yourself. But it shows where things are heading: models that were data-center only two years ago now fit on a gaming-class card. Ask your IT team whether a local model could cover tasks where you currently avoid cloud AI for privacy reasons.
What to do first:
- Check your GPU's VRAM. Aim for 16 GB or more.
- Follow the Bonsai-demo README, not an old guide.
- Add
-np 1for single-user serving. - Test on your own tasks before trusting benchmarks. Verify anything it extracts or claims about an image.
Could a local model like this power a small internal tool?
Yes, and that is where a model like this gets practical. A single model answering in a chat window is a demo. A tracker, dashboard, or request form that uses it is a tool people can use. If you want the app around the model without hand-building it, Remy builds and deploys full-stack apps from a plain-English description, with a database, sign-in, and hosting included. Its AI settings can also reach local models over a secure tunnel. A simple example is an intake form that sends documents to your own model for field extraction and stores the results in a table your team can search.
Frequently Asked Questions
Is Ternary Bonsai 2.5 27B really 6 GB?
The PTQ1_0 file is 5.93 GB. That is the file on disk. Running it takes more memory, and a tester saw about 14 GB of VRAM at their context length.
Can I run it on a Mac?
The model card lists Apple Silicon support through llama.cpp with Metal and through MLX. Prism ML benchmarked the PQ2_0 file on Metal, so use that one. Check Bonsai-demo for the current setup.
Why does my output stop before it answers?
The model reasons before it answers, and the default xhigh effort uses many tokens. If your token limit is too low, such as 256, generation ends mid-thought. The card suggests a limit like 16384 for testing.
Can it read images?
Yes, with the separate mmproj file for the vision tower. In testing it handled a math image and a printed document well. It struggled with handwritten multilingual text and invented a detail in one scene description.
What license does it use?
Apache 2.0, according to the model card.
Useful for
How we source, write, and correct our articles. Editorial standards



