Instructions to use vinpix/Bonsai-8B-TQ-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use vinpix/Bonsai-8B-TQ-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="vinpix/Bonsai-8B-TQ-GGUF", filename="Bonsai-8B-TQ1_0-Q4out-llamacpp.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use vinpix/Bonsai-8B-TQ-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 vinpix/Bonsai-8B-TQ-GGUF:TQ1_0 # Run inference directly in the terminal: llama cli -hf vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf vinpix/Bonsai-8B-TQ-GGUF:TQ1_0 # Run inference directly in the terminal: llama cli -hf vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
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 vinpix/Bonsai-8B-TQ-GGUF:TQ1_0 # Run inference directly in the terminal: ./llama-cli -hf vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
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 vinpix/Bonsai-8B-TQ-GGUF:TQ1_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
Use Docker
docker model run hf.co/vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
- LM Studio
- Jan
- vLLM
How to use vinpix/Bonsai-8B-TQ-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vinpix/Bonsai-8B-TQ-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": "vinpix/Bonsai-8B-TQ-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
- Ollama
How to use vinpix/Bonsai-8B-TQ-GGUF with Ollama:
ollama run hf.co/vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
- Unsloth Studio
How to use vinpix/Bonsai-8B-TQ-GGUF 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 vinpix/Bonsai-8B-TQ-GGUF 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 vinpix/Bonsai-8B-TQ-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for vinpix/Bonsai-8B-TQ-GGUF to start chatting
- Pi
How to use vinpix/Bonsai-8B-TQ-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
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": "vinpix/Bonsai-8B-TQ-GGUF:TQ1_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use vinpix/Bonsai-8B-TQ-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 vinpix/Bonsai-8B-TQ-GGUF:TQ1_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 vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use vinpix/Bonsai-8B-TQ-GGUF with Docker Model Runner:
docker model run hf.co/vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
- Lemonade
How to use vinpix/Bonsai-8B-TQ-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull vinpix/Bonsai-8B-TQ-GGUF:TQ1_0
Run and chat with the model
lemonade run user.Bonsai-8B-TQ-GGUF-TQ1_0
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)Bonsai-8B ternary GGUF (stock llama.cpp)
GGUF repacks of Ternary-Bonsai-8B that run on stock llama.cpp, LM Studio and Ollama with no fork required.
Original model: prism-ml/Ternary-Bonsai-8B-gguf Quantized with llama.cpp from the F16 source.
Two variants
| File | Body | Bit-packing | Size |
|---|---|---|---|
| Bonsai-8B-TQ1_0-Q4out-llamacpp.gguf | TQ1_0 | 1.69 bpw | ~2.02 GiB |
| Bonsai-8B-TQ2_0-Q4out-llamacpp.gguf | TQ2_0 | 2.06 bpw | ~2.32 GiB |
Both use Q4_0 for output and token embeddings, and have RoPE/YaRN scaling removed (native context up to 16k).
Quality: the two variants are equivalent
TQ1_0 and TQ2_0 encode the same ternary weights {-1, 0, +1}; they differ only in how those weights are bit-packed. Both are lossless packings of identical values, so they are not just close โ they are interchangeable in output.
Measured with KL-divergence (llama.cpp --kl-divergence) of TQ1_0 against TQ2_0 on wikitext-2:
- Same top-1 token: 100.0% โ the two files pick the same most-likely token at every position tested
- Mean token-probability difference: ~0.000%
- Maximum token-probability difference: 0.005%
Perplexity on wikitext-2 is identical for both. The choice between them is purely size vs. compatibility, never quality.
Which to pick
- TQ1_0 โ the smaller file (~300 MB less). Use it when disk/RAM footprint is the priority.
- TQ2_0 โ the most broadly compatible option (the TQ2_0 tensor type has been in mainline llama.cpp longer, and its simpler byte-aligned packing is handled well across builds and backends).
If a TQ1_0 build ever produces garbled output on a particular setup (some backends have had issues with low-bit types), use the TQ2_0 file instead โ the output is identical by construction.
Why this repack
The official PrismML Q2_0 release uses a g128 tensor type that only loads in the PrismML fork; on a stock llama.cpp build it fails with an unknown ggml type. These repacks use only mainline tensor types, so they load on any current llama.cpp, LM Studio or Ollama, today. (A similar compatibility repack is lilyanatia/Bonsai-8B-requantized.)
Quantization layout
The body is kept in its native ternary form. TQ1_0 and TQ2_0 both represent {-1, 0, +1} weights exactly (lossless), which is why their outputs match. Output and token-embedding tensors carry the only non-ternary information and are quantized to Q4_0 from the F16 source.
On this ternary model, Q4_0 gave the best perplexity-to-size trade-off for the output and embedding tensors. Because the underlying model is trained natively ternary, "richer" formats (Q5_K, Q6_K, IQ4_NL, and k-quants) measured worse perplexity than Q4_0 on these tensors, not better โ higher-bit grids reintroduce quantization noise around weights that are already exact. Promoting any subset of the ternary body to higher precision likewise increases perplexity. The uniform native-ternary layout is the optimum here.
Run
# TQ1_0 (smaller)
llama-cli -m Bonsai-8B-TQ1_0-Q4out-llamacpp.gguf --temp 0.5 --top-p 0.85 --top-k 20 -p "Your prompt" -n 256
# TQ2_0 (widest compatibility)
llama-cli -m Bonsai-8B-TQ2_0-Q4out-llamacpp.gguf --temp 0.5 --top-p 0.85 --top-k 20 -p "Your prompt" -n 256
For CPU, set -t to your physical core count. Recommended sampling defaults (temp 0.5, top_p 0.85, top_k 20) are baked into both files. On CPU, plain attention (no --flash-attn) is generally fine for generation.
Notes
- These are requantizations, not retrains; capabilities are inherited from Ternary-Bonsai-8B.
- The official PrismML g128 build packs the ternary weights at a finer group size (128 vs the 256 used by the mainline TQ types), which is marginally more precise on the weights but requires their fork; these repacks trade that for portability on stock tooling.
- For context above 16k, use the official build.
- Downloads last month
- 479
1-bit
2-bit
Model tree for vinpix/Bonsai-8B-TQ-GGUF
Base model
prism-ml/Ternary-Bonsai-8B-unpacked
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="vinpix/Bonsai-8B-TQ-GGUF", filename="", )