Instructions to use OS-Software/Ternary-Bonsai-27B-heretic-ja-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 OS-Software/Ternary-Bonsai-27B-heretic-ja-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 OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0 # Run inference directly in the terminal: llama cli -hf OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0 # Run inference directly in the terminal: llama cli -hf OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_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 OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0 # Run inference directly in the terminal: ./llama-cli -hf OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_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 OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0
Use Docker
docker model run hf.co/OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0
- LM Studio
- Jan
- Ollama
How to use OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF with Ollama:
ollama run hf.co/OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0
- Unsloth Desktop
- Pi
How to use OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_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": "OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF with Docker Model Runner:
docker model run hf.co/OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0
- Lemonade
How to use OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0
Run and chat with the model
lemonade run user.Ternary-Bonsai-27B-heretic-ja-GGUF-Q2_0
List all available models
lemonade list
- Hermes Agent
How to use OS-Software/Ternary-Bonsai-27B-heretic-ja-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 OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_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 OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_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 "OS-Software/Ternary-Bonsai-27B-heretic-ja-GGUF:Q2_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"
This is a decensored version of prism-ml/Ternary-Bonsai-27B-unpacked, made using Heretic v1.4.0 with the Arbitrary-Rank Ablation (ARA) method using a LoRA adapter and row-norm preservation
Abliteration parameters
| Parameter | Value |
|---|---|
| start_layer_index | 10 |
| end_layer_index | 51 |
| preserve_good_behavior_weight | 0.6491 |
| steer_bad_behavior_weight | 0.0008 |
| overcorrect_relative_weight | 0.9874 |
| neighbor_count | 14 |
Performance
| Metric | This model | Original model (prism-ml/Ternary-Bonsai-27B-unpacked) |
|---|---|---|
| Keywords | 2/100 | 98/100 |
| KL divergence | 0.0243 | 0 (by definition) |
Note: Performance testing, including the measurement of refusal rates, was conducted using Japanese datasets (harmless_alpaca_ja, harmful_behaviors_ja).
โ ๏ธ Important Notice
This model has undergone substantial reduction of its safety alignment. As a result, it is more likely than standard models to generate harmful, inaccurate, biased, offensive, or otherwise inappropriate content.
Intended Use
For research and experimentation only, including safety research, alignment studies, and red-teaming. Please avoid deploying it in public or end-user-facing services.
User Responsibility
All outputs should be treated as untrusted and independently verified before use. Users are solely responsible for:
- Evaluating the accuracy and suitability of generated content
- Implementing appropriate safeguards and human oversight
- Complying with applicable laws, regulations, licenses, and ethical standards
Use of this model is entirely at your own risk.
Disclaimer
OS-Software provides this model without warranties of any kind and assumes no liability for any direct or indirect damages, losses, misuse, or legal consequences arising from its use.
Acknowledgements
Thanks to the base model developers, p-e-w for Heretic, and the wider open-source community.
This is a derivative work released under the base modelโs applicable license. All rights to the base model remain with their respective owners.
Ternary Bonsai 27B โ Unpacked FP16 Safetensors
FP16 safetensors (HuggingFace format) of the Ternary Bonsai 27B model. This repo exists for users who want to run Ternary Bonsai with stock HuggingFace tooling or frameworks that don't yet support the packed ternary format. The 2-bit hybrid-attention kernels are currently in our forks of MLX, mlx-swift, and llama.cpp โ once they land upstream, this unpacked version will no longer be needed.
We strongly recommend using the natively packed models instead. The packed format is where all the benefits of Bonsai come from โ a 7.2 GB deployed footprint (down from 54 GB), 95% of FP16 intelligence retained, and interactive decoding on everyday laptops (26 tok/s on an M5 Pro). This unpacked FP16 version is full-size and does not provide any of those advantages.
For the optimized ternary release models (recommended):
- Ternary-Bonsai-27B-mlx-2bit โ Ternary MLX for Apple Silicon
- Ternary GGUF (Q2_0_g128) for llama.cpp (CUDA, Metal, CPU)
For the phone-class variant:
- Bonsai-27B-mlx-1bit โ 1-bit Bonsai 27B (~3.9 GB), fits an iPhone 17 Pro Max
- Downloads last month
- 5,764
2-bit