Bonsai 2.5: 27B model squeezed into 6 GB is now much better at coding
Startup PrismML has released Ternary Bonsai 2.5 27B, an extremely compressed Qwen3.8 model weighing just 5.9 GB that even runs on laptops. It's much better than its predecessor at agentic coding and tool use. An early independent test also found it works about twice as fast.

What's going on
Pasadena, California-based startup PrismML released Ternary Bonsai 2.5 27B on November 24, 2026. It's a heavily compressed version of the Qwen3.8 27B language model designed to run on ordinary machines: gaming PCs with Nvidia graphics cards, Macs and, according to the company, even iPhones and iPads. In its most compact form, the weights take up just 5.93 GB, while the original model needs 53.8 GB, more than nine times as much.
That's the same size as its predecessor, Bonsai 2, which PrismML unveiled in September. What's new, according to the company, is that the model performs much better on agentic tasks. These are tasks where an AI works through multiple steps on its own: reading files, changing code, running tests, reacting to errors. The weights are available as a free download under the Apache 2.0 license and can be used commercially.
PrismML has made headlines before. According to 9to5Mac, its 1-bit Bonsai 27B model, at about 4 GB, became the first model of that size to run on an iPhone back in July. CEO Babak Hassibi told CNBC that Apple was evaluating the technology.
How to fit 27 billion parameters into 6 GB
Normally, every weight in a model is stored as a 16-bit number. Bonsai instead uses ternary weights: each weight can take only one of three values, −1, 0 or +1. To avoid losing too much information, each group of 128 weights shares a common scaling factor. That factor works like a volume knob, bringing the coarse values up to the right order of magnitude. At its densest packing, PrismML gets down to 1.76 bits per weight.
The model has 27.36 billion parameters in total, including its image-processing component (the vision tower). So it can handle images too. The context window, meaning the amount of text the model can keep track of at once, goes up to 262,144 tokens. How much of that you can actually use depends on your available memory, since a long context takes up additional RAM.
PrismML explains why compressed models struggle with agentic tasks in particular: small errors add up over many tool calls until the agent loses sight of its goal or keeps repeating failed attempts. For Bonsai 2.5, the company says it therefore focused on how the model processes feedback from tools, recovers from failed steps and avoids unnecessary overthinking.
"Getting a capable model onto a device is only part of the challenge. It also has to stay effective across all the decisions a real, complex task requires." – Babak Hassibi, CEO of PrismML
Benchmarks: a big leap, but not across the board
All of the following figures come from PrismML's own evaluation. Testing was done on Nvidia H100 GPUs with the vLLM server at the highest reasoning level (xhigh).
| Benchmark | Qwen3.8 27B (FP16) | Bonsai 2 27B | Bonsai 2.5 27B |
|---|---|---|---|
| SWE-bench Verified | 80.6 | 60.8 | 75.6 |
| DeepSWE v1.1 | 30.1 | 0.0 | 27.0 |
| Terminal-Bench 2.1 | 70.8 | 52.8 | 60.1 |
| AppWorld | 93.2 | 51.2 | 90.5 |
| τ³-Bench | 72.8 | 69.1 | 73.9 |
| BigCodeBench | 61.5 | 57.2 | 60.3 |
| LiveCodeBench v6 | 87.6 | 83.8 | 83.0 |
SWE-bench Verified tests whether a coding agent can resolve real GitHub issues. Here, Bonsai 2.5 gains 14.8 percentage points. AppWorld, where an agent completes tasks through simulated app interfaces, jumps 39.3 points. Averaged across the three coding-agent tests, the new model scores 54.2 instead of 37.9, and on the tool-use tests 82.2 instead of 60.2. LiveCodeBench v6, on the other hand, dips slightly, and on Terminal-Bench 2.1 the uncompressed Qwen still leads by 10.7 points. Techgenyz points out that independent verification is lacking. According to Kingy, PrismML's claim that Bonsai 2.5 is the best Qwen3.8 version under 10 GB only covers selected compressions of the same base model. PrismML explicitly says it hasn't yet tested very long tasks spanning multiple context windows.
Independent test: done twice as fast
Kingy compared the two models on a MacBook Pro with an Apple M4 Pro and 24 GB of memory, using llama.cpp b12359 and the official Q2_0 files. Each model had to fix three small Python bugs, with two attempts each. Both passed all six attempts, including the held-out tests the model couldn't see beforehand. But Bonsai 2.5 was faster in every single run:
| Result | Bonsai 2 | Bonsai 2.5 |
|---|---|---|
| Passed attempts | 6/6 | 6/6 |
| Median time per attempt | 118.7 s | 58.5 s |
| Median tokens generated | 2,115.5 | 764.5 |
| Median model turns | 5 | 4 |
That's 51 percent less time and 64 percent fewer tokens. Kingy adds a caveat: the tasks were small, and both models were already hitting the ceiling. How well the model handles harder tasks remains an open question.
On speed, PrismML's whitepaper lists these figures: 186 tokens per second on an H100, 112 on an RTX 4090 (PTQ1_0 format) and 30.2 on an Apple M5 Pro (PQ2_0 format). Speculative decoding makes it faster. With this technique, a small extra model component proposes several words in advance, and the main model only has to verify them. In a server test, the H100 hit 282 instead of 184 tokens per second, and the RTX 4090 204 instead of 111. The 291 tokens per second touted in the announcement rely partly on compute kernels that are still being tested. The add-on also has a downside: on the RTX 4090, prompt processing speed for a long prompt dropped from 2,808 to 2,166 tokens per second.
What you need to try it
There are three GGUF variants. GGUF is the file format that llama.cpp, Ollama and LM Studio read:
- PTQ1_0 – 5.99 GB, the smallest, recommended by PrismML for Nvidia, but requires PrismML's own llama.cpp build.
- PQ2_0 – 7.25 GB, also only works with the PrismML build, tested on Apple Metal.
- Q2_0 – 7.67 GB, runs on standard llama.cpp from version b11556 onward. According to PrismML, older versions will load the file but output garbage.
Optionally, there's about 0.24 GB extra for speculative decoding (MTP), plus a separate vision file for image input at 0.63 GB (Q8) or 0.93 GB (BF16). For Macs, there's an MLX package. Kingy lists 8.60 GB for the main file, while 9to5Mac and Techgenyz put it at about 8.9 GB.
Actual memory use is higher than the file size. In a community test on a 10 GB RTX 3080, the model used around 9.5 GB of VRAM. After limiting the server to one concurrent request, it dropped to about 7.8 GB. Realistically, you'll need a graphics card with 8 to 10 GB of VRAM or an Apple Silicon Mac with at least 16 GB, ideally 24 GB, of unified memory. Budget about 10 GB of disk space. According to Techgenyz, the model also works with Ollama and LM Studio. If an app ships with its own llama.cpp core, check its version first. According to Kingy, it hasn't been confirmed yet whether the 27B model actually runs on iPhones and iPads.
The bigger picture
Bonsai 2.5 is one of the most interesting attempts yet to bring a genuinely useful coding model to everyday hardware. A 27-billion-parameter-class model that fits in under 8 GB of VRAM and, according to the company, trails the original by only 5 points on SWE-bench is remarkable. In practice, that means a coding assistant can search a private repository, change code and run tests without any code going to a cloud service. There are still limits. The benchmarks come from the company itself. The smallest variant needs a custom llama.cpp build. It still falls noticeably short of the original in some areas, such as Terminal-Bench. And local doesn't automatically mean safe, as Techgenyz stresses: an agent with file access can do damage too. The big cloud assistants still lead at the top end. But if you want to work locally with no ongoing costs, Bonsai 2.5 is worth a try.
Related videos
Sources
- Google News (US) kingy.ai
- finance.yahoo.com finance.yahoo.com
- techgenyz.com techgenyz.com
- 9to5mac.com 9to5mac.com
- dev.to #ai dev.to
- dev.to #ai dev.to
Try it yourself: Ternary Bonsai 2.5 27B
Explained step by step, no prior knowledge needed – on your own computer or free in your browser.
What can I do with it?
Bonsai 2.5 is a compressed Qwen3.8 27B model built to serve as a local coding assistant. It can read code in a project, find bugs, edit files, run tests and keep working based on the results. It also handles document work, such as analyzing a folder of files, reconciling conflicting information or preparing recurring reports. With an extra vision file, it understands images too. According to the company, it scores 75.6 percent on SWE-bench Verified, compared with 80.6 percent for the uncompressed original. So it's not quite as strong as the full model, and not as strong as the big cloud assistants either. In return, it needs only about a ninth of the memory, and your code and data stay on your own machine. In an independent test on a MacBook, it reliably solved small Python tasks about twice as fast as its predecessor.
Who is it worth it for?
Worth it for developers and tinkerers with a graphics card that has at least 8 to 10 GB of VRAM, or an Apple Silicon Mac with 16 to 24 GB, who want a free, private coding agent. If you only chat occasionally or have a weak laptop with little memory, you're better off with smaller models or cloud services.
Ideas: What you can do with it
Have the model investigate an error message in a local Git project, fix the code and run the tests. You get a finished patch you can review and merge. Your code never leaves your machine.
Give the model several spreadsheets or text files, such as bank statements and invoices. It finds inconsistencies and produces a clear list of discrepancies, ideal for sensitive financial data.
Describe in plain language what you want automated, for example renaming photos by date or creating backups. The model writes the script and explains it step by step.
Paste in someone else's code or legacy code and have it explained line by line. That helps beginners learning to program and pros getting up to speed on unfamiliar projects.
Set up a folder of notes or meeting minutes and have the model turn them into a structured summary. You can repeat the process every week and get routine reports done faster.
With the vision file, the model can look at images, such as a screenshot of an error message or a chart. It describes the content or suggests a fix.
What your computer needs
Values estimated from the model size – the Model Card may have more precise figures.
Which variant is right for me?
Many models come in several sizes or "quantizations." These are compressed versions: smaller and faster, but slightly less accurate. Rule of thumb: pick the largest variant whose memory requirement fits in your VRAM (video memory). The scripts below choose this for you automatically.
| Variant | Download | Needs approx. | Compatible graphics cards |
|---|---|---|---|
4-bit (Q4) Default |
16 GB | 20 GB | e.g. RTX 3090, RTX 4090, Tesla P40 |
8-bit (Q8) |
29 GB | 34 GB | e.g. 2× RTX 3090/4090 or RTX A6000 |
16-bit (Original) |
55 GB | 62 GB | e.g. multiple professional GPUs (2× A6000, H100) or DGX Spark |
For beginners: Q2_0 (7.67 GB). It runs on standard llama.cpp from version b11556 onward, and therefore in current tools as well. For Nvidia cards with limited memory, PrismML recommends PTQ1_0 (5.99 GB), but it requires PrismML's own llama.cpp build. On Apple Macs, PQ2_0 (7.25 GB, also PrismML build only) was tested. Alternatively, there's the MLX package at around 8.6 to 8.9 GB. For image input, also download the vision file (0.63 GB Q8 or 0.93 GB BF16). The MTP files (+0.24 GB) add speculative decoding and thus more speed.
- A community test on an RTX 3080 (10 GB) measured around 9.5 GB of VRAM use, or about 7.8 GB with just one concurrent request slot.
- According to PrismML, PTQ1_0 reaches about 112 tokens per second on an RTX 4090 and 186 on an H100. With speculative decoding, up to 204 is possible on the RTX 4090.
- On an Apple M5 Pro, PrismML lists 30.2 tokens per second with PQ2_0. Kingy successfully tested the model on an M4 Pro with 24 GB.
- The context window goes up to 262,144 tokens, but every bit of extra context costs memory. On smaller cards, cap the context, e.g. at 8,000 to 16,000 tokens.
- Supported hardware includes Nvidia and Intel GPUs via llama.cpp, plus Mac, iPhone and iPad via MLX. Whether the 27B model actually runs on iPhone or iPad hasn't been confirmed yet.
- Budget about 8 to 10 GB of disk space for the model and vision file.
How do I find out what my computer has?
- Windows: Press Ctrl + Shift + Esc → Task Manager → Performance tab → click GPU on the left. At the bottom you'll see Dedicated GPU memory (that's your VRAM). You'll find system memory under Memory.
- Mac: Apple menu at the top left → About This Mac. You'll see your chip (e.g. M2) and memory (e.g. 16 GB). On Apple chips, graphics and processor share this memory.
- Linux: Type
nvidia-smiin the terminal (shows your graphics card and its memory) andfree -hfor system memory.
Guide
Google Colab (in your browser, no installation)
Google Colab is a free service from Google. It gives you a computer with a graphics card in your browser for a few hours. All you need is a Google account. For this model: Colab Pro only – needs the L4 GPU (22.5 GB); the free T4 is too small.
- Download the notebook. Click the button and save the file.
- Open Colab. Go to colab.research.google.com and sign in with your Google account.
- Upload the notebook. In the window that appears, click Upload on the left (or choose File → Upload notebook at the top) and select the file
colab.ipynb. - Turn on the GPU. In the top menu, go to Runtime → Change runtime type → under Hardware accelerator, select T4 GPU (with Colab Pro: L4 or A100) → Save.
- Start everything. Runtime → Run all (keyboard shortcut Ctrl + F9). If you see the warning “This notebook was not authored by Google,” click Run anyway.
- Wait. The cells run one after another. A green checkmark appears to the left of each cell when it's done. Installation and download take about 9 minutes here.
- Try it out. The result appears below the last cell. To test something else, change the text in the cell and run it again with Shift + Enter. The last cell starts a proper chat with an input field.
- Clean up. When you're done: Runtime → Disconnect and delete runtime. This saves your free quota.
Good to know: The free GPU is limited (usually a few hours per day). After about 90 minutes of inactivity, Colab disconnects, and you'll have to start everything over.
Windows 10 / 11
The easiest way is Ollama, a free program that launches AI models with a single command.
- Update your graphics driver (NVIDIA cards only): Install the NVIDIA app or the latest driver. For AMD cards, use the latest Adrenalin driver.
- Install Ollama. Download the file OllamaSetup.exe from ollama.com/download/windows, double-click it, and choose Install. Afterward, a small llama icon appears in the taskbar at the bottom right.
- Open a terminal window. Press the Windows key, type PowerShell and press Enter. A blue or black window opens.
- Start the model. Copy this command ("Copy" button), paste it into the window with a right-click, and press Enter:
The first time, Ollama downloads the model (16 GB (about 22 min at 100 Mbit/s)). After that, it's instant.ollama run hf.co/drofn/Ternary-Bonsai-2.5-27B-8GB - Start typing. Once
>>> Send a messageappears, type your question and press Enter. Type/byeto end the chat.
Not enough memory? Pick a smaller variant from the table above, e.g. ollama run hf.co/drofn/Ternary-Bonsai-2.5-27B-8GB.
Prefer automatic? A script that picks the right variant for you
- Download both files into the same folder: try_windows.ps1 demo.py
- Open the folder in File Explorer, right-click an empty spot and choose Open in Terminal.
- Paste this command and press Enter:
powershell -ExecutionPolicy Bypass -File try_windows.ps1
If needed, the script installs Ollama via winget, measures your VRAM (video memory) and downloads the matching variant.
macOS
Macs with an Apple chip (M1 to M5) are ideal. Older Intel Macs are very slow.
- Install Ollama. Download it from ollama.com/download/mac, open the file, and drag Ollama into your Applications folder. Launch Ollama once – a llama appears in the menu bar at the top.
- Open Terminal. Press Cmd + Space, type Terminal, and press Enter.
- Start the model. Paste the command (Cmd + V) and press Enter:
The first time, the model is downloaded (16 GB (about 22 min at 100 Mbit/s)).ollama run hf.co/drofn/Ternary-Bonsai-2.5-27B-8GB - Start typing. Type your question and press Enter. Quit with
/bye.
Linux
- Check your GPU.
nvidia-smishould show your card. If it doesn't, install the driver on Ubuntu and restart:sudo ubuntu-drivers install - Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh - Start the model:
Exit withollama run hf.co/drofn/Ternary-Bonsai-2.5-27B-8GB/bye. Useollama psto check whether the model is running on the GPU. - Or let it pick the right variant automatically:
bash try_linux.sh
Try it
Explain in simple terms what this Python function does and suggest better variable names: [paste code]Write a Python script that reads all CSV files in a folder, merges them and removes duplicate rows.Here's an error message from my project and the affected file. Find the cause, fix the code and write a matching unit test.Analyze these three invoice lists, find conflicting amounts and create a table of all discrepancies.Plan the migration of my small Flask project to FastAPI: list the necessary steps, then modify app.py and explain each change.
Tips for better results
- According to the Model Card, the default reasoning level is xhigh. Switch to medium for faster answers; that's also the setting Kingy's successful test used.
- The MTP add-on (speculative decoding) makes text output noticeably faster. With very long prompts, though, input processing can get slower, so just compare both setups on your own hardware.
- For coding tasks, plug the model into an agent tool that can read files and run tests. Its strength is multi-step work, not one-off chat.
- Start with small, verifiable tasks in your own repository before handing it larger refactors.
- After downloading, check the SHA-256 checksum against the one published by the developer to make sure the file is complete.
If something goes wrong
Garbage or garbled output with Q2_0: your llama.cpp is too old. Use at least version b11556, including in apps that ship their own llama.cpp core.
PTQ1_0 and PQ2_0 don't run on standard llama.cpp, only on PrismML's own build. Beginners are better off with Q2_0.
Images aren't recognized: GGUF requires the separate vision file (mmproj, 0.63 or 0.93 GB), which has to be loaded in addition.
Memory fills up even though the file is small: reduce the context length and the number of parallel requests, e.g. use just one slot on the llama.cpp server.
For the MLX package, the instructions for image input contradict each other. When in doubt, follow the Model Card for the specific download, not the demo README.
With agents that have file access, always work on a copy or in a Git repository and review the changes. Local doesn't automatically mean safe.
“out of memory,” a crash, or your computer freezes
The model is too big for your VRAM (video memory). Pick a smaller variant from the table above and close other programs, especially games and browsers with lots of tabs.
It runs, but extremely slowly
Your CPU is probably doing the work instead of your graphics card. In Ollama, the PROCESSOR column of ollama ps shows how much runs on the GPU. If it says "100% CPU", update your graphics driver or pick a smaller variant that fits entirely into VRAM (video memory).
“ollama” or “python” is not found
Close the terminal window and open it again so it recognizes the newly installed program. For Python on Windows: reinstall it and check Add python.exe to PATH.
Windows: "Running scripts is disabled on this system"
Run the script with exactly the command above: powershell -ExecutionPolicy Bypass -File try_windows.ps1. This allows execution for this one time only.
Error message when loading the model (version, "trust_remote_code", unknown architecture)
Brand-new models often need the latest software version. With Ollama: update Ollama. With Python: pip install -U transformers in the activated environment. The Model Card usually lists the exact version.
Tokenstrom generates the scripts and notebook automatically. Please take a quick look before running them – they're plain, readable text. Mind the model's license: apache-2.0.
Ask the AI assistant
Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.
The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.
Comments
What do you think? Already tried it? Write it here, no sign-up needed.
Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.