Instructions to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Gorilla4X/Bonsai-8B-Ternary-RDNA4", filename="Ternary-Bonsai-8B-F16.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 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 Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16 # Run inference directly in the terminal: llama cli -hf Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16 # Run inference directly in the terminal: llama cli -hf Gorilla4X/Bonsai-8B-Ternary-RDNA4: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 Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16 # Run inference directly in the terminal: ./llama-cli -hf Gorilla4X/Bonsai-8B-Ternary-RDNA4: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 Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16
Use Docker
docker model run hf.co/Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16
- LM Studio
- Jan
- Ollama
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with Ollama:
ollama run hf.co/Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16
- Unsloth Studio
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Gorilla4X/Bonsai-8B-Ternary-RDNA4 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Gorilla4X/Bonsai-8B-Ternary-RDNA4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Gorilla4X/Bonsai-8B-Ternary-RDNA4 to start chatting
- Pi
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Gorilla4X/Bonsai-8B-Ternary-RDNA4: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 Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Gorilla4X/Bonsai-8B-Ternary-RDNA4: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 "Gorilla4X/Bonsai-8B-Ternary-RDNA4: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"
- Docker Model Runner
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with Docker Model Runner:
docker model run hf.co/Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16
- Lemonade
How to use Gorilla4X/Bonsai-8B-Ternary-RDNA4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Gorilla4X/Bonsai-8B-Ternary-RDNA4:F16
Run and chat with the model
lemonade run user.Bonsai-8B-Ternary-RDNA4-F16
List all available models
lemonade list
Bonsai-8B Ternary β RDNA4 (The Rock8) π¦
RDNA4 (gfx1201) GGUF builds of prism-ml/Ternary-Bonsai-8B β a dense Qwen3-8B trained natively ternary (QAT, 1.58-bit). Part of the The Rock8 β RDNA4 fp8 collection.
This repo is the async speculative-decoding showcase for The Rock8 β the config that hits +66% decode on a dual-R9700 box, byte-identical output.
Files
| File | Size | Role |
|---|---|---|
Ternary-Bonsai-8B-F16.gguf |
16.4 GB | Verify target β ternary weights in F16 storage, runs on RDNA4 WMMA |
Ternary-Bonsai-8B-Q2_0.gguf |
2.18 GB | The ternary self-draft β the cheap drafter that makes async win |
Ternary-Bonsai-8B-F8E4M3.gguf |
8.6 GB | Native RDNA4 fp8 (E4M3) build |
The async spec-decode win (measured on gfx1201, dual R9700)
Using the ternary Q2 draft to speculate for the F16 target, with The Rock8's async pipeline (LLAMA_SPEC_ASYNC=2) β draft-gen on GPU1 β verify on GPU0:
| Config | Decode t/s | Accept | Output |
|---|---|---|---|
| Sequential, 1-GPU | 63.30 Β± 0.53 | 100% | baseline |
| Async pipeline, 2-GPU | 105.08 Β± 0.70 | 100% | byte-identical β |
+66% decode, zero quality loss (re-validated 2026-07-13 on the TheRock ROCm 7.13 build; peaks ~111 t/s / +75% on an unloaded box).
Why it works β "intel per byte"
A natively-ternary model is its own near-lossless, cheap draft. The Q2 draft runs on the VALU/mmvq path while the F16 target verifies on the WMMA tensor cores β different execution units, so draft-gen and verify genuinely overlap instead of fighting for the same silicon. That disjoint-compute overlap is the whole trick, and it's why async pays off here but not on a same-precision self-draft (draft costs as much as verify β nothing to hide).
Note: the async pipeline is a 2-GPU lever and needs a dense target (plain-attention KV supports the pipeline's partial-rollback). Hybrid SSM/GatedDeltaNet targets need a core-level rollback fix β see the collection notes.
Not Bonsai-specific β async wins on off-the-shelf models too
The pipeline is a general lever: it wins whenever the verify is heavy and the draft is cheap. Same trick, vanilla Qwen3-8B (byte-identical output in every case):
| Target | Draft | Async Ξ |
|---|---|---|
| Qwen3-8B fp8 (light) | Q4_K_M | β9% (too light β loses) |
| Qwen3-8B BF16 (heavy) | Q4_K_M | +14.5% |
| Qwen3-8B BF16 (heavy) | Q2_K | +21.9% |
| Bonsai F16 (heavy) | ternary Q2 (VALU) | +66% |
Swapping the identical Q4 draft from an fp8 target to a BF16 target flips β9% β +14.5% β the target's verify-weight is the deciding lever, not the draft. Bonsai tops the table because its ternary draft runs entirely off the WMMA units (max overlap); a heavier target Γ a cheaper draft β a bigger win.
Usage (The Rock8 fork)
# async 2-GPU: ternary Q2 draft β F16 verify
LLAMA_SPEC_ASYNC=2 ./llama-speculative-simple \
-m Ternary-Bonsai-8B-F16.gguf -dev ROCm0 \
-md Ternary-Bonsai-8B-Q2_0.gguf -devd ROCm1 \
--spec-type draft-simple --spec-draft-n-max 4 \
-c 2048 --temp 0 -n 130 \
-p "What do you call a dried grape? Answer in one word."
Build: github.com/The-Monk/The-Rock8 (RDNA4 native-fp8 llama.cpp fork + Podman appliance).
Attribution & license
Base model prism-ml/Ternary-Bonsai-8B by PrismML, Apache-2.0. These are GGUF conversions/quantizations for RDNA4; all credit for the model and its ternary QAT training to PrismML. Distributed under the same Apache-2.0 license.
π¦ Got any weights?
- Downloads last month
- 210
16-bit