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-1B terms for its license)
  • 🧪 Eval: ToolACE-300, deterministic seed 42, single-call cases

Results

Yantra vs baseline on ToolACE-300

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 comparison

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)

Architecture

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.ipynb in 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
GGUF
Model size
1B params
Architecture
llama
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for eulogik/yantra-1b-agent

Quantized
(99)
this model

Dataset used to train eulogik/yantra-1b-agent

Evaluation results