Ternary Bonsai 2 squeezes a 9B vision model into just 2.42 GB
Prism ML has compressed Qwen3.5-9B so hard that the vision-language model now weighs in at just 2.42 GB. Every weight can only take one of three values: −1, 0 or +1. That's enough to run a 9B model on laptops, Macs, CPU-only machines and even the iPhone. The software side comes with a few catches, though.

What's going on
AI company Prism ML (also written PrismML) released the Ternary Bonsai 2 model family on October 15, 2026, in 2B, 4B and 9B sizes. The models are built for everyday devices: smartphones, laptops and machines without a powerful GPU. Most of the attention is going to the largest variant, Ternary-Bonsai-2-9B. It's based on Alibaba's Qwen3.5-9B and understands both text and images, which makes it a vision-language model. Its language model has around 8.95 billion parameters and takes up just 2.42 GB on disk in the default version. In the usual 16-bit format (FP16), it would be about 17.9 GB.
All three models are available for download under the permissive Apache 2.0 license in the "Bonsai 2 Small" collection on Hugging Face. According to alphasignal.ai, the 9B repository had more than 896,000 downloads and 3,700 likes at the time of reporting. The site points out, though, that Hugging Face also counts repeated and automated downloads.
How 9 billion parameters fit into 2.42 GB
The trick is ternary quantization. Quantization shrinks a model by storing its numbers at lower precision. Normally, each weight is a 16-bit floating-point number. In Bonsai 2, it can only take one of three values: −1, 0 or +1. To avoid losing too much information, each group of weights shares a common FP16 scaling factor. That factor sets how "loud" the three values are within the group. According to alphasignal.ai, the method covers almost everything: the embeddings (which turn words into numbers), the attention projections, the MLP layers and the so-called LM head, which picks the next word at the end.
On top of that comes a Hadamard rotation. This mathematical rotation is baked into the stored weights. At inference time, the software applies the matching inverse rotation to the intermediate values (activations). This spreads individual extreme outliers across many dimensions. Without this step, those outliers would cause large errors when rounded to three values. Custom compute routines (kernels) read the packed weights directly, without first building a full FP16 copy in memory.
The architecture is unchanged from Qwen3.5. That includes hybrid attention: some layers use efficient linear attention, the rest use classic, compute-heavy attention. That's what makes the large 262,144-token context window affordable in the first place, meaning the amount of text the model can take in at once. The model also includes MTP speculative decoding. The model predicts several tokens at once and then verifies them, which speeds up output. There's also an optional small prediction helper called the "DFlash2 Drafter".
Three file formats, one important trap
Prism ML ships the 9B language model in three GGUF variants. GGUF is the file format used by llama.cpp and many apps built on top of it.
| Variant | File size | What's special | Runs with |
|---|---|---|---|
| PTQ1_0 | 2.00 GB | most densely packed, smallest file | Prism ML fork only |
| PQ2_0 | 2.42 GB | default, fastest to unpack | Prism ML fork only |
| Q2_0 | 2.56 GB | compatible layout | Prism ML fork and stock llama.cpp |
The vision component ships separately and comes on top of these sizes. According to alphasignal.ai, the 7.4x factor applies only to the language weights on disk. At runtime the model needs more memory, because the context cache, compute buffers and runtime overhead add up. If you max out the full 262,000-token context window, you'll need "significantly" more memory, according to the source, and should expect noticeably longer wait times.
OrcaRouter issues a warning in an analysis of the big sibling, Ternary Bonsai 2 27B, and it likely applies to the whole family: stock llama.cpp rejects Prism's own formats as unknown. But it loads an older ternary format without any error message and then produces fluent-sounding nonsense, because the matching activation rotation is missing. So with the wrong software, you don't get a crash. You get confidently wrong answers.
The whole family: from smartphone to desktop
According to GIGAZINE, Prism ML released the three small models together. They use less than one-ninth of the memory of their base models:
| Model | Base | Size |
|---|---|---|
| Ternary Bonsai 2 2B | Qwen3.5-2B | 0.43 GB |
| Ternary Bonsai 2 4B | Qwen3.5-4B | 0.95 GB |
| Ternary Bonsai 2 9B | Qwen3.5-9B | approx. 2 GB (densest variant) |
Prism ML says it specifically optimized the models as local assistants. They're meant to follow instructions reliably, avoid getting stuck in endless loops, call the right tools (tool calling) and skip unnecessary output. In the company's own benchmarks, GIGAZINE reports, the models land only slightly below their base models, and in some tests the compressed versions even come out ahead. These numbers haven't been independently verified.
On speed, Prism ML quotes up to 34 tokens per second for the 9B model on the iPhone 18 Pro Max and up to 120 tokens per second for the 2B model. A demo video shows the 9B model handling agentic tasks on the iPhone, meaning multi-step tasks involving tool use. Adrien Grondin, developer of the free Locally AI app, wrote on X:
"The new Bonsai 2 2B hits up to 120 tokens/s on the iPhone 18 Pro. It's better than Qwen 3.5 2B (4-bit), runs twice as fast and needs almost half the memory."
Locally AI already supports all three models on iPhone and iPad.
What the big sibling tells us
Back in September 2026, Prism ML released Ternary Bonsai 2 27B, a 5.9 GB version of Qwen3.8-27B. Prism ML says it reaches 98.2% of the original's performance (83.9 vs. 85.4 points averaged over 20 benchmarks). OrcaRouter broke down these vendor numbers in more detail. On math, coding and instruction following, the gap is tiny. On knowledge questions and image understanding, it's bigger. On long, multi-step software tasks, though, the model drops off sharply: 60.8 instead of 80.6 points on SWE-bench Verified, and 52.8 instead of 69.7 on Terminal-Bench 2.1. The sources don't include comparable detailed numbers for the 9B variant. But the finding hints at where ternary models may hit their limits.
What you need to try it
- GPU: For the 2.42 GB file, a card with about 4 GB of VRAM is enough if you use a moderate context. Long contexts or image input need more.
- No GPU: According to alphasignal.ai, the small files also run on CPU-only systems and Apple Silicon. For CPU inference, 8 GB of RAM is a reasonable minimum.
- Smartphone: The Locally AI app runs it directly on iPhone and iPad, no PC needed.
- Storage: 2–3 GB for the language model, plus the separate vision file.
- Software: PTQ1_0 and PQ2_0 require Prism ML's llama.cpp fork. With stock llama.cpp or tools built on it, only the Q2_0 file works.
The big picture
Ternary Bonsai 2 shows how far model compression has come: a 9B model that understands images and has a huge context window fits into just under 2.5 GB. That makes local assistants possible on devices that could previously only handle much weaker models, especially smartphones. The permissive Apache 2.0 license also allows commercial use.
There are weak spots, though. All performance numbers come from Prism ML itself. The analysis of the 27B version suggests the average score hides losses on demanding agent and coding tasks. The special software requirement is a real hurdle, and with the wrong app you risk silently wrong results. In the end, only your own testing will tell you whether the model works for your tasks.
Related videos
Sources
- Merkliste: alphasignal.ai alphasignal.ai
- gigazine.net gigazine.net
- orcarouter.ai orcarouter.ai
Try it yourself: Ternary-Bonsai-2-9B
Explained step by step, no prior knowledge needed – on your own computer or free in your browser.
What can I do with it?
Ternary-Bonsai-2-9B is a compact assistant that understands text and images yet takes up only about 2.4 GB. You can chat with it, summarize text, have it write code, describe images and call tools, all fully offline on your own device. Prism ML specifically trained it to follow instructions, avoid getting stuck in loops and keep answers concise. The 262,000-token context window allows very long documents in principle, but costs a lot of memory and time. The vendor says performance is close to the Qwen3.5-9B base model; that hasn't been independently verified. With the big 27B sibling, knowledge questions, image understanding and long coding-agent tasks suffered most from compression. Expect weaknesses in those areas here too. Compared with regular 4-bit versions of a 9B model, Bonsai is about half the size.
Who is it worth it for?
Worth it for anyone who wants a capable model on modest hardware: laptops without a big GPU, older PCs, Macs with little memory, or the iPhone. If you already have a GPU with 12 GB or more and need maximum quality, for long coding agents for example, you're better off with a larger or less aggressively compressed model.
Ideas: What you can do with it
Install the free Locally AI app and download Bonsai 2 9B. Then you can draft emails, ask questions or summarize text on the go without an internet connection. Your data stays entirely on the device.
Load the vision file as well and give the model photos of receipts, labels or whiteboards, for example. It describes the content or extracts text you can then work with.
Even without a strong GPU, you can paste in long reports, meeting minutes or manuals and get a bullet-point summary. For very long texts, increase the context length step by step.
Have it write and explain individual functions, shell commands or regular expressions. For short coding tasks, the vendor says the Bonsai family comes close to the original.
Developers can hook the model up to their own tools via the llama.cpp server interface, such as a calendar, file search or calculator. Prism ML specifically trained it for clean tool calling.
You can rephrase, translate or structure confidential texts such as contracts or internal notes locally, without sending them to a cloud service.
What your computer needs
For the easiest start with stock llama.cpp, LM Studio or similar tools, pick Q2_0 (2.56 GB), since it's the only variant that runs without special software. If you install Prism ML's llama.cpp fork, PQ2_0 (2.42 GB) is the default choice and the fastest. PTQ1_0 (2.00 GB) only makes sense when every megabyte counts. With very little memory, on older smartphones for example, the 4B (0.95 GB) or 2B (0.43 GB) siblings are the better choice. On iPhone and iPad, just use the Locally AI app.
- The language model file is 2.00–2.56 GB. At runtime the model needs more memory than the file size, because the context cache and compute buffers add up.
- A GPU with about 4 GB of VRAM is enough for normal context lengths. With the vision file and long contexts, you'll need correspondingly more.
- According to the source, the model runs on laptop GPUs, Apple Silicon and CPU-only systems.
- The full 262,144-token context window costs significantly more memory and makes responses noticeably slower.
- Prism ML says the 9B model hits up to 34 tokens per second on the iPhone 18 Pro Max, and the 2B model up to 120.
- The vision component is a separate file and is only needed for image input.
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: runs for free – The free Tesla T4 GPU with 15 GB is enough.
- 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 → 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 5 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.
- 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
This model runs on Python. Our script handles the setup automatically: it creates an isolated Python environment, installs the required packages (PyTorch, approx. 3 GB) and downloads the model (4.2 GB (about 6 min at 100 Mbit/s)).
- Update your graphics driver (NVIDIA): install the latest driver. Without an NVIDIA card, it runs on the CPU – much more slowly.
- Install Python. Download Python 3.12 from python.org and run the installer. Important: At the bottom of the first window, tick Add python.exe to PATH, then click Install Now.
- Create a folder and download the files. Create a folder, e.g.
Documents\AI-Test, and save both files into it: - Open a terminal in the folder. Open the folder in File Explorer, right-click an empty spot → Open in Terminal.
- Run it. Paste this command and press Enter:
Installation and download are running now. The first time, this can take 10–30 minutes.powershell -ExecutionPolicy Bypass -File try_windows.ps1 - Result. The model is in the
modelssubfolder. For exactly how to use it, see the Model Card on Hugging Face. - Try your own input: Open
demo.pyin an editor, change the sample text, and save. Then run this in the terminal:.\.venv-ternary-bonsai-2-9b\Scripts\Activate.ps1 python demo.py
macOS
Macs with an Apple chip (M1 to M5) are ideal. Older Intel Macs are very slow.
- Open Terminal. Press Cmd + Space, type Terminal, and press Enter.
- Install the developer tools (first time only; includes Python):
Click Install in the window. If you see "already installed," everything is already in place.xcode-select --install - Download the files – both end up in your Downloads folder:
- Run it:
The first time, installation and download take 10–30 minutes.cd ~/Downloads bash try_mac.sh - Result. The model is in the
modelssubfolder. For exactly how to use it, see the Model Card on Hugging Face.
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 the Python basics (Ubuntu/Debian):
sudo apt update && sudo apt install -y python3-venv python3-pip git - Put the files in a folder and open a terminal there:
- Run it:
bash try_linux.sh - Result. The model is in the
modelssubfolder. For exactly how to use it, see the Model Card on Hugging Face.
Try it
Explain in three sentences how a heat pump works.Summarize this text in five bullet points and finish with the most important open question: [paste text]Write a Python function that sorts all files in a folder by modification date and prints the ten most recent.(With image) What's in this photo? List all the objects and guess which room it was taken in.I'm planning a three-day bike tour from Munich to Lake Garda. Create a day-by-day plan with stage distances and a packing list.
Tips for better results
- Give clear, specific instructions. The model was specifically trained for instruction following and then answers concisely and on point.
- If you're using the Prism ML fork, enable the built-in MTP speculative decoding or the DFlash2 Drafter for faster responses.
- Double-check answers to factual questions. According to the 27B data, knowledge suffers most from ternary compression.
- The model isn't well suited to long, many-step coding agents. It works well for single tasks like writing functions, extracting text or summarizing.
- If your device is short on memory, try the 4B variant from the same family first. At 0.95 GB, it's considerably smaller still.
If something goes wrong
The PTQ1_0 and PQ2_0 formats only run with Prism ML's llama.cpp fork. Stock llama.cpp rejects them. If you want to work without the fork, use Q2_0.
Watch out for older ternary Bonsai files: according to OrcaRouter, stock llama.cpp loads them without errors but outputs fluent-sounding nonsense. If the answers suddenly make no sense, check your software and file format first.
Images only work if you also load the separate vision file (mmproj).
Don't set the context length straight to the maximum, or you'll run out of memory or the model will get very slow. Start with 8,000–32,000 tokens.
The benchmark numbers come from the vendor. Test the model on your own tasks before you rely on it.
“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.