Text Generation
GGUF
llama.cpp
conversational
1-bit
llama-cpp
cuda
metal
on-device
hybrid-attention
prismml
bonsai
Eval Results
Instructions to use SwinliQ-AIs/Bonsai-27B-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SwinliQ-AIs/Bonsai-27B-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf SwinliQ-AIs/Bonsai-27B-gguf:F16 # Run inference directly in the terminal: llama cli -hf SwinliQ-AIs/Bonsai-27B-gguf:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SwinliQ-AIs/Bonsai-27B-gguf:F16 # Run inference directly in the terminal: llama cli -hf SwinliQ-AIs/Bonsai-27B-gguf:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf SwinliQ-AIs/Bonsai-27B-gguf:F16 # Run inference directly in the terminal: ./llama-cli -hf SwinliQ-AIs/Bonsai-27B-gguf:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf SwinliQ-AIs/Bonsai-27B-gguf:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf SwinliQ-AIs/Bonsai-27B-gguf:F16
Use Docker
docker model run hf.co/SwinliQ-AIs/Bonsai-27B-gguf:F16
- LM Studio
- Jan
- vLLM
How to use SwinliQ-AIs/Bonsai-27B-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SwinliQ-AIs/Bonsai-27B-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SwinliQ-AIs/Bonsai-27B-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SwinliQ-AIs/Bonsai-27B-gguf:F16
- Ollama
How to use SwinliQ-AIs/Bonsai-27B-gguf with Ollama:
ollama run hf.co/SwinliQ-AIs/Bonsai-27B-gguf:F16
- Unsloth Desktop
- Pi
How to use SwinliQ-AIs/Bonsai-27B-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SwinliQ-AIs/Bonsai-27B-gguf:F16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "SwinliQ-AIs/Bonsai-27B-gguf:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use SwinliQ-AIs/Bonsai-27B-gguf with Docker Model Runner:
docker model run hf.co/SwinliQ-AIs/Bonsai-27B-gguf:F16
- Lemonade
How to use SwinliQ-AIs/Bonsai-27B-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SwinliQ-AIs/Bonsai-27B-gguf:F16
Run and chat with the model
lemonade run user.Bonsai-27B-gguf-F16
List all available models
lemonade list
- Hermes Agent
How to use SwinliQ-AIs/Bonsai-27B-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SwinliQ-AIs/Bonsai-27B-gguf:F16
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 SwinliQ-AIs/Bonsai-27B-gguf:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use SwinliQ-AIs/Bonsai-27B-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SwinliQ-AIs/Bonsai-27B-gguf:F16
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 "SwinliQ-AIs/Bonsai-27B-gguf:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Commit ·
88ddba4
0
Parent(s):
Duplicate from prism-ml/Bonsai-27B-gguf
Browse filesCo-authored-by: Pasha <pashak@users.noreply.huggingface.co>
- .eval_results/aime_2026.yaml +7 -0
- .eval_results/gsm8k.yaml +7 -0
- .eval_results/mmmu_pro.yaml +7 -0
- .gitattributes +42 -0
- Bonsai-27B-F16.gguf +3 -0
- Bonsai-27B-Q1_0.gguf +3 -0
- Bonsai-27B-dspark-Q4_1.gguf +3 -0
- Bonsai-27B-dspark-bf16.gguf +3 -0
- Bonsai-27B-mmproj-BF16.gguf +3 -0
- Bonsai-27B-mmproj-Q8_0.gguf +3 -0
- LICENSE.txt +177 -0
- NOTICE.txt +4 -0
- README.md +317 -0
- assets/bonsai-logo.svg +1 -0
.eval_results/aime_2026.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- dataset:
|
| 2 |
+
id: MathArena/aime_2026
|
| 3 |
+
task_id: MathArena/aime_2026
|
| 4 |
+
value: 87.08
|
| 5 |
+
source:
|
| 6 |
+
url: https://huggingface.co/prism-ml/Bonsai-27B-gguf
|
| 7 |
+
name: Model Card
|
.eval_results/gsm8k.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- dataset:
|
| 2 |
+
id: openai/gsm8k
|
| 3 |
+
task_id: gsm8k
|
| 4 |
+
value: 92.8
|
| 5 |
+
source:
|
| 6 |
+
url: https://huggingface.co/prism-ml/Bonsai-27B-gguf
|
| 7 |
+
name: Model Card
|
.eval_results/mmmu_pro.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- dataset:
|
| 2 |
+
id: MMMU/MMMU_Pro
|
| 3 |
+
task_id: mmmu_pro_vision
|
| 4 |
+
value: 60.48
|
| 5 |
+
source:
|
| 6 |
+
url: https://huggingface.co/prism-ml/Bonsai-27B-gguf
|
| 7 |
+
name: Model Card
|
.gitattributes
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Bonsai-27B-Q1_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
Bonsai-27B-mmproj-BF16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
Bonsai-27B-mmproj-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
Bonsai-27B-dspark-bf16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
Bonsai-27B-dspark-Q1_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
Bonsai-27B-F16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
Bonsai-27B-dspark-Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
|
Bonsai-27B-F16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d4a381a6d07131c34af888607bdbda49fc885c97673a0d22aa3e0f0284bba566
|
| 3 |
+
size 53808280640
|
Bonsai-27B-Q1_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:17ef842e47450caeb8eaa3ebfbbab5d2f2278b62b79be107985fb69a2f819aa0
|
| 3 |
+
size 3803452480
|
Bonsai-27B-dspark-Q4_1.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25e73f9f7ab5d1f7f1336711496dbc12da674e639ec88d579dc8683045befb1b
|
| 3 |
+
size 1787468768
|
Bonsai-27B-dspark-bf16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93bd7f0326bcb39982051dd7742e5a2c9031358f94293a9c91f6aa98dcb6573b
|
| 3 |
+
size 7291885792
|
Bonsai-27B-mmproj-BF16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:acaf5b55d24ebd38c71fa220dc58c9a36776ec543b17728a4b322fc8d92f1de4
|
| 3 |
+
size 931145760
|
Bonsai-27B-mmproj-Q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eb561d41a7bbeb0fcf04883c8af11078ef6cae0a66862a0b68443cfca495269d
|
| 3 |
+
size 629246880
|
LICENSE.txt
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
NOTICE.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This software is copyright 2026-present Prism ML, Inc. It is available under the Apache 2.0 license.
|
| 2 |
+
If you publicly deploy or redistribute this software, we would appreciate attribution such as: "Created using Bonsai by Prism ML."
|
| 3 |
+
|
| 4 |
+
This software is built from Qwen3.6-27B, Copyright 2026 Alibaba Cloud, which is available under the Apache 2.0 License: https://huggingface.co/Qwen/Qwen3.6-27B/blob/main/LICENSE
|
README.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: llama.cpp
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- conversational
|
| 7 |
+
- 1-bit
|
| 8 |
+
- gguf
|
| 9 |
+
- llama-cpp
|
| 10 |
+
- cuda
|
| 11 |
+
- metal
|
| 12 |
+
- on-device
|
| 13 |
+
- hybrid-attention
|
| 14 |
+
- prismml
|
| 15 |
+
- bonsai
|
| 16 |
+
base_model:
|
| 17 |
+
- Qwen/Qwen3.6-27B
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
<p align="center">
|
| 21 |
+
<img src="./assets/bonsai-logo.svg" width="280" alt="Bonsai">
|
| 22 |
+
</p>
|
| 23 |
+
|
| 24 |
+
<p align="center">
|
| 25 |
+
<a href="https://prismml.com"><b>Prism ML Website</b></a> |
|
| 26 |
+
<a href="https://github.com/PrismML-Eng/Bonsai-demo"><b>Whitepaper</b></a> |
|
| 27 |
+
<a href="https://github.com/PrismML-Eng/Bonsai-demo"><b>Demo & Examples</b></a> |
|
| 28 |
+
<a href="https://discord.gg/prismml"><b>Discord</b></a>
|
| 29 |
+
</p>
|
| 30 |
+
|
| 31 |
+
# 1-bit Bonsai 27B — GGUF
|
| 32 |
+
|
| 33 |
+
Full 27B-class reasoning in binary transformer weights, for llama.cpp (CUDA, Metal, CPU)
|
| 34 |
+
|
| 35 |
+
> **\~14.2x** smaller than FP16 | **\~90%** of FP16 intelligence retained | **\~44 tok/s** on an Apple M5 Pro laptop
|
| 36 |
+
|
| 37 |
+
## Highlights
|
| 38 |
+
|
| 39 |
+
- **\~3.9 GB** deployed footprint (down from \~54 GB FP16) — a 27B model on everyday laptops and single GPUs
|
| 40 |
+
- **Retains thinking, reasoning, and agentic behavior** deep in the sub-4-bit regime, where conventional low-bit representations collapse — 76.11 average across 15 thinking-mode benchmarks (89.5% of FP16), including math at 91.66 and coding at 81.88
|
| 41 |
+
- **End-to-end binary language weights** across embeddings, attention projections, MLP projections, and LM head, at a *true* 1.125 bits per weight — no high-precision escape hatches behind a low-bit label; the vision tower ships in compact 4-bit HQQ
|
| 42 |
+
- **262K-token context** on-device, kept practical by the Qwen3.6-27B hybrid-attention backbone (\~75% linear attention) and 4-bit KV-cache quantization
|
| 43 |
+
- **GGUF Q1_0_g128** format with custom 1-bit hybrid-attention kernels for llama.cpp (CUDA, Metal) — packed weights are consumed directly, never expanded back to FP16
|
| 44 |
+
- **Ships with a DSpark speculative-decoding drafter layer** trained against the Bonsai 27B target — a lossless **1.37x** decode speedup on the CUDA serving path
|
| 45 |
+
- **MLX companion**: also available as [Bonsai-27B-mlx-1bit](https://huggingface.co/prism-ml/Bonsai-27B-mlx-1bit) for native Apple Silicon inference, including iPhone (\~11 tok/s on iPhone 17 Pro Max via MLX Swift)
|
| 46 |
+
- **Ternary companion**: the quality-oriented operating point (\~7.2 GB, 95% of FP16) is also published in GGUF as [Ternary-Bonsai-27B-gguf](https://huggingface.co/prism-ml/Ternary-Bonsai-27B-gguf)
|
| 47 |
+
|
| 48 |
+
## Resources
|
| 49 |
+
|
| 50 |
+
- **[Whitepaper](https://github.com/PrismML-Eng/Bonsai-demo/blob/main/bonsai-27b-whitepaper.pdf)** — full methodology, benchmarks, and measurement notes
|
| 51 |
+
- **[Demo & examples](https://github.com/PrismML-Eng/Bonsai-demo)** — serving, benchmarking, and integrating Bonsai
|
| 52 |
+
- **Low-bit kernels**: [llama.cpp fork](https://github.com/PrismML-Eng/llama.cpp) (CUDA + Metal) · [MLX fork](https://github.com/PrismML-Eng/mlx) (Apple Silicon) · [mlx-swift fork](https://github.com/PrismML-Eng/mlx-swift) (iOS/macOS)
|
| 53 |
+
- **[Discord](https://discord.gg/prismml)** — join the community for support, discussion, and updates
|
| 54 |
+
|
| 55 |
+
## Model Overview
|
| 56 |
+
|
| 57 |
+
| Item | Specification |
|
| 58 |
+
| :---------------- | :----------------------------------------------------------------------------------------------- |
|
| 59 |
+
| Base model | Derived from Qwen3.6-27B, a 27B hybrid-attention causal language model (architecture unchanged) |
|
| 60 |
+
| Parameters | \~27.3B binary language weights (\~24.8B backbone across 64 blocks + \~2.5B embedding/LM head) + \~0.46B vision tower (27 blocks) |
|
| 61 |
+
| Architecture | Hybrid attention (\~75% linear / \~25% full attention), SwiGLU MLP, RoPE, RMSNorm |
|
| 62 |
+
| Context length | 262K tokens (full-context capable on-device, enabled by the predominantly linear-attention backbone) |
|
| 63 |
+
| KV cache | Near-lossless 4-bit KV quantization; the hybrid backbone grows a full-attention cache on only 16 of 64 layers (\~4.3 GB at the full 262K window) |
|
| 64 |
+
| Weight format | GGUF Q1_0_g128: {−1, +1} weights with FP16 group-wise scaling |
|
| 65 |
+
| Low-bit coverage | Embeddings, attention projections, MLP projections, LM head |
|
| 66 |
+
| Vision tower | HQQ 4-bit; optional \~0.63 GB mmproj pack (Q8_0 container), loaded only for image input |
|
| 67 |
+
| Deployed size | **\~3.9 GB** (\~14.2x smaller than FP16) |
|
| 68 |
+
| Acceleration | DSpark speculative-decoding drafter layer provided |
|
| 69 |
+
| Backends | llama.cpp (CUDA, Metal, CPU) |
|
| 70 |
+
| License | Apache 2.0 |
|
| 71 |
+
|
| 72 |
+
## Weight Representation: Q1_0_g128
|
| 73 |
+
|
| 74 |
+
Each weight is a single sign bit: `0` maps to `−scale`, `1` maps to `+scale`. Every group of 128 weights shares one FP16 scale factor.
|
| 75 |
+
|
| 76 |
+
Effective bits per weight: **1.125** (1 sign bit + 16-bit scale amortized over 128 weights) — an idealized \~14.2x reduction vs FP16. This is the most aggressive operating point in the Bonsai 27B family: it minimizes both stored footprint and the weight traffic incurred at every decoding step. The GGUF Q1_0_g128 pack is the model's native layout — ideal and deployed sizes match.
|
| 77 |
+
|
| 78 |
+
### Memory Requirement
|
| 79 |
+
|
| 80 |
+
| Format | True bits/weight | Size | Reduction |
|
| 81 |
+
| :------------------ | ---------------: | ----------: | ----------: |
|
| 82 |
+
| FP16 (baseline) | 16.0 | \~54 GB | 1.0x |
|
| 83 |
+
| **GGUF Q1_0_g128** | **1.125** | **\~3.9 GB** | **\~14.2x** |
|
| 84 |
+
|
| 85 |
+
The deployed figure describes the language model alone — the only component that must stay resident for text inference; a negligible tail of normalization and scale parameters remains in higher precision.
|
| 86 |
+
|
| 87 |
+
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.
|
| 88 |
+
|
| 89 |
+
### Shipped Components
|
| 90 |
+
|
| 91 |
+
Two optional components ship alongside the language model (on-disk sizes):
|
| 92 |
+
|
| 93 |
+
| Component | Pack | Size | Residency |
|
| 94 |
+
| :------------- | :--------------------------------- | -------: | :--------------------------------- |
|
| 95 |
+
| Language model | 1-bit g128 (Q1_0) | \~3.9 GB | resident |
|
| 96 |
+
| DSpark drafter | Q4_1 (default) | 1.79 GB | optional — speculative decoding |
|
| 97 |
+
| DSpark drafter | bf16 (reference) | 7.29 GB | optional |
|
| 98 |
+
| Vision tower | mmproj HQQ 4-bit (Q8_0 container) | 0.63 GB | optional — multimodal input only |
|
| 99 |
+
| Vision tower | mmproj BF16 (reference) | 0.93 GB | optional |
|
| 100 |
+
|
| 101 |
+
The vision tower is usually offloaded: it sits outside the accelerator's resident budget and is loaded only when an image actually arrives, so text-only serving never pays for it.
|
| 102 |
+
|
| 103 |
+
### Peak Memory at Context
|
| 104 |
+
|
| 105 |
+
What a device must actually accommodate is *peak* memory — weights plus KV cache plus activations and runtime buffers (\~1.3 GB across backends). Measured, language model only, no KV-cache compression (sizes in decimal GB; the Q4_K_XL row is derived from its weight footprint plus the same measured cache-and-overhead build-up, all other rows directly measured):
|
| 106 |
+
|
| 107 |
+
| Build | Weights | 4K ctx | 10K ctx | 100K ctx |
|
| 108 |
+
| :----------------------------------- | ------: | -----: | ------: | -------: |
|
| 109 |
+
| **1-bit Bonsai (llama.cpp Q1_0)** | 3.79 | 5.2 | 5.6 | 11.6 |
|
| 110 |
+
| Qwen3.6-27B "4-bit" (Q4_K_XL) | 17.6 | 19.2 | 19.6 | 25.6 |
|
| 111 |
+
| 27B 16-bit (GGUF bf16) | 51.25 | 52.6 | 53.3 | 59.3 |
|
| 112 |
+
|
| 113 |
+
The 1-bit build holds a **100K-token context at 11.6 GB without any KV-cache compression** — a budget that fits mainstream laptops outright; the conventional Q4_K_XL build needs \~25.6 GB before the first long document is loaded. These peaks are the conservative case, with the cache left at FP16. Enabling the 4-bit KV cache shrinks the context-dependent term \~4x: the 100K peak drops to \~6.8 GB, and the full 262K window fits in \~9.4 GB peak.
|
| 114 |
+
|
| 115 |
+
## Best Practices
|
| 116 |
+
|
| 117 |
+
### Generation Parameters
|
| 118 |
+
|
| 119 |
+
| Parameter | Suggested |
|
| 120 |
+
| :---------- | :-------- |
|
| 121 |
+
| Temperature | 0.7 |
|
| 122 |
+
| Top-p | 0.95 |
|
| 123 |
+
| Top-k | 20 |
|
| 124 |
+
|
| 125 |
+
These are the settings used for all reported benchmark results (thinking mode).
|
| 126 |
+
|
| 127 |
+
### System Prompt
|
| 128 |
+
|
| 129 |
+
You can use a simple system prompt such as:
|
| 130 |
+
|
| 131 |
+
```
|
| 132 |
+
You are a helpful assistant
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
## Quickstart
|
| 136 |
+
|
| 137 |
+
### llama.cpp (CUDA)
|
| 138 |
+
|
| 139 |
+
```bash
|
| 140 |
+
# Clone the PrismML fork of llama.cpp (includes the Q1_0_g128 hybrid-attention kernels)
|
| 141 |
+
git clone https://github.com/PrismML-Eng/llama.cpp
|
| 142 |
+
cd llama.cpp
|
| 143 |
+
|
| 144 |
+
# Build with CUDA support
|
| 145 |
+
cmake -B build -DGGML_CUDA=ON && cmake --build build -j
|
| 146 |
+
|
| 147 |
+
# Download the 1-bit GGUF weights
|
| 148 |
+
hf download prism-ml/Bonsai-27B-gguf Bonsai-27B-Q1_0.gguf --local-dir .
|
| 149 |
+
|
| 150 |
+
# Run inference
|
| 151 |
+
./build/bin/llama-cli \
|
| 152 |
+
-m Bonsai-27B-Q1_0.gguf \
|
| 153 |
+
-p "Explain quantum computing in simple terms." \
|
| 154 |
+
-n 256 \
|
| 155 |
+
--temp 0.7 --top-p 0.95 --top-k 20 \
|
| 156 |
+
-ngl 99
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
### llama.cpp (Metal / macOS)
|
| 160 |
+
|
| 161 |
+
```bash
|
| 162 |
+
# Build with Metal support (default on macOS)
|
| 163 |
+
cmake -B build && cmake --build build -j
|
| 164 |
+
|
| 165 |
+
# Run inference
|
| 166 |
+
./build/bin/llama-cli \
|
| 167 |
+
-m Bonsai-27B-Q1_0.gguf \
|
| 168 |
+
-p "Explain quantum computing in simple terms." \
|
| 169 |
+
-n 256 \
|
| 170 |
+
--temp 0.7 --top-p 0.95 --top-k 20 \
|
| 171 |
+
-ngl 99
|
| 172 |
+
```
|
| 173 |
+
|
| 174 |
+
### llama.cpp Server
|
| 175 |
+
|
| 176 |
+
```bash
|
| 177 |
+
./build/bin/llama-server \
|
| 178 |
+
-m Bonsai-27B-Q1_0.gguf \
|
| 179 |
+
--host 0.0.0.0 --port 8080 -ngl 99
|
| 180 |
+
```
|
| 181 |
+
|
| 182 |
+
Open the web UI at [http://127.0.0.1:8080](http://127.0.0.1:8080), or see our [llama.cpp fork](https://github.com/PrismML-Eng/llama.cpp) for more examples.
|
| 183 |
+
|
| 184 |
+
> **Deploying to a phone?** iPhone deployment uses the MLX Swift runtime — see [Bonsai-27B-mlx-1bit](https://huggingface.co/prism-ml/Bonsai-27B-mlx-1bit) (\~11 tok/s on iPhone 17 Pro Max).
|
| 185 |
+
|
| 186 |
+
## Cross-Platform Throughput
|
| 187 |
+
|
| 188 |
+
`tg128` is token-generation throughput over 128 generated tokens (the memory-bandwidth-bound, interactive phase); `pp512` is prompt-processing throughput over 512 input tokens (the compute-bound phase). Both in tokens/s, measured with `llama-bench` on this GGUF pack (custom low-bit kernels).
|
| 189 |
+
|
| 190 |
+
| Platform | Footprint | TG128 (tok/s) | PP512 (tok/s) |
|
| 191 |
+
| :--------------------------- | --------: | ------------: | ------------: |
|
| 192 |
+
| Laptop (Apple M5 Max, Metal) | 3.9 GB | 66.4 | 874 |
|
| 193 |
+
| Laptop (Apple M5 Pro, Metal) | 3.9 GB | 44.2 | 421 |
|
| 194 |
+
| Laptop (Apple M4 Pro, Metal) | 3.9 GB | 26.0 | 133 |
|
| 195 |
+
| Single GPU (H100, CUDA) | 3.9 GB | 104.8 | 2755 |
|
| 196 |
+
|
| 197 |
+
On the edge platforms the FP16 baseline (\~54 GB) and even conventional "4-bit" builds (17.6 GB) do not fit at all — the meaningful statement is not a speedup ratio but that a 27B model runs on the device in the first place. The H100 row is the exception that proves the rule: at batch size 1 a datacenter GPU is limited by kernel-launch and synchronization latency rather than weight bandwidth, so the binary and ternary variants converge there (104.8 vs 98 tok/s) despite their \~1.9x difference in bytes per step.
|
| 198 |
+
|
| 199 |
+
Decode energy on the M5 Pro measures **0.275 mWh/token** (with the DSpark drafter enabled) — an order of magnitude more energy-efficient per token than datacenter GPUs (0.63–1.32 mWh/token across the GPU classes). Local inference is not just private and low-latency but cheap in energy.
|
| 200 |
+
|
| 201 |
+
## Speculative Decoding: DSpark
|
| 202 |
+
|
| 203 |
+
1-bit Bonsai 27B ships with a **DSpark** drafter layer trained against the low-bit target — a semi-autoregressive drafter with confidence-scheduled verification. Speculative decoding is lossless: verification preserves the target distribution exactly, so accepted tokens are indistinguishable from ordinary generation.
|
| 204 |
+
|
| 205 |
+
The drafter is a compact **six-layer block-parallel transformer** conditioned on hidden states tapped from five evenly spaced layers of the target; its drafter-unique weights add roughly **0.5 GB at serving precision** (embeddings and output head are shared with the resident target). It follows the DSpark recipe with a diffusion-flavored block-denoising objective, survival-probability-weighted distillation, per-source-normalized hidden-state taps, and a draft block size chosen from a measured verify-cost model of the serving stack. The drafter ships 4-bit quantized — the \~1.79 GB Q4_1 pack is the default; it drafts faster than the bf16 reference at essentially unchanged draft quality, and because verification preserves the target distribution exactly, drafter precision affects only speed, never output quality.
|
| 206 |
+
|
| 207 |
+
On the CUDA serving path the drafter is a measured net win — an accepted length of τ ≈ 3.6 at draft depth k = 4 turns into a **1.37x** end-to-end decode speedup on H100 (104.8 → 143.8 tok/s). On Apple Silicon the batch-1 verification pass does not yet amortize, so the drafter layer is not enabled by default on-device.
|
| 208 |
+
|
| 209 |
+
## Benchmarks
|
| 210 |
+
|
| 211 |
+
Evaluated with EvalScope + vLLM on NVIDIA H100 under identical infrastructure, decoding, and scoring, in **thinking mode** — where the model's full reasoning is exercised and the sub-4-bit collapse of conventional methods is most visible. 15 benchmarks across six skill categories. For cross-family context the table also includes Gemma-4-31B, a model of the same capability tier, with its conventional low-bit builds — the collapse below 4 bits is a property of the methods, not of one base model. Bit-widths are true averages; "vs FP16" is relative to the Qwen3.6-27B FP16 reference.
|
| 212 |
+
|
| 213 |
+
| Variant | True bpw | Footprint | Thinking avg | vs FP16 |
|
| 214 |
+
| :---------------------------------------------------------------------------- | --------: | ----------: | -----------: | ---------: |
|
| 215 |
+
| Qwen3.6-27B FP16 | 16.0 | 54 GB | 85.07 | 100% |
|
| 216 |
+
| Qwen3.6-27B Q4_K_XL ("4-bit") | 5.2 | 17.6 GB | 84.99 | 99.9% |
|
| 217 |
+
| Qwen3.6-27B IQ2_XXS ("2-bit") | 2.8 | 9.4 GB | 72.73 | 85.5% |
|
| 218 |
+
| Gemma-4-31B FP16 | 16.0 | 61.5 GB | 84.58 | 99.4% |
|
| 219 |
+
| Gemma-4-31B QAT ("4-bit") | 6.0 | 23.3 GB | 83.41 | 98.0% |
|
| 220 |
+
| Gemma-4-31B Q2_K_XL ("2-bit") | 3.0 | 11.8 GB | 73.31 | 86.2% |
|
| 221 |
+
| Ternary Bonsai 27B | 1.71 | 5.9 GB | 80.49 | 94.6% |
|
| 222 |
+
| **1-bit Bonsai 27B** | **1.125** | **3.9 GB** | **76.11** | **89.5%** |
|
| 223 |
+
|
| 224 |
+
The aggregate gap also understates *how* the conventional builds fail: their degradation is selective, concentrated on the benchmarks that demand sustained chains of reasoning. IQ2_XXS falls to 57.5 on AIME26 and 56.4 on LiveCodeBench while still scoring 88.93 on MMLU-Redux — which is why casual testing misses the collapse. 1-bit Bonsai holds exactly these benchmarks, keeping AIME above 87 at a third of IQ2_XXS's footprint.
|
| 225 |
+
|
| 226 |
+
### By Skill Category
|
| 227 |
+
|
| 228 |
+
| Category | Benchmarks | FP16 | 1-bit 27B |
|
| 229 |
+
| :---------------------- | :---------------------------------- | ----: | --------: |
|
| 230 |
+
| Knowledge & reasoning | MMLU-Redux, MuSR | 83.15 | 73.39 |
|
| 231 |
+
| Math | GSM8K, MATH-500, AIME25, AIME26 | 95.33 | 91.66 |
|
| 232 |
+
| Coding | HumanEval+, MBPP+, LiveCodeBench | 88.74 | 81.88 |
|
| 233 |
+
| Instruction following | IFEval, IFBench | 78.47 | 65.74 |
|
| 234 |
+
| Agentic / tool calling | BFCL v3, τ²-Bench | 80.00 | 66.03 |
|
| 235 |
+
| Vision | MMMU-Pro, OCR Bench v2 | 72.61 | 59.57 |
|
| 236 |
+
| **Overall (15)** | | **85.07** | **76.11** |
|
| 237 |
+
|
| 238 |
+
The reasoning backbone comes through intact: math stays at 91.66 — within four points of full precision — and coding at 81.88, the behaviors that conventional sub-4-bit representations lose first. The 1-bit model trades part of the ternary model's margin on the most demanding categories for the smallest footprint in the family.
|
| 239 |
+
|
| 240 |
+
### Full Per-Benchmark Results
|
| 241 |
+
|
| 242 |
+
<details>
|
| 243 |
+
<summary>Expand full per-benchmark results (thinking mode)</summary>
|
| 244 |
+
|
| 245 |
+
| Benchmark | FP16 | 1-bit 27B |
|
| 246 |
+
| :--------------------- | ----: | --------: |
|
| 247 |
+
| MMLU-Redux | 93.42 | 82.75 |
|
| 248 |
+
| MuSR | 72.88 | 64.02 |
|
| 249 |
+
| GSM8K | 95.30 | 92.80 |
|
| 250 |
+
| MATH-500 | 99.40 | 98.00 |
|
| 251 |
+
| AIME25 | 93.29 | 88.75 |
|
| 252 |
+
| AIME26 | 93.33 | 87.08 |
|
| 253 |
+
| HumanEval+ | 95.12 | 89.63 |
|
| 254 |
+
| MBPP+ | 83.33 | 79.60 |
|
| 255 |
+
| LiveCodeBench | 87.77 | 76.40 |
|
| 256 |
+
| IFEval | 88.91 | 79.11 |
|
| 257 |
+
| IFBench (prompt-loose) | 68.03 | 52.36 |
|
| 258 |
+
| BFCL v3 | 77.10 | 70.72 |
|
| 259 |
+
| τ²-Bench | 82.90 | 61.34 |
|
| 260 |
+
| MMMU-Pro | 79.94 | 60.48 |
|
| 261 |
+
| OCR Bench v2 | 65.28 | 58.65 |
|
| 262 |
+
| **Average (15)** | **85.07** | **76.11** |
|
| 263 |
+
|
| 264 |
+
</details>
|
| 265 |
+
|
| 266 |
+
## Intelligence Density
|
| 267 |
+
|
| 268 |
+
Intelligence density captures the ratio of a model's capability to its deployed size:
|
| 269 |
+
|
| 270 |
+
```
|
| 271 |
+
D = -log2(1 - score/100) / size_GB
|
| 272 |
+
```
|
| 273 |
+
|
| 274 |
+
| Variant | Size (GB) | Benchmark avg | Intelligence Density (1/GB) |
|
| 275 |
+
| :---------------------------------------------------------------------------- | --------: | -----------: | --------------------------: |
|
| 276 |
+
| **1-bit Bonsai 27B** | **3.9** | 76.11 | **0.530** |
|
| 277 |
+
| Ternary Bonsai 27B | 5.9 | 80.49 | 0.400 |
|
| 278 |
+
| Qwen3.6-27B IQ2_XXS | 9.4 | 72.73 | 0.199 |
|
| 279 |
+
| Gemma-4-31B Q2_K_XL | 11.8 | 73.31 | 0.162 |
|
| 280 |
+
| Qwen3.6-27B Q4_K_XL | 17.6 | 84.99 | 0.155 |
|
| 281 |
+
| Gemma-4-31B QAT | 23.3 | 83.41 | 0.111 |
|
| 282 |
+
| Qwen3.6-27B FP16 | 54 | 85.07 | 0.051 |
|
| 283 |
+
| Gemma-4-31B FP16 | 61.5 | 84.58 | 0.044 |
|
| 284 |
+
|
| 285 |
+
1-bit Bonsai 27B delivers roughly **2.7x** the density of the densest conventional build (IQ2_XXS at 0.199) and over **10x** FP16 — no conventional build of Qwen3.6-27B or Gemma-4-31B exceeds 0.2. Each stored gigabyte is translated into far more usable intelligence.
|
| 286 |
+
|
| 287 |
+
## Use Cases
|
| 288 |
+
|
| 289 |
+
- **Laptop-local 27B agents**: full 27B reasoning and tool use on any standard laptop at \~26–66 tok/s (M4 Pro through M5 Max), with the 262K context available for long-document analysis and full-repository code work
|
| 290 |
+
- **Privacy-sensitive and offline settings**: on-device execution keeps prompts and data on the device by construction, and works with intermittent or no connectivity
|
| 291 |
+
- **Single-GPU and commodity-GPU serving**: 27B-class quality from a single consumer or entry-level datacenter GPU, with headroom for larger batches, longer contexts, or co-resident models — combined with the KV-cache quantization, high-throughput serving and long-context document analysis become practical on a single 24 GB GPU
|
| 292 |
+
- **Phone deployment via MLX**: the same weights ship as [Bonsai-27B-mlx-1bit](https://huggingface.co/prism-ml/Bonsai-27B-mlx-1bit) — the first 27B-class model to run on a phone
|
| 293 |
+
|
| 294 |
+
## Limitations
|
| 295 |
+
|
| 296 |
+
- **The quality–footprint trade-off**: the binary model retains 89.5% of the full-precision average, and the gap is modest and predictable — the reasoning core (math, coding) stays within a few points of baseline, with the difference concentrated in the most demanding categories; if quality is the priority, consider the ternary GGUF build (94.6%)
|
| 297 |
+
- **Agentic coding** (long-horizon, multi-file, run-test-and-repair workflows) is not yet a strong target of this release; a Bonsai 27B variant tuned for agentic coding is next on the roadmap
|
| 298 |
+
- **KV compression headroom**: this release standardizes on a 4-bit KV cache; Bonsai's tolerance to KV-cache error grows with context length, and early results show the key cache can be pushed toward the sub-2-bit regime — a path to still longer contexts within a fixed device-memory budget
|
| 299 |
+
|
| 300 |
+
## Citation
|
| 301 |
+
|
| 302 |
+
If you use 1-bit Bonsai 27B, please cite:
|
| 303 |
+
|
| 304 |
+
```bibtex
|
| 305 |
+
@techreport{bonsai27b,
|
| 306 |
+
title = {Bonsai 27B: Full 27B-Class Reasoning in Binary and Ternary
|
| 307 |
+
Transformer Weights --- on Laptops and Phones},
|
| 308 |
+
author = {Prism ML},
|
| 309 |
+
year = {2026},
|
| 310 |
+
month = {July},
|
| 311 |
+
url = {https://prismml.com}
|
| 312 |
+
}
|
| 313 |
+
```
|
| 314 |
+
|
| 315 |
+
## Contact
|
| 316 |
+
|
| 317 |
+
For questions, feedback, or collaboration inquiries: **contact@prismml.com**
|
assets/bonsai-logo.svg
ADDED
|
|