Instructions to use eulogik/yantra-1b-agent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use eulogik/yantra-1b-agent with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="eulogik/yantra-1b-agent", filename="base_model.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use eulogik/yantra-1b-agent 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 eulogik/yantra-1b-agent:Q4_K_M # Run inference directly in the terminal: llama cli -hf eulogik/yantra-1b-agent:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf eulogik/yantra-1b-agent:Q4_K_M # Run inference directly in the terminal: llama cli -hf eulogik/yantra-1b-agent:Q4_K_M
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 eulogik/yantra-1b-agent:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf eulogik/yantra-1b-agent:Q4_K_M
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 eulogik/yantra-1b-agent:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf eulogik/yantra-1b-agent:Q4_K_M
Use Docker
docker model run hf.co/eulogik/yantra-1b-agent:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use eulogik/yantra-1b-agent with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "eulogik/yantra-1b-agent" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eulogik/yantra-1b-agent", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/eulogik/yantra-1b-agent:Q4_K_M
- Ollama
How to use eulogik/yantra-1b-agent with Ollama:
ollama run hf.co/eulogik/yantra-1b-agent:Q4_K_M
- Unsloth Desktop
- Pi
How to use eulogik/yantra-1b-agent with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eulogik/yantra-1b-agent:Q4_K_M
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": "eulogik/yantra-1b-agent:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use eulogik/yantra-1b-agent with Docker Model Runner:
docker model run hf.co/eulogik/yantra-1b-agent:Q4_K_M
- Lemonade
How to use eulogik/yantra-1b-agent with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull eulogik/yantra-1b-agent:Q4_K_M
Run and chat with the model
lemonade run user.yantra-1b-agent-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use eulogik/yantra-1b-agent with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eulogik/yantra-1b-agent:Q4_K_M
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 eulogik/yantra-1b-agent:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use eulogik/yantra-1b-agent with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eulogik/yantra-1b-agent:Q4_K_M
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 "eulogik/yantra-1b-agent:Q4_K_M" \ --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"
Yantra 1B Agent — Sub-1B Tool-Calling Model (GGUF, QLoRA, DTSA)
TL;DR: Yantra is a 1B-parameter function-calling model that turns a user query plus a tool list into a strict tool call. A lightweight runtime router picks the tool (82.3% accuracy); the fine-tuned MiniCPM5-1B model generates only the arguments. PAS 0.6775 on ToolACE-300 — 3.52× our identically-served baseline (0.1922). Ships as a 688 MB Q4_K_M GGUF, MIT licensed, reproducible on a free Colab T4.
- 🏠 Code + training pipeline: https://github.com/eulogik/yantra
- ⚖️ License: MIT (check the base model
openbmb/MiniCPM5-1Bterms for its license) - 🧪 Eval: ToolACE-300, deterministic seed 42, single-call cases
Results
| Metric | Baseline (llama.cpp) | Yantra |
|---|---|---|
| Parseable | 0.0000 | 1.0000 |
| Valid tool name | 0.0000 | 1.0000 |
| Expected tool (with router) | 0.5567 | 0.8233 |
| Exact args (keys + values) | 0.0000 | 0.6500 |
| Arg key overlap | 0.0000 | 0.9467 |
| Stopped cleanly | 0.0000 | 1.0000 |
| PAS (primary) | 0.1922 | 0.6775 (3.52×) |
PAS = mean of 8 sub-metrics (parseable, valid_name, expected_name, exact_args, arg_key_overlap, stopped_cleanly, recovery=0, multiturn=0).
Baseline note: 0.1922 is measured with the reference MiniCPM5 agentic model served through llama.cpp on identical prompts. That model targets SGLang's native stack, so llama.cpp understates its card numbers. The honest claim is system-vs-system under identical serving.
Routing accuracy
| Router | Accuracy |
|---|---|
| Lexical (IDF + char-3gram) | 244/300 (81.3%) |
| Pure embedding (MiniLM-L6-v2) | 242/300 (80.7%) |
| Blend β=0.5 (shipped) | 247/300 (82.3%) |
Quickstart (llama-cpp-python)
from llama_cpp import Llama
llm = Llama(model_path="base_model.Q4_K_M.gguf", n_ctx=4096, n_gpu_layers=-1)
prompt = """<user>Find me a VR game for Oculus Quest</user>
<tools>[{"name": "getVRGame", "description": "Search VR games", "parameters": {"properties": {"platform": {"type": "string"}, "genre": {"type": "string"}}}}]</tools>
<calls><bind tool="getVRGame"/>
"""
out = llm(prompt, max_tokens=512, stop=["\n<bind", "<tool_result>", "<user>", "</calls>"])
print(out["choices"][0]["text"])
# <args><param name="platform">Oculus Quest</param>...</args><action_end/>
Prefer routing in code? Use the shipped Router V2 from the GitHub repo (runtime/router.py):
from runtime.router import ToolRouter
router = ToolRouter() # lexical-only, zero extra installs
router.fit_corpus(all_tools)
tool = router.route("Find me a VR game for Oculus Quest", tools)[0]
How it works (DTSA)
DTSA = Decoupled Tool Selection / Argument Generation. The runtime router binds <bind tool="…"/>; the model emits only <args>…</args><action_end/>. Fixed stop sequences (\n<bind, <tool_result>, <user>, </calls>) guarantee clean termination. Routing (82.3%) is independent of the model — swap routers without retraining.
Training
Base: openbmb/MiniCPM5-1B · QLoRA (r=64, α=128, dropout=0.05) · Colab T4 · zero paid API calls.
| Stage | Method | Data | Epochs | LR |
|---|---|---|---|---|
| 1+3 | DTSA SFT | 1988 ToolACE pairs | 2 | 1e-4 |
| 4 | EG-OPD DPO | 7795 pairs | 1 | 5e-5 |
| 5 | RTE SFT | error corrections | 1 | 1e-4 |
| 8 | SFT replay | 66 fixes + 200 replay | 1 | 1e-5 |
| 6 | Export | Q4_K_M GGUF, 688 MB | — | — |
A DPO round on 66 pairs collapsed (exact_args 0.65→0.14) and was abandoned; SFT replay on the same fixes recovered safely. The failed run is documented in the GitHub repo for transparency.
Evaluation protocol
- 300 ToolACE cases, seed 42, single-call only.
- Prompt =
<user>query</user><tools>…</tools><calls><bind tool="ROUTED"/>; model completes args-only. - Decoding: temperature 0.0, max_tokens 768, fixed stops; last-bind-with-args parser with tagless-
<param>fallback. - Reproduce:
Yantra_EmbRouter_Eval.ipynbin the GitHub repo (~10 min, no training).
Intended use
Research and prototyping for lightweight on-device / edge function-calling agents. Single-call English tool use with schema validation in front.
Limitations
- 65% exact-args: validate every call against the tool schema before executing.
- 82% routing ceiling; wrong-bind calls cannot self-correct (no multi-turn recovery yet).
- English only, 4096 context, no safety alignment beyond the base model.
- Not for high-stakes actions (payments, medical, infrastructure) without human review.
FAQ
What is Yantra?
A 1B tool-calling model + router that converts (query, tools) into a strict <bind>/<args>/<action_end/> call. PAS 0.6775 on ToolACE-300.
Which file do I download?
base_model.Q4_K_M.gguf (688 MB). Load with llama.cpp / llama-cpp-python / Ollama (GGUF import).
What prompt format does it expect?
<user>{query}</user>\n<tools>{json}</tools>\n<calls><bind tool="{routed}"/> then let it complete the <args> block. Use the listed stop sequences.
Can I use it commercially?
The Yantra weights and code are MIT. Verify the base model license (openbmb/MiniCPM5-1B) for its terms.
How is this different from the baseline MiniCPM5 agentic model? DTSA decoupling (router + args-only model + fixed stops) makes output 100% parseable under llama.cpp serving, where the baseline echoes schemas. Measured 3.52× PAS under identical serving.
Citation
@software{yantra2026,
author = {Eulogik},
title = {Yantra: A Sub-1B Agentic Tool-Calling Model},
year = {2026},
url = {https://github.com/eulogik/yantra},
license = {MIT}
}
Acknowledgments
Base model: OpenBMB MiniCPM5-1B · Data/eval: Team ACE ToolACE · Training: Unsloth QLoRA · Inference: llama.cpp · Embeddings: sentence-transformers.
- Downloads last month
- 196
4-bit
Model tree for eulogik/yantra-1b-agent
Base model
openbmb/MiniCPM5-1BDataset used to train eulogik/yantra-1b-agent
Evaluation results
- PAS on ToolACE-300self-reported0.677
- exact_args on ToolACE-300self-reported0.650
- routing_accuracy on ToolACE-300self-reported0.823


