Instructions to use zotowata/bonsai2-dflash2-fastfork 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 zotowata/bonsai2-dflash2-fastfork 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 zotowata/bonsai2-dflash2-fastfork # Run inference directly in the terminal: llama cli -hf zotowata/bonsai2-dflash2-fastfork
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf zotowata/bonsai2-dflash2-fastfork # Run inference directly in the terminal: llama cli -hf zotowata/bonsai2-dflash2-fastfork
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 zotowata/bonsai2-dflash2-fastfork # Run inference directly in the terminal: ./build/bin/llama cli -hf zotowata/bonsai2-dflash2-fastfork
Use Docker
docker model run hf.co/zotowata/bonsai2-dflash2-fastfork
- Llama new
- LM Studio
- Jan
- Ollama
How to use zotowata/bonsai2-dflash2-fastfork with Ollama:
ollama run hf.co/zotowata/bonsai2-dflash2-fastfork
- Unsloth Desktop
- Pi
How to use zotowata/bonsai2-dflash2-fastfork with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zotowata/bonsai2-dflash2-fastfork
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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "zotowata/bonsai2-dflash2-fastfork" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use zotowata/bonsai2-dflash2-fastfork with Docker Model Runner:
docker model run hf.co/zotowata/bonsai2-dflash2-fastfork
- Lemonade
How to use zotowata/bonsai2-dflash2-fastfork with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull zotowata/bonsai2-dflash2-fastfork
Run and chat with the model
lemonade run user.bonsai2-dflash2-fastfork-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use zotowata/bonsai2-dflash2-fastfork with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zotowata/bonsai2-dflash2-fastfork
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:9931/v1 hermes config set model.default zotowata/bonsai2-dflash2-fastfork
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use zotowata/bonsai2-dflash2-fastfork with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zotowata/bonsai2-dflash2-fastfork
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:9931/v1 \ --custom-model-id "zotowata/bonsai2-dflash2-fastfork" \ --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"
Download scripts/bench_lm.py from zotowata/bonsai2-dflash2-fastfork: direct link, hf CLI and curl.
- Browser
- Download file 4.23 kB
-
https://huggingface.co/zotowata/bonsai2-dflash2-fastfork/resolve/main/scripts/bench_lm.py
- Command line
-
hf download hf://zotowata/bonsai2-dflash2-fastfork/scripts/bench_lm.py
-
curl -L -o bench_lm.py https://huggingface.co/zotowata/bonsai2-dflash2-fastfork/resolve/main/scripts/bench_lm.py
4.23 kB
| #!/usr/bin/env python3 | |
| """localmaxxing benchmark harness for the Bonsai2-CRACK + DFlash2 deployment. | |
| Measures, per run: engine tok/s (from the server's own timings), HTTP tok/s, | |
| TTFT, prefill rate, spec-decode acceptance, plus sampled GPU power/VRAM. | |
| """ | |
| import json, subprocess, sys, threading, time, urllib.request | |
| URL = "http://127.0.0.1:8001/v1/chat/completions" | |
| POWER_FILE = "/root/pkg/results/power_samples.txt" | |
| def sample_gpu(stop, out): | |
| while not stop.is_set(): | |
| try: | |
| r = subprocess.run(["nvidia-smi", "--query-gpu=power.draw,memory.used", | |
| "--format=csv,noheader,nounits"], capture_output=True, text=True, timeout=3) | |
| out.append(r.stdout.strip()) | |
| except Exception: | |
| pass | |
| time.sleep(0.4) | |
| def run_once(body, tag): | |
| body = dict(body) | |
| body["stream"] = True | |
| data = json.dumps(body).encode() | |
| req = urllib.request.Request(URL, data=data, headers={"Content-Type": "application/json"}) | |
| samples = [] | |
| stop = threading.Event() | |
| th = threading.Thread(target=sample_gpu, args=(stop, samples), daemon=True) | |
| th.start() | |
| t0 = time.time() | |
| ttft = None | |
| n_chunks = 0 | |
| text_len = 0 | |
| timings = None | |
| finish = None | |
| usage = None | |
| t_first_char = None | |
| with urllib.request.urlopen(req, timeout=600) as resp: | |
| buf = b"" | |
| while True: | |
| b = resp.read(1) | |
| if not b: | |
| break | |
| if b == b"\n": | |
| line = buf.decode(errors="replace").strip() | |
| buf = b"" | |
| if not line.startswith("data:"): | |
| continue | |
| payload = line[5:].strip() | |
| if payload == "[DONE]": | |
| break | |
| try: | |
| j = json.loads(payload) | |
| except Exception: | |
| continue | |
| if "timings" in j: | |
| timings = j["timings"] | |
| if "usage" in j: | |
| usage = j["usage"] | |
| for ch in j.get("choices", []): | |
| d = ch.get("delta", {}) | |
| if d.get("content"): | |
| if t_first_char is None: | |
| t_first_char = time.time() | |
| text_len += len(d["content"]) | |
| n_chunks += 1 | |
| if ch.get("finish_reason"): | |
| finish = ch["finish_reason"] | |
| else: | |
| buf += b | |
| t_end = time.time() | |
| stop.set(); th.join(timeout=2) | |
| wall = t_end - t0 | |
| res = { | |
| "tag": tag, | |
| "wall_s": round(wall, 3), | |
| "ttft_ms": round((t_first_char - t0) * 1000, 1) if t_first_char else None, | |
| "engine_tok_s": timings["predicted_per_second"] if timings else None, | |
| "http_tok_s": round((usage["completion_tokens"] / wall), 2) if usage else None, | |
| "prefill_tok_s": round(timings["prompt_per_second"], 1) if timings else None, | |
| "prompt_tokens": timings["prompt_n"] if timings else (usage or {}).get("prompt_tokens"), | |
| "output_tokens": timings["predicted_n"] if timings else (usage or {}).get("completion_tokens"), | |
| "draft_n": timings.get("draft_n") if timings else None, | |
| "draft_accepted": timings.get("draft_n_accepted") if timings else None, | |
| "acceptance": round(timings["draft_n_accepted"] / timings["draft_n"], 4) if timings and timings.get("draft_n") else None, | |
| "finish": finish, | |
| "gpu_samples": samples, | |
| } | |
| return res | |
| def main(): | |
| probe_file = sys.argv[1] | |
| n_runs = int(sys.argv[2]) if len(sys.argv) > 2 else 1 | |
| with open(probe_file) as f: | |
| body = json.load(f) | |
| results = [] | |
| for i in range(n_runs): | |
| r = run_once(body, f"{probe_file.split('/')[-1]}#{i+1}") | |
| results.append(r) | |
| print(json.dumps({k: v for k, v in r.items() if k != "gpu_samples"})) | |
| time.sleep(2) | |
| import os | |
| os.makedirs("/root/pkg/results", exist_ok=True) | |
| out = f"/root/pkg/results/bench_{probe_file.split('/')[-1].replace('.json','')}.json" | |
| with open(out, "w") as f: | |
| json.dump(results, f, indent=2) | |
| print("saved:", out) | |
| if __name__ == "__main__": | |
| main() | |