Start the server
BONSAI_MODEL selects, 27B unless you set it (see Quickstart), and also serves a built-in web chat at http://localhost:8080, with image upload, an MCP client, and a per-chat reasoning-effort picker.
On Apple Silicon there is a second option, an MLX-backed server on its own port:
The endpoint
What the script configures
start_llama_server.sh doesn’t just launch llama-server; it applies Bonsai 2’s recommended settings:
The launcher already applies the recommended sampling, so requests can omit it. If your client sets its own values, or you serve the model another way, use the thinking or non-thinking set from the model page.
Thinking. In the built-in chat UI, click the lightbulb in the message box and pick a Reasoning effort: Off, Low (512 tokens), Medium (2,048), High (8,192), or Max (unlimited). The pick persists per browser and is sent with every request, no restart needed. Over the API, toggle it per request with
thinking_budget_tokens (0 disables it, -1 is unlimited), cap the default for clients that don’t specify one with --reasoning-budget N, or disable it entirely with --reasoning-budget 0. For the 27B, the model’s own reasoning_effort: "medium" is usually the better way to shorten thinking: it thinks noticeably less than the default xhigh, is about as accurate at moderate output limits, and rarely runs out of budget mid-reasoning. For the 9B, 4B, and 2B, start the launcher with BONSAI_THINKING=0, or send "chat_template_kwargs": {"enable_thinking": false} together with the non-thinking sampling.On slower hardware, thinking is usually the bulk of the wait. Pick a lower effort.llama-server, e.g. ./scripts/start_llama_server.sh --reasoning-budget 2048 to cap the default reasoning budget, --chat-template-kwargs '{"reasoning_effort":"medium"}' to make medium the 27B’s default, or -c 32768 to pin the context size.
Optional extras
Off-by-default flags for the llama.cpp server:
Speculative decoding for the 9B and 4B (their MTP drafters) isn’t selected by the launcher; run
llama-server yourself as shown on the llama.cpp page. BONSAI_SPECULATIVE=1 applies only to the earlier families’ DSpark drafter.
Call it
max_tokens of 8,192 or more with thinking on, since even simple prompts can use 3,000+ thinking tokens.
Images and tool calls
Every Bonsai 2 size acceptsimage_url parts in messages and does native OpenAI-style tool_calls with full round-trips, so vision and tool use work over this endpoint with no special client. The built-in chat UI also ships an MCP client (Hugging Face and DeepWiki preconfigured, per-chat opt-in). Costs, the image-token cap, and adding your own MCP servers: VISION.md and TOOLS.md in the demo repo.
Connect a tool
Open WebUI
A ChatGPT-style interface; one script starts everything.
Hermes
Run the Hermes terminal agent on local Bonsai.
LM Studio
A desktop app with its own OpenAI-compatible server.