Text Generation
PEFT
Safetensors
English
minicpm
minicpm5
minicpm5-1b
tool-calling
function-calling
tool-use
agentic
agentic-ai
ai-agent
xml-tool-calling
json-function-calling
lora
qlora
grpo
reinforcement-learning
rlhf
unsloth
trl
openbmb
conversational
small-language-model
slm
edge-ai
on-device
local-llm
efficient-llm
Eval Results (legacy)
Instructions to use ewin-reg/MiniCPM5-1B-Agentic-Tooluse-QLoRA-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ewin-reg/MiniCPM5-1B-Agentic-Tooluse-QLoRA-v3 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B") model = PeftModel.from_pretrained(base_model, "ewin-reg/MiniCPM5-1B-Agentic-Tooluse-QLoRA-v3") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
yyy commited on
Add model-index eval YAML, arch spec, thinking docs, limitations, citation, ModelScope; remove column meanings note
Browse files
README.md
CHANGED
|
@@ -1,75 +1,76 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
license: apache-2.0
|
| 4 |
-
|
| 5 |
base_model: openbmb/MiniCPM5-1B
|
| 6 |
-
|
| 7 |
library_name: peft
|
| 8 |
-
|
| 9 |
tags:
|
| 10 |
-
|
| 11 |
- minicpm
|
| 12 |
-
|
| 13 |
- minicpm5
|
| 14 |
-
|
| 15 |
- minicpm5-1b
|
| 16 |
-
|
| 17 |
- tool-calling
|
| 18 |
-
|
| 19 |
- function-calling
|
| 20 |
-
|
| 21 |
- tool-use
|
| 22 |
-
|
| 23 |
- agentic
|
| 24 |
-
|
| 25 |
- agentic-ai
|
| 26 |
-
|
| 27 |
- ai-agent
|
| 28 |
-
|
| 29 |
- xml-tool-calling
|
| 30 |
-
|
| 31 |
- json-function-calling
|
| 32 |
-
|
| 33 |
- lora
|
| 34 |
-
|
| 35 |
- qlora
|
| 36 |
-
|
| 37 |
- peft
|
| 38 |
-
|
| 39 |
- grpo
|
| 40 |
-
|
| 41 |
- reinforcement-learning
|
| 42 |
-
|
| 43 |
- rlhf
|
| 44 |
-
|
| 45 |
- unsloth
|
| 46 |
-
|
| 47 |
- trl
|
| 48 |
-
|
| 49 |
- openbmb
|
| 50 |
-
|
| 51 |
- text-generation
|
| 52 |
-
|
| 53 |
- conversational
|
| 54 |
-
|
| 55 |
- small-language-model
|
| 56 |
-
|
| 57 |
- slm
|
| 58 |
-
|
| 59 |
- edge-ai
|
| 60 |
-
|
| 61 |
- on-device
|
| 62 |
-
|
| 63 |
- local-llm
|
| 64 |
-
|
| 65 |
- efficient-llm
|
| 66 |
-
|
| 67 |
language:
|
| 68 |
-
|
| 69 |
- en
|
| 70 |
-
|
| 71 |
pipeline_tag: text-generation
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
---
|
| 74 |
|
| 75 |
# MiniCPM5-1B-Agentic-Tooluse-QLoRA-v3 — Small Function-Calling LoRA Adapter (GRPO + QLoRA)
|
|
@@ -114,15 +115,6 @@ negative result below is measured against it.
|
|
| 114 |
| `arg_key_overlap` — F1 over argument keys | 0.8757 | 0.9422 | **0.9388** |
|
| 115 |
| **mean of 5** | 0.8718 | 0.9245 | **0.9251** |
|
| 116 |
|
| 117 |
-
Column meanings, to avoid the ambiguity the word "baseline" invites:
|
| 118 |
-
**v2 (previous release)** = the previously published SFT adapter. An earlier draft of this card
|
| 119 |
-
mislabeled this column "base model (untrained)" -- that was wrong; it is NOT the raw base model.
|
| 120 |
-
The real untrained `openbmb/MiniCPM5-1B`, measured on this same test slice, scores `parseable`
|
| 121 |
-
0.9333, `valid_name` 0.9133, `expected_name` 0.8867, `args_exact` 0.6300, `arg_key_overlap` 0.8920.
|
| 122 |
-
**SFT retrain** = a fresh SFT pass from v2, prior to GRPO. **v3** = what this repo currently serves.
|
| 123 |
-
Every "did it improve?" decision in this card is judged against **v2**, not against the untrained
|
| 124 |
-
base model — beating an untrained model is not evidence of anything.
|
| 125 |
-
|
| 126 |
GRPO buys +0.0100 on `args_exact`, the metric that matters here, and gives back 0.0034 (one test example
|
| 127 |
each) on `expected_name` and `arg_key_overlap`. That trade is reported rather than hidden: the mean moves
|
| 128 |
only +0.0006, so this is a targeted gain on the hardest metric, not a broad improvement.
|
|
@@ -204,6 +196,73 @@ Prefer not to deal with adapter loading, or want a single-file local build? See
|
|
| 204 |
|
| 205 |
- Research and experimentation on small-model reasoning, LoRA fine-tuning, and RL-based (GRPO) post-training for structured generation
|
| 206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
## Related repos
|
| 208 |
|
| 209 |
### v3 model family (this release)
|
|
@@ -235,3 +294,4 @@ Prefer not to deal with adapter loading, or want a single-file local build? See
|
|
| 235 |
|
| 236 |
Built on [MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B) by OpenBMB.
|
| 237 |
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
| 3 |
base_model: openbmb/MiniCPM5-1B
|
|
|
|
| 4 |
library_name: peft
|
|
|
|
| 5 |
tags:
|
|
|
|
| 6 |
- minicpm
|
|
|
|
| 7 |
- minicpm5
|
|
|
|
| 8 |
- minicpm5-1b
|
|
|
|
| 9 |
- tool-calling
|
|
|
|
| 10 |
- function-calling
|
|
|
|
| 11 |
- tool-use
|
|
|
|
| 12 |
- agentic
|
|
|
|
| 13 |
- agentic-ai
|
|
|
|
| 14 |
- ai-agent
|
|
|
|
| 15 |
- xml-tool-calling
|
|
|
|
| 16 |
- json-function-calling
|
|
|
|
| 17 |
- lora
|
|
|
|
| 18 |
- qlora
|
|
|
|
| 19 |
- peft
|
|
|
|
| 20 |
- grpo
|
|
|
|
| 21 |
- reinforcement-learning
|
|
|
|
| 22 |
- rlhf
|
|
|
|
| 23 |
- unsloth
|
|
|
|
| 24 |
- trl
|
|
|
|
| 25 |
- openbmb
|
|
|
|
| 26 |
- text-generation
|
|
|
|
| 27 |
- conversational
|
|
|
|
| 28 |
- small-language-model
|
|
|
|
| 29 |
- slm
|
|
|
|
| 30 |
- edge-ai
|
|
|
|
| 31 |
- on-device
|
|
|
|
| 32 |
- local-llm
|
|
|
|
| 33 |
- efficient-llm
|
|
|
|
| 34 |
language:
|
|
|
|
| 35 |
- en
|
|
|
|
| 36 |
pipeline_tag: text-generation
|
| 37 |
+
datasets:
|
| 38 |
+
- Team-ACE/ToolACE
|
| 39 |
+
inference: false
|
| 40 |
+
model-index:
|
| 41 |
+
- name: MiniCPM5-1B-Agentic-Tooluse-v3
|
| 42 |
+
results:
|
| 43 |
+
- task:
|
| 44 |
+
type: text-generation
|
| 45 |
+
name: Tool calling
|
| 46 |
+
dataset:
|
| 47 |
+
name: External ToolACE-derived first-call evaluation (held-out 300 examples)
|
| 48 |
+
type: Team-ACE/ToolACE
|
| 49 |
+
metrics:
|
| 50 |
+
- type: parseable_rate
|
| 51 |
+
value: 1.0000
|
| 52 |
+
name: Parseable tool-call rate
|
| 53 |
+
- type: valid_name_rate
|
| 54 |
+
value: 0.9867
|
| 55 |
+
name: Valid available-tool name rate
|
| 56 |
+
- type: expected_name_rate
|
| 57 |
+
value: 0.9533
|
| 58 |
+
name: Expected tool-name rate
|
| 59 |
+
- type: args_exact_rate
|
| 60 |
+
value: 0.7467
|
| 61 |
+
name: Exact-arguments rate
|
| 62 |
+
- type: arg_key_overlap
|
| 63 |
+
value: 0.9388
|
| 64 |
+
name: Argument-key overlap
|
| 65 |
+
- type: no_schema_copy_rate
|
| 66 |
+
value: 0.9967
|
| 67 |
+
name: No-schema-copy rate
|
| 68 |
+
- type: no_repetition_rate
|
| 69 |
+
value: 0.3400
|
| 70 |
+
name: No-repetition rate
|
| 71 |
+
- type: stopped_cleanly_rate
|
| 72 |
+
value: 0.0000
|
| 73 |
+
name: Stopped-cleanly rate
|
| 74 |
---
|
| 75 |
|
| 76 |
# MiniCPM5-1B-Agentic-Tooluse-QLoRA-v3 — Small Function-Calling LoRA Adapter (GRPO + QLoRA)
|
|
|
|
| 115 |
| `arg_key_overlap` — F1 over argument keys | 0.8757 | 0.9422 | **0.9388** |
|
| 116 |
| **mean of 5** | 0.8718 | 0.9245 | **0.9251** |
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
GRPO buys +0.0100 on `args_exact`, the metric that matters here, and gives back 0.0034 (one test example
|
| 119 |
each) on `expected_name` and `arg_key_overlap`. That trade is reported rather than hidden: the mean moves
|
| 120 |
only +0.0006, so this is a targeted gain on the hardest metric, not a broad improvement.
|
|
|
|
| 196 |
|
| 197 |
- Research and experimentation on small-model reasoning, LoRA fine-tuning, and RL-based (GRPO) post-training for structured generation
|
| 198 |
|
| 199 |
+
## Base model architecture
|
| 200 |
+
|
| 201 |
+
MiniCPM5-1B uses a standard `LlamaForCausalLM` architecture:
|
| 202 |
+
|
| 203 |
+
| Property | Value |
|
| 204 |
+
|---|---|
|
| 205 |
+
| Parameters (total) | 1,080,632,832 |
|
| 206 |
+
| Parameters (non-embedding) | 679,552,512 |
|
| 207 |
+
| Architecture | `LlamaForCausalLM` |
|
| 208 |
+
| Layers | 24 |
|
| 209 |
+
| Attention heads (GQA) | 16 Q / 2 KV |
|
| 210 |
+
| Context length | 131,072 tokens |
|
| 211 |
+
| Training | SFT → RL (GRPO) fine-tune on [openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B) |
|
| 212 |
+
|
| 213 |
+
## Thinking mode
|
| 214 |
+
|
| 215 |
+
MiniCPM5-1B has a built-in `<think>...</think>` chat template. The same checkpoint can act as a fast assistant **or** a deliberate chain-of-thought reasoner — controlled by a single flag:
|
| 216 |
+
|
| 217 |
+
```python
|
| 218 |
+
# Fast mode — recommended for tool calling (thinking OFF)
|
| 219 |
+
prompt = tokenizer.apply_chat_template(
|
| 220 |
+
messages, tools=tools, add_generation_prompt=True,
|
| 221 |
+
enable_thinking=False,
|
| 222 |
+
tokenize=False,
|
| 223 |
+
)
|
| 224 |
+
|
| 225 |
+
# Reasoning mode (thinking ON — NOT recommended for tool calling)
|
| 226 |
+
prompt = tokenizer.apply_chat_template(
|
| 227 |
+
messages, tools=tools, add_generation_prompt=True,
|
| 228 |
+
enable_thinking=True,
|
| 229 |
+
tokenize=False,
|
| 230 |
+
)
|
| 231 |
+
```
|
| 232 |
+
|
| 233 |
+
> **Important:** always use `enable_thinking=False` for tool/function calling. With thinking ON the model spends its token budget inside `<think>...</think>` and may not reach a completed function call. All benchmark numbers in this card use thinking OFF.
|
| 234 |
+
|
| 235 |
+
## Citation
|
| 236 |
+
|
| 237 |
+
If you use this model, please cite the base model paper:
|
| 238 |
+
|
| 239 |
+
```bibtex
|
| 240 |
+
@article{minicpm4,
|
| 241 |
+
title = {MiniCPM4: Ultra-Efficient LLMs on End Devices},
|
| 242 |
+
author = {MiniCPM Team},
|
| 243 |
+
journal = {arXiv preprint arXiv:2506.07900},
|
| 244 |
+
year = {2025}
|
| 245 |
+
}
|
| 246 |
+
```
|
| 247 |
+
|
| 248 |
+
And the ToolACE dataset used for fine-tuning:
|
| 249 |
+
|
| 250 |
+
```bibtex
|
| 251 |
+
@article{toolace,
|
| 252 |
+
title = {ToolACE: Winning the Points of LLM Function Calling},
|
| 253 |
+
author = {Liu, Ying and others},
|
| 254 |
+
journal = {arXiv preprint arXiv:2409.00920},
|
| 255 |
+
year = {2024}
|
| 256 |
+
}
|
| 257 |
+
```
|
| 258 |
+
|
| 259 |
+
## ModelScope
|
| 260 |
+
|
| 261 |
+
The base model is also available on ModelScope (for users in China and East Asia):
|
| 262 |
+
|
| 263 |
+
- [OpenBMB/MiniCPM5-1B on ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-1B)
|
| 264 |
+
|
| 265 |
+
*(The fine-tuned adapter/GGUF builds are currently HuggingFace-only.)*
|
| 266 |
## Related repos
|
| 267 |
|
| 268 |
### v3 model family (this release)
|
|
|
|
| 294 |
|
| 295 |
Built on [MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B) by OpenBMB.
|
| 296 |
|
| 297 |
+
## Limitations
|