Text Generation
MLX
Safetensors
qwen3_5
conversational
1-bit
cuda
metal
on-device
hybrid-attention
prismml
bonsai
Instructions to use prism-ml/Bonsai-27B-mlx-1bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use prism-ml/Bonsai-27B-mlx-1bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("prism-ml/Bonsai-27B-mlx-1bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use prism-ml/Bonsai-27B-mlx-1bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prism-ml/Bonsai-27B-mlx-1bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "prism-ml/Bonsai-27B-mlx-1bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use prism-ml/Bonsai-27B-mlx-1bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "prism-ml/Bonsai-27B-mlx-1bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "prism-ml/Bonsai-27B-mlx-1bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prism-ml/Bonsai-27B-mlx-1bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use prism-ml/Bonsai-27B-mlx-1bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prism-ml/Bonsai-27B-mlx-1bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default prism-ml/Bonsai-27B-mlx-1bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use prism-ml/Bonsai-27B-mlx-1bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "prism-ml/Bonsai-27B-mlx-1bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "prism-ml/Bonsai-27B-mlx-1bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Update README.md
#5
by yogeshsaini1110 - opened
README.md
CHANGED
|
@@ -29,8 +29,7 @@ base_model:
|
|
| 29 |
|
| 30 |
# 1-bit Bonsai 27B
|
| 31 |
|
| 32 |
-
Full
|
| 33 |
-
|
| 34 |
> **~14.2x** smaller than FP16 | **~90%** of FP16 intelligence retained | **~11 tok/s** on iPhone 17 Pro Max
|
| 35 |
|
| 36 |
## Highlights
|
|
@@ -81,8 +80,7 @@ Effective bits per weight: **1.125** (1 sign bit + 16-bit scale amortized over 1
|
|
| 81 |
| FP16 (baseline) | 16.0 | 54 GB | 1.0x |
|
| 82 |
| **Binary g128** | **1.125** | **3.9 GB** | **14.2x** |
|
| 83 |
|
| 84 |
-
The binary build deploys at its native 1-bit g128 layout, so ideal and deployed
|
| 85 |
-
|
| 86 |
Unlike conventional low-bit builds — whose advertised labels understate their true average bit-width (a widely-used "2-bit" build of Qwen3.6-27B is really 2.8 bits/weight at 9.4 GB) — the Bonsai representation carries a bit-width that matches its name.
|
| 87 |
|
| 88 |
### Shipped Components
|
|
|
|
| 29 |
|
| 30 |
# 1-bit Bonsai 27B
|
| 31 |
|
| 32 |
+
Full 2
|
|
|
|
| 33 |
> **~14.2x** smaller than FP16 | **~90%** of FP16 intelligence retained | **~11 tok/s** on iPhone 17 Pro Max
|
| 34 |
|
| 35 |
## Highlights
|
|
|
|
| 80 |
| FP16 (baseline) | 16.0 | 54 GB | 1.0x |
|
| 81 |
| **Binary g128** | **1.125** | **3.9 GB** | **14.2x** |
|
| 82 |
|
| 83 |
+
The binary build deploys at its native 1-bit g128 layout, so ideal and deployed s
|
|
|
|
| 84 |
Unlike conventional low-bit builds — whose advertised labels understate their true average bit-width (a widely-used "2-bit" build of Qwen3.6-27B is really 2.8 bits/weight at 9.4 GB) — the Bonsai representation carries a bit-width that matches its name.
|
| 85 |
|
| 86 |
### Shipped Components
|