Instructions to use aravindpersona/restraint-7b 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 aravindpersona/restraint-7b 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 aravindpersona/restraint-7b # Run inference directly in the terminal: llama cli -hf aravindpersona/restraint-7b
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf aravindpersona/restraint-7b # Run inference directly in the terminal: llama cli -hf aravindpersona/restraint-7b
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 aravindpersona/restraint-7b # Run inference directly in the terminal: ./llama-cli -hf aravindpersona/restraint-7b
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 aravindpersona/restraint-7b # Run inference directly in the terminal: ./build/bin/llama-cli -hf aravindpersona/restraint-7b
Use Docker
docker model run hf.co/aravindpersona/restraint-7b
- LM Studio
- Jan
- vLLM
How to use aravindpersona/restraint-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aravindpersona/restraint-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aravindpersona/restraint-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aravindpersona/restraint-7b
- Ollama
How to use aravindpersona/restraint-7b with Ollama:
ollama run hf.co/aravindpersona/restraint-7b
- Unsloth Desktop
- Pi
How to use aravindpersona/restraint-7b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf aravindpersona/restraint-7b
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": "aravindpersona/restraint-7b" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use aravindpersona/restraint-7b with Docker Model Runner:
docker model run hf.co/aravindpersona/restraint-7b
- Lemonade
How to use aravindpersona/restraint-7b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull aravindpersona/restraint-7b
Run and chat with the model
lemonade run user.restraint-7b-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use aravindpersona/restraint-7b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf aravindpersona/restraint-7b
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 aravindpersona/restraint-7b
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use aravindpersona/restraint-7b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf aravindpersona/restraint-7b
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 "aravindpersona/restraint-7b" \ --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"
Restraint-7B
A 7B tool-use model post-trained to answer knowledge questions without calling tools — and to call them precisely when they're needed.
SFT on 450 expert ReAct traces, then a corrective SFT pass that fixed a data bug which had collapsed the model's restraint behavior (all 150 original restraint demos shared one canned <think> line and omitted the system prompt, so the model never learned a real decision boundary).
The problem it fixes
Tool-capable models over-tool. After format SFT, the model calls tools on questions it already knows — wasted latency, wasted tokens, unnecessary failure surface. Restraint-7B is trained to hold back: "What is 6 squared?" gets a direct answer, not a calculator call.
Results
50-task stratified eval (same task IDs for both models, temperature 0, real deterministic tool executor, canonical is_correct scoring — no LLM judge):
| Metric | SFT baseline | Restraint-7B v2 |
|---|---|---|
| Task accuracy | 78% (39/50) | 92% (46/50) |
| Restraint rate (no-tool tasks, 0 calls) | 0% (0/17) | 94.1% (16/17) |
| Total tool calls | 114 | 49 (−57%) |
| Tier 1 single-tool | 22/22 | 22/22 |
| Tier 3 multi-step | 7/9 | 9/9 |
| Tier 4 error recovery (held-out) | 1/2 | 1/2 |
Paired result: restraint 0% → 94% while accuracy rose 78% → 92% — fewer unnecessary calls means fewer failure surfaces, not a capability trade-off.
Failure audit (v2): of the 4 misses, 3 are scorer strictness on definitional restraint answers (semantically correct, wording differs from the reference string); 1 is a genuine held-out error-recovery failure.
Eval harness, task suite, ground-truth repair diff, and raw traces: github.com/harneet2512/Codetune. Traces are regenerated per release; scoring is deterministic.
Usage
Raw-completion format — the model was trained on this prompt shape, not chat markup:
from llama_cpp import Llama # or transformers / vLLM on the merged weights
prompt = """You are a helpful assistant with access to the following tools:
[{ "name": "calculator", ... }]
To use a tool, write a <tool_call> block with JSON. You will receive the result in an <observation> block.
Think step by step inside <think></think> tags. When you have enough information, give your final answer inside <answer></answer> tags.
If a tool returns an error, try a different approach.
User: What is 37 multiplied by 576?
"""
Output contract: <think>…</think> → optional <tool_call>{"name":…,"arguments":{…}}</tool_call> → <observation> is supplied by your harness → final <answer>…</answer>.
Important: when serving via llama.cpp /completion, add </tool_call> (and <observation>) to the stop list — otherwise the model continues past its own tool call and fabricates an observation instead of waiting for the real one. (We learned this the hard way; it silently corrupted an entire eval run.)
GGUF
restraint-7b-v2-q4km.gguf (4.5GB) runs in llama.cpp / Ollama / LM Studio. Verified on a 6GB RTX 2060 at ~39 tok/s.
Training details
- Base: Qwen/Qwen2.5-7B-Instruct
- Stage 1: QLoRA SFT, r=16 α=32, 450 traces (200 single-tool / 150 restraint / 100 multi-step)
- Stage 2 (v2): corrective QLoRA SFT on the merged stage-1 weights — 350 examples (150 restraint with varied reasoning text + full tool-definition system prompt, 200 tool/multi-step), 2 epochs, lr 1e-4, ~13 min on L4
- Post-train sanity check: asserts LoRA B-matrix magnitude is non-trivial (catches the silent no-op-adapter failure our first GRPO run produced)
- Training + eval code:
train/,tooltune/,scripts/in the repo
Limitations
- The 5 tools are a deterministic simulated set (calculator, wikipedia, weather, code_executor, unit_converter) — the suite measures tool selection, format, and faithfulness to tool output, not real API integration. Generalization to live API ecosystems is unverified.
- 50-task eval sample: wide confidence intervals (±~14pp at 95% CI). Tier 4 held-out n=2 is anecdotal.
- Tier 1–3 tasks are in-distribution relative to training; only tier 4 is a true held-out split.
- Downloads last month
- 656