> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prismml.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bonsai 1.7B

> The smallest Bonsai: 0.25 GB on disk for the tightest memory budgets.

Bonsai 1.7B is the smallest model in the family. At 0.25 GB (1-bit), it targets smart glasses, wearables, and always-on background tasks where other models are too heavy.

## Specifications

|             |                                                    |
| ----------- | -------------------------------------------------- |
| Parameters  | \~1.7B                                             |
| Max context | 32,768 tokens (native 8,192, extended 4x via YaRN) |
| Modalities  | Text                                               |
| Layers      | 28                                                 |
| Hidden size | 2,048                                              |
| Attention   | 16 heads, 8 KV heads (GQA)                         |
| Vocabulary  | 151,669 (embeddings tied with LM head)             |
| License     | Apache-2.0                                         |

## Artifacts

| Family             | Format | Repository                                                                                              | On disk |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------- | ------- |
| Bonsai (1-bit)     | GGUF   | [`prism-ml/Bonsai-1.7B-gguf`](https://huggingface.co/prism-ml/Bonsai-1.7B-gguf)                         | 0.25 GB |
| Bonsai (1-bit)     | MLX    | [`prism-ml/Bonsai-1.7B-mlx-1bit`](https://huggingface.co/prism-ml/Bonsai-1.7B-mlx-1bit)                 | 0.27 GB |
| Ternary (1.58-bit) | GGUF   | [`prism-ml/Ternary-Bonsai-1.7B-gguf`](https://huggingface.co/prism-ml/Ternary-Bonsai-1.7B-gguf)         | 0.46 GB |
| Ternary (1.58-bit) | MLX    | [`prism-ml/Ternary-Bonsai-1.7B-mlx-2bit`](https://huggingface.co/prism-ml/Ternary-Bonsai-1.7B-mlx-2bit) | 0.48 GB |

The FP16 reference weights (3.45 GB) are in the ternary GGUF repo.

## Run it

Through the [demo repo](/get-started/quickstart):

```bash theme={null}
BONSAI_MODEL=1.7B ./scripts/run_llama.sh -p "Classify this sentence as positive or negative: ..."
BONSAI_MODEL=1.7B ./scripts/start_llama_server.sh   # OpenAI-compatible API on :8080
```

Or directly with [llama.cpp](/run/llamacpp) / [MLX](/run/mlx):

<CodeGroup>
  ```bash llama.cpp theme={null}
  ./llama-cli -m ./Bonsai-1.7B-gguf/Bonsai-1.7B-Q1_0.gguf -c 0 -p "Hello"
  ```

  ```bash MLX (Apple Silicon) theme={null}
  mlx_lm.generate --model prism-ml/Ternary-Bonsai-1.7B-mlx-2bit --prompt "Hello"
  ```
</CodeGroup>
