Run this model with HF Jobs

Run DevGwardo/minicpm5-1b-toolcall on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/DevGwardo/minicpm5-1b-toolcall. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/DevGwardo/minicpm5-1b-toolcall on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/DevGwardo/minicpm5-1b-toolcall. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/DevGwardo/minicpm5-1b-toolcall. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

MiniCPM5-1B ToolCall LoRA

A LoRA adapter for openbmb/MiniCPM5-1B that raises exact tool-call accuracy and fixes over-calling, including multi-turn loops (call -> tool result -> follow-up).

The base model already supports XML tool calling; this adapter is not "teaching" the format. It is a measured improvement on a reproducible held-out benchmark, trained with completion-only loss.

Trained on DevGwardo/toolcall-mini (derived from ToolACE, Apache-2.0): 6,500 single-turn call examples, 1,100 abstention examples, and 590 held-out-safe multi-turn loops. LoRA r=16 on all linear layers, 2 epochs, max 1,024 tokens.

Results

Greedy decoding on a 500-example held-out split (400 calls + 100 abstention).

Metric Base + LoRA
exact_call_rate 0.240 0.718
name_accuracy 0.242 0.850
parse_rate 0.244 0.986
abstention_accuracy 0.990 0.720
false_positive_rate 0.010 0.280
  • exact_call_rate โ€” function names and every argument match
  • abstention_accuracy โ€” answers without calling a tool when none is needed
  • false_positive_rate โ€” invents a call on an abstention prompt (lower is better)

Multi-turn loops

One round trip is: user -> call -> tool result -> follow-up. Stage 1 checks the first call. Stage 2 appends the ground-truth tool result and checks whether the model answers or calls again. 100 held-out loops, greedy decoding, identical prompts for both models.

Stage Base + LoRA
Stage 1: first call exact 0.050 0.850
Stage 2: call-vs-answer decision 0.580 0.980
Stage 2: second call exact 0.023 0.558
Stage 2: non-empty answer 1.000 1.000

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B", dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(base, "DevGwardo/minicpm5-1b-toolcall")
tok = AutoTokenizer.from_pretrained("DevGwardo/minicpm5-1b-toolcall")

messages = [{"role": "user", "content": "What's the weather in Paris in celsius?"}]
tools = [{
    "name": "get_weather",
    "description": "Get current weather for a location",
    "parameters": {"type": "object", "properties": {
        "location": {"type": "string"}, "units": {"type": "string", "enum": ["celsius", "fahrenheit"]}
    }, "required": ["location"]},
}]

prompt = tok.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
new = model.generate(**inputs, max_new_tokens=192)[0][inputs["input_ids"].shape[1]:]
# <function>/<param> are special tokens: keep them in the decoded text.
print(tok.decode(new, skip_special_tokens=False).split("<|im_end|>")[0].strip())

Limitations

  • One tool round per conversation in training; longer chains are untested.
  • English/Chinese source data; argument values are normalized, not copied verbatim.
  • Greedy decoding only; no sampling/temperature sweep.

Provenance

Derived from Team-ACE/ToolACE (Apache-2.0). Test rows are held out before training; predictions.jsonl contains the raw generations used for the table above.

Downloads last month
71
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for DevGwardo/minicpm5-1b-toolcall

Adapter
(65)
this model

Dataset used to train DevGwardo/minicpm5-1b-toolcall