The flagship Bonsai: vision-language, native tool calling, and a 262K-token context, in binary or ternary weights.
Bonsai 27B is the largest model in the family and the first with vision input: it accepts photos, screenshots, and PDFs alongside text. It’s derived from Qwen3.6-27B, a hybrid-attention model (roughly 75% linear attention, 25% full attention), which is what keeps its long context practical on-device. Like every Bonsai, the language model is quantized end-to-end 1-bit or ternary weights across embeddings, attention, MLPs, and the LM head, with no higher-precision fallback. The vision tower is handled separately, at 4-bit (NF4).Ternary is the default for this size: it’s the quality-oriented operating point, and what ./setup.sh downloads if you don’t set BONSAI_FAMILY.
Total memory is weights + mmproj + activations + the FP16 KV cache, which grows with context. The 27B’s hybrid attention keeps that cache small relative to its size: 64 KiB per token, so even 100K-token conversations stay well under what a 16-bit model needs just to load.Peak memory, text-only (add ~0.9 GiB if you’re sending images):
Build
Weights
4K context
10K context
100K context
Bonsai-27B (1-bit), llama.cpp Q1_0
3.53 GiB
4.8 GiB
5.2 GiB
10.8 GiB
Bonsai-27B (1-bit), MLX
3.92 GiB
5.5 GiB
5.9 GiB
11.4 GiB
Ternary-Bonsai-27B, llama.cpp Q2_0
6.66 GiB
7.8 GiB
8.1 GiB
13.7 GiB
Ternary-Bonsai-27B, MLX
7.05 GiB
8.6 GiB
8.9 GiB
14.4 GiB
Reference: 27B FP16
47.73 GiB
49 GiB
49.6 GiB
55.2 GiB
Reference: 27B “4-bit” (llama.cpp UD Q4_K_M)
15.73 GiB
17.2 GiB
17.6 GiB
23.2 GiB
Both Ternary-Bonsai-27B builds fit comfortably on a standard laptop; the 1-bit build is the one that fits a high-end phone. -c 0 (the demo scripts’ default) auto-fits the context window to available memory instead of pre-allocating the max.
27B is trained for both. Send an image as a normal OpenAI-style image_url content part, and a tools array for function calling — both come back through the standard API, no prompt hacks required:
curl http://localhost:8080/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "messages": [{"role": "user", "content": "What is the weather in Lisbon?"}], "tools": [{ "type": "function", "function": { "name": "get_weather", "description": "Get current weather for a city", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]} } }] }'
The response’s choices[0].message.tool_calls carries the call. See Tool calling & MCP in the demo repo for MCP server setup and the full agentic walkthrough, and Open WebUI for a point-and-click demo of the same capabilities.
27B reasons by default. Toggle it per request with thinking_budget_tokens (0 to disable, -1 for unlimited), cap it server-wide with --reasoning-budget N, or turn it off entirely with BONSAI_THINKING=0 ./scripts/start_llama_server.sh. The built-in chat UI has a Reasoning effort picker (Off / Low / Medium / High / Max) that overrides the server default per conversation.
Large images are downscaled to ~1,024 vision tokens by default on Metal, Vulkan, and CPU to keep latency reasonable; CUDA and ROCm run uncapped. Override with BONSAI_IMAGE_MAX_TOKENS (0 disables the cap — useful for reading small text in screenshots).