Instructions to use apothic/bonsai-8B-1bit-turboquant 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 apothic/bonsai-8B-1bit-turboquant 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 apothic/bonsai-8B-1bit-turboquant # Run inference directly in the terminal: llama cli -hf apothic/bonsai-8B-1bit-turboquant
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf apothic/bonsai-8B-1bit-turboquant # Run inference directly in the terminal: llama cli -hf apothic/bonsai-8B-1bit-turboquant
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 apothic/bonsai-8B-1bit-turboquant # Run inference directly in the terminal: ./llama-cli -hf apothic/bonsai-8B-1bit-turboquant
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 apothic/bonsai-8B-1bit-turboquant # Run inference directly in the terminal: ./build/bin/llama-cli -hf apothic/bonsai-8B-1bit-turboquant
Use Docker
docker model run hf.co/apothic/bonsai-8B-1bit-turboquant
- LM Studio
- Jan
- Ollama
How to use apothic/bonsai-8B-1bit-turboquant with Ollama:
ollama run hf.co/apothic/bonsai-8B-1bit-turboquant
- Unsloth Studio
How to use apothic/bonsai-8B-1bit-turboquant 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 apothic/bonsai-8B-1bit-turboquant 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 apothic/bonsai-8B-1bit-turboquant to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for apothic/bonsai-8B-1bit-turboquant to start chatting
- Pi
How to use apothic/bonsai-8B-1bit-turboquant with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf apothic/bonsai-8B-1bit-turboquant
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": "apothic/bonsai-8B-1bit-turboquant" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use apothic/bonsai-8B-1bit-turboquant with Docker Model Runner:
docker model run hf.co/apothic/bonsai-8B-1bit-turboquant
- Lemonade
How to use apothic/bonsai-8B-1bit-turboquant with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull apothic/bonsai-8B-1bit-turboquant
Run and chat with the model
lemonade run user.bonsai-8B-1bit-turboquant-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use apothic/bonsai-8B-1bit-turboquant with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf apothic/bonsai-8B-1bit-turboquant
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 apothic/bonsai-8B-1bit-turboquant
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use apothic/bonsai-8B-1bit-turboquant with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf apothic/bonsai-8B-1bit-turboquant
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 "apothic/bonsai-8B-1bit-turboquant" \ --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"
File size: 5,052 Bytes
2b4501a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | #!/bin/sh
# Shared helpers for Bonsai demo scripts.
# Source this file: . "$(dirname "$0")/common.sh"
# ββ Model selection ββ
# Set BONSAI_MODEL to choose which model size to use.
# Valid values: 8B (default), 4B, 1.7B
BONSAI_MODEL="${BONSAI_MODEL:-8B}"
GGUF_MODEL_DIR="models/gguf/${BONSAI_MODEL}"
MLX_MODEL_DIR="models/Bonsai-${BONSAI_MODEL}-mlx"
# Validate BONSAI_MODEL β call at the top of every run/server script
assert_valid_model() {
case "$BONSAI_MODEL" in
8B|4B|1.7B) return 0 ;;
*)
err "Unknown BONSAI_MODEL='${BONSAI_MODEL}'. Valid values: 8B, 4B, 1.7B"
echo " Example: export BONSAI_MODEL=8B"
exit 1 ;;
esac
}
# Check GGUF model is downloaded β prompts to download if missing
assert_gguf_downloaded() {
if ! ls "$GGUF_MODEL_DIR"/*.gguf >/dev/null 2>&1; then
err "GGUF model not found for Bonsai-${BONSAI_MODEL} (expected in ${GGUF_MODEL_DIR}/)."
echo " Download it with:"
echo " BONSAI_MODEL=${BONSAI_MODEL} ./scripts/download_models.sh"
exit 1
fi
}
# Check MLX model is downloaded β prompts to download if missing
assert_mlx_downloaded() {
if [ ! -f "$MLX_MODEL_DIR/config.json" ]; then
err "MLX model not found for Bonsai-${BONSAI_MODEL} (expected in ${MLX_MODEL_DIR}/)."
echo " Download it with:"
echo " BONSAI_MODEL=${BONSAI_MODEL} ./scripts/download_models.sh"
exit 1
fi
}
# ββ Colors ββ
if [ -t 1 ]; then
_CLR_GREEN="\033[32m"
_CLR_YELLOW="\033[33m"
_CLR_RED="\033[31m"
_CLR_CYAN="\033[36m"
_CLR_RESET="\033[0m"
else
_CLR_GREEN="" _CLR_YELLOW="" _CLR_RED="" _CLR_CYAN="" _CLR_RESET=""
fi
info() { printf "${_CLR_GREEN}[OK]${_CLR_RESET} %s\n" "$*"; }
warn() { printf "${_CLR_YELLOW}[WARN]${_CLR_RESET} %s\n" "$*"; }
err() { printf "${_CLR_RED}[ERR]${_CLR_RESET} %s\n" "$*" >&2; }
step() { printf "${_CLR_CYAN}==> %s${_CLR_RESET}\n" "$*"; }
# ββ download(url, dest) β supports curl and wget ββ
download() {
if command -v curl >/dev/null 2>&1; then
curl -LsSf "$1" -o "$2"
elif command -v wget >/dev/null 2>&1; then
wget -qO "$2" "$1"
else
err "Neither curl nor wget found. Install one and re-run."
exit 1
fi
}
# ββ Smart context size for llama.cpp ββ
# Default: -c 0 lets llama.cpp's --fit auto-size KV cache to available memory.
# Fallback: if -c 0 is not supported, pick a safe value from system RAM.
# Max context: 65536.
# Memory = ~1.1 GB weights + ~140 bytes/token KV cache + activations.
# 8 GB β -c 8192 (~2.5 GB total, leaves ~5 GB for OS)
# 16 GB β -c 32768 (~5.9 GB total, leaves ~10 GB for OS)
# 24 GB+ β -c 65536 (~10.5 GB total, leaves ~13+ GB for OS)
CTX_SIZE_DEFAULT=0
get_context_size_fallback() {
if [ "$(uname -s)" = "Darwin" ]; then
_mem_gb=$(( $(sysctl -n hw.memsize) / 1073741824 ))
else
_mem_kb=$(awk '/MemTotal/ {print $2}' /proc/meminfo 2>/dev/null)
_mem_gb=$(( ${_mem_kb:-0} / 1048576 ))
fi
if [ "$_mem_gb" -le 8 ] 2>/dev/null; then
echo 8192
elif [ "$_mem_gb" -le 18 ] 2>/dev/null; then
echo 32768
else
echo 65536
fi
}
# ββ Resolve DEMO_DIR (parent of scripts/) ββ
resolve_demo_dir() {
_script_dir="$(cd "$(dirname "$0")" && pwd)"
echo "$(cd "$_script_dir/.." && pwd)"
}
# ββ Locate a llama.cpp binary ββ
# Optional override:
# BONSAI_LLAMA_BIN_DIR=/abs/path/to/bin
find_llama_bin() {
_demo_dir="$1"
_bin_name="$2"
for _dir in \
"${BONSAI_LLAMA_BIN_DIR:-}" \
"$_demo_dir/../llama.cpp-1bit-turboquant/build-tbq-cuda/bin" \
"$_demo_dir/../llama.cpp-1bit-turboquant/build-cuda/bin" \
"$_demo_dir/../llama.cpp-1bit-turboquant/build/bin" \
"$_demo_dir/../prism-llama.cpp/build-tbq-cuda/bin" \
"$_demo_dir/../prism-llama.cpp/build-cuda/bin" \
"$_demo_dir/../prism-llama.cpp/build/bin" \
"$_demo_dir/../embed/llama.cpp/build-tbq-cuda/bin" \
"$_demo_dir/../embed/llama.cpp/build-cuda/bin" \
"$_demo_dir/../embed/llama.cpp/build/bin" \
"$_demo_dir/../embed/llama.cpp/build-tbq-cpu/bin" \
"$_demo_dir/llama.cpp/build-tbq-cuda/bin" \
"$_demo_dir/llama.cpp/build-cuda/bin" \
"$_demo_dir/llama.cpp/build/bin" \
"$_demo_dir/llama.cpp/build-mac/bin" \
"$_demo_dir/bin/cuda" \
"$_demo_dir/bin/mac"
do
[ -n "$_dir" ] || continue
if [ -f "$_dir/$_bin_name" ]; then
echo "$_dir/$_bin_name"
return 0
fi
done
return 1
}
# ββ Ensure .venv is active (for MLX / Python scripts) ββ
ensure_venv() {
_demo="$1"
if [ -z "$VIRTUAL_ENV" ] && [ -f "$_demo/.venv/bin/activate" ]; then
. "$_demo/.venv/bin/activate"
fi
if [ -z "$VIRTUAL_ENV" ]; then
err "Python venv not found. Create one with 'uv venv .venv --python 3.11' and install the Python deps you need."
exit 1
fi
}
|