Instructions to use prism-ml/Bonsai-8B-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 prism-ml/Bonsai-8B-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 prism-ml/Bonsai-8B-gguf:Q1_0 # Run inference directly in the terminal: llama cli -hf prism-ml/Bonsai-8B-gguf:Q1_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf prism-ml/Bonsai-8B-gguf:Q1_0 # Run inference directly in the terminal: llama cli -hf prism-ml/Bonsai-8B-gguf:Q1_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf prism-ml/Bonsai-8B-gguf:Q1_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf prism-ml/Bonsai-8B-gguf:Q1_0
Use Docker
docker model run hf.co/prism-ml/Bonsai-8B-gguf:Q1_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use prism-ml/Bonsai-8B-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prism-ml/Bonsai-8B-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": "prism-ml/Bonsai-8B-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prism-ml/Bonsai-8B-gguf:Q1_0
- Ollama
How to use prism-ml/Bonsai-8B-gguf with Ollama:
ollama run hf.co/prism-ml/Bonsai-8B-gguf:Q1_0
- Unsloth Desktop
- Pi
How to use prism-ml/Bonsai-8B-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf prism-ml/Bonsai-8B-gguf:Q1_0
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": "prism-ml/Bonsai-8B-gguf:Q1_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use prism-ml/Bonsai-8B-gguf with Docker Model Runner:
docker model run hf.co/prism-ml/Bonsai-8B-gguf:Q1_0
- Lemonade
How to use prism-ml/Bonsai-8B-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull prism-ml/Bonsai-8B-gguf:Q1_0
Run and chat with the model
lemonade run user.Bonsai-8B-gguf-Q1_0
List all available models
lemonade list
- Hermes Agent
How to use prism-ml/Bonsai-8B-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 prism-ml/Bonsai-8B-gguf:Q1_0
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-8B-gguf:Q1_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use prism-ml/Bonsai-8B-gguf with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf prism-ml/Bonsai-8B-gguf:Q1_0
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-8B-gguf:Q1_0" \ --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"
Poor performance
Hey guys,
I tried to use Bonsai 8b gguf in LM Studio for some tests and general text task, comparing it's capabilities to other similar size models.
Speed of the model load, inference and token generation is lighting fast, however, the quality of produced answers of Bonsai 8b is poor. Even for basic comparison tests on reasoning/coding it gives really bad answers - I wonder if there is any issue with LM studio's llama.cpp backend or any other reason?
I'm really excited with what you bring to the table with native ternary/1 bit model training and I wish this works well π
Any ideas on improvement?
Thanks for testing it and glad the speed benefits came through.
On quality, weβd love to better understand exactly what youβre seeing. Local GGUF runs can be sensitive to a few variables: the specific GGUF file, prompt/chat template, LM Studio version, and the llama.cpp backend. One useful sanity check would be to try the model through our demo repository and see whether the behavior persists there: https://github.com/PrismML-Eng/Bonsai-demo/
Separately, Bonsai 8B is optimized for local, low-memory, high-throughput use. For harder reasoning and coding tasks, the gap between small local models and larger models will still show up. That said, we want the out-of-box experience to be strong for general local tasks, so concrete examples would be very helpful for us to reproduce and debug.
Hello @bansaltushar92 ,
I have not checked your demo repository yet. Since I saw that the PR for llama.cpp 1-bit support was accepted, I went straight to testing the model in LM Studio.
I am using LM Studio 0.4.18 with the following backend:
{
"extension_type": "engine",
"domains": [
"llm",
"embedding"
],
"engine": "llama.cpp",
"target_libraries": [
{
"name": "llm_engine_cuda12.node",
"type": "llm_engine",
"version": "0.1.2"
},
{
"name": "liblmstudio_bindings_cuda12.node",
"type": "liblmstudio",
"version": "0.2.26"
}
],
"supported_model_formats": [
"gguf"
],
"engine_protocol_server": {
"runtime_kind": "llama-server",
"executable_relative_path": "llama-server.exe"
},
"name": "llama.cpp-win-x86_64-nvidia-cuda12-avx2",
"version": "2.24.0",
"platform": "win",
"cpu": {
"architecture": "x86_64",
"instruction_set_extensions": [
"AVX2"
]
},
"gpu": {
"make": "Nvidia",
"framework": "CUDA",
"targets": [
"7.5",
"8.0",
"8.9",
"9.0",
"10.0",
"12.0"
],
"minimum_driver_version": "12040"
},
"manifest_version": "4",
"minimum_lmstudio_version": "0.4.0+15",
"minimum_llmster_version": "0.0.1+9",
"vendor_lib_package_names": [
"win-llama-cuda12-vendor-v2"
]
}
For inference, I used the recommended parameters from the model card:
Temperature: 0.5
Top-K: 20
Top-P: 0.9
Repeat penalty: 1
My hardware:
GPU: RTX 4070 Ti
RAM: 32 GB DDR5
CPU: i7-13700KF
I tested the model with the following scheduling problem:
You are managing a small compute cluster with 4 machines: A, B, C, D.
You must schedule 6 jobs: J1 β¦ J6.
Each job has:
- a duration in hours
- machine constraints
- dependency constraints
Cluster rules:
- A machine can run only one job at a time
- Jobs start at integer hours
- All jobs start at or after hour 0
Objective:
Minimize total completion time (makespan)
Job definitions:
| Job | Duration | Allowed Machines | Dependencies |
|-----|----------|------------------|--------------|
| J1 | 3 | A, B | none |
| J2 | 2 | B, C | J1 |
| J3 | 4 | A, C | none |
| J4 | 1 | C, D | J2 |
| J5 | 2 | B, D | J1 |
| J6 | 3 | A, D | J3, J4 |
Required output format:
- For each job: (job, machine, start_time, end_time)
- Final makespan
- One sentence justifying why this schedule is optimal
The Bonsai 8B response was:
Here is the optimal schedule:
- J1 on A, start at 0, end at 3
- J2 on B, start at 3, end at 5
- J4 on C, start at 5, end at 6
- J5 on D, start at 6, end at 7
- J3 on A, start at 7, end at 11
- J6 on D, start at 11, end at 14
Final makespan: 14 hours
Justification: This schedule minimizes the total completion time by carefully sequencing jobs to avoid conflicts on machines and respecting dependencies. Job J6, which has the longest duration and depends on J3 and J4, is scheduled last on D to ensure it completes after all required jobs. The use of A for J1 and J3, and D for J5 and J6, optimally utilizes the cluster resources without overlap.
However, the expected optimal makespan is actually 9 hours, not 14. Smaller models, such as Gemma 4B, correctly identify the 9-hour schedule.
One valid optimal schedule is:
J1: A, start 0, end 3
J3: C, start 0, end 4
J2: B, start 3, end 5
J5: D, start 3, end 5
J4: C, start 5, end 6
J6: D, start 6, end 9
Final makespan: 9 hours
This makespan is optimal because J6 depends on both J3 and J4, while J4 depends on J2, which depends on J1. Therefore, the critical dependency chain is J1 β J2 β J4 β J6, with total duration 3 + 2 + 1 + 3 = 9 hours. Since no valid schedule can finish earlier than this lower bound, the 9-hour schedule is optimal.
Could you please clarify whether this issue is expected at the current stage of the GGUF / llama.cpp implementation, or whether there are specific inference settings or prompt formatting requirements recommended for this model?
you should test the prompt against the demo repo bc now this thread has me questioning whether I shouldn't use the llama.cpp release
Thanks for following up and for testing this in the demo repo as well. That is very helpful.
For context, Bonsai 8B is optimized for local, low-memory, high-throughput use. It should perform well on many general chat, instruction following and local tasks, but harder thinking and reasoning-style prompts can still be brittle at this model size. That is broadly consistent with other small local models in this class, including the Qwen3 8B model that Bonsai 8B is based on.
That said, we are actively working on more capable Bonsai models with stronger reasoning, coding, and agentic workflow performance. Please stay tuned.
Now that cpu q2_0 PR had been merged into llamacpp main, will you release other pr soon ? ( Cuda )
Yes, for now waiting for the Metal PR to get merged (they allow only one PR open at a time). Sending Cuda after.
llama.cpp and HF Transformers apply sampling in different order and that results in different token probabilities.
Temperature is first for HF Transformers but last for llama.cpp
To fix that, specify the sequence explicitly: --samplers "temperature;top_k;top_p"