Instructions to use badtheorylabs/BTL-4-Compact 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 badtheorylabs/BTL-4-Compact 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 badtheorylabs/BTL-4-Compact:IQ2_XXS # Run inference directly in the terminal: llama cli -hf badtheorylabs/BTL-4-Compact:IQ2_XXS
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf badtheorylabs/BTL-4-Compact:IQ2_XXS # Run inference directly in the terminal: llama cli -hf badtheorylabs/BTL-4-Compact:IQ2_XXS
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 badtheorylabs/BTL-4-Compact:IQ2_XXS # Run inference directly in the terminal: ./llama-cli -hf badtheorylabs/BTL-4-Compact:IQ2_XXS
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 badtheorylabs/BTL-4-Compact:IQ2_XXS # Run inference directly in the terminal: ./build/bin/llama-cli -hf badtheorylabs/BTL-4-Compact:IQ2_XXS
Use Docker
docker model run hf.co/badtheorylabs/BTL-4-Compact:IQ2_XXS
- LM Studio
- Jan
- vLLM
How to use badtheorylabs/BTL-4-Compact with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "badtheorylabs/BTL-4-Compact" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "badtheorylabs/BTL-4-Compact", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/badtheorylabs/BTL-4-Compact:IQ2_XXS
- Ollama
How to use badtheorylabs/BTL-4-Compact with Ollama:
ollama run hf.co/badtheorylabs/BTL-4-Compact:IQ2_XXS
- Unsloth Studio
How to use badtheorylabs/BTL-4-Compact 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 badtheorylabs/BTL-4-Compact 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 badtheorylabs/BTL-4-Compact to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for badtheorylabs/BTL-4-Compact to start chatting
- Pi
How to use badtheorylabs/BTL-4-Compact with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf badtheorylabs/BTL-4-Compact:IQ2_XXS
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": "badtheorylabs/BTL-4-Compact:IQ2_XXS" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use badtheorylabs/BTL-4-Compact with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf badtheorylabs/BTL-4-Compact:IQ2_XXS
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 "badtheorylabs/BTL-4-Compact:IQ2_XXS" \ --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 badtheorylabs/BTL-4-Compact with Docker Model Runner:
docker model run hf.co/badtheorylabs/BTL-4-Compact:IQ2_XXS
- Lemonade
How to use badtheorylabs/BTL-4-Compact with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull badtheorylabs/BTL-4-Compact:IQ2_XXS
Run and chat with the model
lemonade run user.BTL-4-Compact-IQ2_XXS
List all available models
lemonade list
- Hermes Agent
How to use badtheorylabs/BTL-4-Compact with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf badtheorylabs/BTL-4-Compact:IQ2_XXS
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 badtheorylabs/BTL-4-Compact:IQ2_XXS
Run Hermes
hermes
- Atomic Chat
File size: 5,197 Bytes
2a29bc8 | 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 | #!/usr/bin/env python3
"""Eyeball BTL-4 Compact's tool use before running the full BFCL gate.
Ten prompts covering the five behaviours BTL-3 Compact was scored on: a single
call, picking the right tool from several, two calls in parallel, two *different*
tools in parallel, and knowing when to make no call at all. Parallel-multiple is
the one to watch -- it was BTL-3 Compact's weakest category at 3/10.
Shares the system prompt and parser with bfcl_compact.py so what you see here is
what the benchmark will score.
python probe_tools.py # all ten
python probe_tools.py --ask "your question here"
"""
from __future__ import annotations
import argparse
import json
from bfcl_compact import REPO, FILENAME, SYS, parse_tool_calls
TOOLS = [
{"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {"type": "object", "properties": {
"city": {"type": "string", "description": "City name"},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}},
"required": ["city"]}},
{"name": "convert_currency",
"description": "Convert an amount between two currencies.",
"parameters": {"type": "object", "properties": {
"amount": {"type": "number"},
"from_currency": {"type": "string", "description": "ISO code, e.g. USD"},
"to_currency": {"type": "string", "description": "ISO code, e.g. EUR"}},
"required": ["amount", "from_currency", "to_currency"]}},
{"name": "search_flights",
"description": "Search available flights between two airports on a date.",
"parameters": {"type": "object", "properties": {
"origin": {"type": "string"}, "destination": {"type": "string"},
"date": {"type": "string", "description": "YYYY-MM-DD"}},
"required": ["origin", "destination", "date"]}},
{"name": "send_email",
"description": "Send an email.",
"parameters": {"type": "object", "properties": {
"to": {"type": "string"}, "subject": {"type": "string"},
"body": {"type": "string"}},
"required": ["to", "subject", "body"]}},
{"name": "stock_price",
"description": "Get the latest share price for a ticker symbol.",
"parameters": {"type": "object", "properties": {
"ticker": {"type": "string"}},
"required": ["ticker"]}},
]
# (prompt, what a correct model should do) -- the expectation is for your eyes,
# nothing here is auto-scored.
PROBES = [
("What's the weather in Lagos?",
"single: get_weather(city='Lagos')"),
("How much is 250 US dollars in Japanese yen?",
"single, right tool from five: convert_currency"),
("What's the weather in Lagos and in Tokyo?",
"parallel: get_weather twice"),
("Give me the weather in Berlin and the share price of NVDA.",
"parallel-multiple: two DIFFERENT tools"),
("Convert 100 GBP to EUR and 100 GBP to USD, and tell me Tesla's stock price.",
"parallel-multiple: three calls, two tools"),
("Find me flights from LHR to CDG on 2026-09-14.",
"single with a date argument"),
("Write me a haiku about the rain.",
"ABSTAIN: no tool applies"),
("What do you think is the best programming language?",
"ABSTAIN: opinion, no tool"),
("Email ada@example.com with the subject 'Q3 numbers' saying the figures are approved.",
"single with three string args"),
("What's the weather in Paris, and email it to sam@example.com with subject 'Paris'?",
"parallel-multiple: get_weather + send_email"),
]
def run(llm, question: str, expect: str | None = None) -> None:
msgs = [{"role": "system", "content": SYS + json.dumps(TOOLS)},
{"role": "user", "content": question}]
out = llm.create_chat_completion(messages=msgs, max_tokens=512, temperature=0.0)
raw = out["choices"][0]["message"].get("content") or ""
calls = parse_tool_calls(raw)
print(f"\n\033[1m❯ {question}\033[0m")
if expect:
print(f" \033[2mexpect: {expect}\033[0m")
if calls:
for c in calls:
args = ", ".join(f"{k}={v!r}" for k, v in c["arguments"].items())
print(f" \033[32m→ {c['name']}({args})\033[0m")
else:
body = " ".join(raw.split())[:200]
print(f" \033[33m→ no tool call\033[0m {body}")
def main() -> None:
ap = argparse.ArgumentParser()
ap.add_argument("--ask", help="run a single custom question")
ap.add_argument("--model", default=None, help="local .gguf path")
ap.add_argument("--ctx", type=int, default=8192)
args = ap.parse_args()
from llama_cpp import Llama
path = args.model
if path is None:
from huggingface_hub import hf_hub_download
path = hf_hub_download(repo_id=REPO, filename=FILENAME)
print("loading onto the GPU ...", flush=True)
llm = Llama(model_path=path, n_gpu_layers=-1, n_ctx=args.ctx, verbose=False)
if args.ask:
run(llm, args.ask)
return
for q, expect in PROBES:
run(llm, q, expect)
print("\n\033[2mparallel-multiple is the one that matters: BTL-3 Compact "
"scored 3/10 there.\033[0m")
if __name__ == "__main__":
main()
|