# Ternary Bonsai 2 9B

> Bonsai 2 9B is PrismML's compact open-weight vision-language model, derived from Qwen3.5-9B with ternary weights. It handles conversation, reasoning and tool use, takes image input, and has a 262K-token context window.

**ID**: `prism-ml/ternary-bonsai-2-9b`  
**Creator**: prism-ml  
**Category**: multimodal  
**Context**: 262K tokens  
**Pricing**: $0.08 / $0.13 per 1M · billed by your provider (BYOK)  
**Released**: 2026-10-16  
**Web page**: https://anyrouter.dev/model/prism-ml/ternary-bonsai-2-9b

**Input modalities**: text, image  
**Output modalities**: text  

**Capabilities**: chat, reasoning, streaming, function-calling, vision

**Supported parameters**: frequency_penalty, include_reasoning, logprobs, max_tokens, presence_penalty, reasoning, repetition_penalty, response_format, seed, stop, structured_outputs, temperature, tool_choice, tools, top_k, top_logprobs, top_p

## Usage

**Endpoint**: `POST https://anyrouter.dev/api/v1/chat/completions`

```bash
curl https://anyrouter.dev/api/v1/chat/completions \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "prism-ml/ternary-bonsai-2-9b",
  "messages": [
    {
      "role": "user",
      "content": "Say hi in 3 words."
    }
  ]
}'
```

## Providers

| Provider | Input | Output |
| --- | --- | --- |
| openrouter-byok | $0.08/M (list) | $0.13/M (list) |

BYOK routes are billed by your own provider key — AnyRouter charges $0. Rates marked (list) are the provider's published list price.

## Model card

- Architecture: dense [1]
- Native context: 262144 tokens [1]
- License: Apache-2.0, open weights (https://huggingface.co/prism-ml/Ternary-Bonsai-2-9B-gguf) [1]

### Strengths [1]

- Ternary weights shrink the language model to about 2.4 GB from about 17.9 GB at FP16
- Image input through a separate vision projector
- 262K-token context from the Qwen3.5-9B hybrid-attention backbone

### Known limits [1]

- Thinking mode can use 3,000+ tokens on simple prompts, so allow at least 8,192 output tokens
- Greedy decoding with thinking on can get stuck reasoning on some prompts

### Use cases [1]

- Low-cost chat and tool-calling agents
- Image understanding with text output

### API notes [1]

- Card recommends temperature 1.0, top_p 0.95, top_k 20 and presence_penalty 1.0 in thinking mode
- Thinking can be turned off per request with chat_template_kwargs enable_thinking false

### Links

- model card: https://huggingface.co/prism-ml/Ternary-Bonsai-2-9B-gguf
- Previous version: https://anyrouter.dev/model/prism-ml/ternary-bonsai-2-27b

### Sources

1. [prism-ml/Ternary-Bonsai-2-9B-gguf model card](https://huggingface.co/prism-ml/Ternary-Bonsai-2-9B-gguf/raw/main/README.md) (accessed 2026-10-28)

## Source

- Upstream docs: https://huggingface.co/prism-ml/Ternary-Bonsai-2-9B-gguf
