# Bonsai 2.5 27B

A full 27B-parameter model compressed to 1.75 bits so it fits and writes fast on a regular 8 GB graphics card — tested on an RTX 3070 Ti with one single llama-server command.

[Canonical HTML page](https://lasse-ai.com/recipes/bonsai-2-5-27b/)

## Origin and credits

Built by upstream projects and independently tested by Lasse AI.

- [PrismML](https://github.com/PrismML-Eng)
- [PrismML-Eng/llama.cpp](https://github.com/PrismML-Eng/llama.cpp)
- [Qwen](https://huggingface.co/Qwen/Qwen3.8-27B)
- [llama.cpp](https://github.com/ggml-org/llama.cpp)
- [PrismML GGUF](https://huggingface.co/prism-ml/Ternary-Bonsai-2.5-27B-GGUF)

## Hardware and prerequisites

An 8 GB NVIDIA GPU, the PrismML llama.cpp fork, and the matching ~6 GB PTQ1_0 GGUF file (the -mtp.gguf variant for MTP).

| Preset | Engine | Quantization | Context | Vision | Speculative decoding | Port |
| --- | --- | --- | --- | --- | --- | --- |
| Fast coding & tools | PrismML llama.cpp | PTQ1_0 (1.75-bit ternary) | 20K | No | MTP | 8080 |
| Long documents | PrismML llama.cpp | PTQ1_0 (1.75-bit ternary) | 44K | No | Off | 8080 |

### Fast coding & tools (`8gb-mtp`)

API: `http://127.0.0.1:8080/v1`

Parallel slots: 1

```sh
llama-server -m Ternary-Bonsai-2.5-27B-PTQ1_0-mtp.gguf \
  --alias bonsai-2.5-27b --host 127.0.0.1 --port 8080 \
  -ngl 99 -fa on -c 20480 -ctk q8_0 -ctv q8_0 -np 1 --min-p 0 \
  --spec-type draft-mtp --spec-draft-n-min 0 --spec-draft-n-max 2 \
  --spec-draft-p-min 0.1 --spec-draft-type-k q8_0 --spec-draft-type-v q8_0
```

Verify in a second terminal.

```sh
curl http://127.0.0.1:8080/v1/models
```

### Long documents (`8gb-long`)

API: `http://127.0.0.1:8080/v1`

Parallel slots: 1

```sh
llama-server -m Ternary-Bonsai-2.5-27B-PTQ1_0.gguf \
  --alias bonsai-2.5-27b --host 127.0.0.1 --port 8080 \
  -ngl 99 -fa on -c 45056 -ctk q8_0 -ctv q8_0 -np 1 --min-p 0
```

Verify in a second terminal.

```sh
curl http://127.0.0.1:8080/v1/models
```

## Connect clients

Use the API URL from the selected preset. Confirm the model ID with `/v1/models`. The recipe's example model ID is `bonsai-2.5-27b`.

- **Open WebUI** — Enter the OpenAI API URL under Settings → Connections.
- **Coding agent** — Select an OpenAI-compatible provider and enter the API URL and model ID.
- **Python SDK** — Use the port of the selected preset.

```python
from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="local")
```

`local` is a placeholder. If the server requires authentication, use the key configured on the server.

## Caveats

- Ternary 1.75-bit compression trades model fidelity for fitting 27B into 8 GB. Tested at 7.31 GiB peak on an RTX 3070 Ti.
- If the display shares the card, lower the context (for example, -c 16384). Reserve output space for the final answer on thinking tasks (for example, max_tokens: 16384).
- PrismML trained the ternary derivative of Qwen’s Qwen3.8-27B, published the GGUFs and adapted llama.cpp to serve them.

## Measurements

- **Decode speed (RTX 3070 Ti, 8 GB)** — 70.5 tok/s plain → 113.4 tok/s coding with MTP (1.61×); peak memory 7.31 GiB. [1](https://lasse-ai.com/tests/2026-11-24-bonsai-2-5-27b-speed-and-memory-on-an-8-gb-card/)
- **Quality & answer budget** — 37/40 single-turn tool calls, 5/6 LongBench v2, and 6/6 final answers on coding tasks when reserving final-answer budget. [1](https://lasse-ai.com/tests/2026-11-24-bonsai-2-5-27b-coding-tools-and-long-documents-on-an-8-gb-card/) [2](https://lasse-ai.com/tests/2026-11-25-bonsai-2-5-27b-reserving-space-for-the-final-answer/)

## Test records

- [Bonsai 2.5 27B: speed and memory on an 8 GB card](https://lasse-ai.com/tests/2026-11-24-bonsai-2-5-27b-speed-and-memory-on-an-8-gb-card/)
- [Bonsai 2.5 27B: coding, tools and long documents on an 8 GB card](https://lasse-ai.com/tests/2026-11-24-bonsai-2-5-27b-coding-tools-and-long-documents-on-an-8-gb-card/)
- [Bonsai 2.5 27B: reserving space for the final answer](https://lasse-ai.com/tests/2026-11-25-bonsai-2-5-27b-reserving-space-for-the-final-answer/)
