MiniCPM is a family of compact language models, including MiniCPM5-1B, designed to run locally on devices with limited resources. Developers use it for on-device assistants, reasoning, code, tool use, deployment, and fine-tuning, while the repository also includes a desktop-pet example. The catalogue entries support deployment and fine-tuning workflows for the models.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add OpenBMB/MiniCPM --skill minicpm5-deploy-transformersgit clone --depth 1 https://github.com/OpenBMB/MiniCPMWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/openbmb/minicpm/minicpm5-deploy-transformers)<a href="https://agentmods.dev/skills/openbmb/minicpm/minicpm5-deploy-transformers"><img src="https://agentmods.dev/badge/skills/openbmb/minicpm/minicpm5-deploy-transformers.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00090 | $0.00939 |
| Opus 5 | $0.00045 | $0.00469 |
| Sonnet 5 | $0.00018 | $0.00188 |
| Haiku 4.5 | $0.00009 | $0.00094 |
Grade A, and why
minicpm5-deploy-transformers scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Deploy MiniCPM5-1B and MiniCPM5-2B with HF Transformers
One-shot Python generation. No server. Works on a single GPU (bfloat16) or CPU only (fp32).
Required input
| Var | Example | Default |
|---|---|---|
MODEL_PATH |
openbmb/MiniCPM5-2B or local dir |
required; openbmb/MiniCPM5-1B also works |
MODE |
think or nothink (nothink is 1B-only) |
think |
Steps
1. Install (once)
pip install -U "transformers>=5.6,<6" "torch>=2.11" accelerate # latest (CUDA 13.x driver hosts)
# pip install -U "transformers==4.57.3" "torch==2.7.1" accelerate # fallback for CUDA 12.x driver hosts
2. Run
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "${MODEL_PATH}" # ← replace
tok = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.bfloat16, # CPU users: torch.float32 + device_map="cpu"
device_map="auto",
).eval()
messages = [{"role": "user", "content": "用一句话解释什么是 GQA。"}]
inputs = tok.apply_chat_template(
messages,
add_generation_prompt=True,
enable_thinking=True,
return_tensors="pt",
return_dict=True,
).to(model.device)
with torch.no_grad():
out = model.generate(
**inputs,
max_new_tokens=1024,
do_sample=True,
temperature=1.0,
top_p=0.95,
)
prompt_len = inputs["input_ids"].shape[-1]
print(tok.decode(out[0][prompt_len:], skip_special_tokens=True))
For CPU only: change torch_dtype=torch.float32, device_map="cpu". Keep enable_thinking=True and temperature=1.0 for MiniCPM5-2B; use enable_thinking=False and temperature=0.7 only for MiniCPM5-1B No-think mode.
Sampling defaults
| Mode | enable_thinking |
temperature |
top_p |
|---|---|---|---|
| MiniCPM5-2B Think | True |
1.0 | 0.95 |
| MiniCPM5-1B Think | True |
0.9 | 0.95 |
| MiniCPM5-1B No-think | False |
0.7 | 0.95 |
Validate
A coherent answer to 1+1=? (e.g. "2" or "答案是 2").
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today Changed · +4 lines · +8 tokens per session 4e6e21fad965
- 8d ago First seen · 91 lines · 82 tokens per session scan A e42ebb2045bc
minicpm5-deploy-transformers is a skill published in the GitHub repository OpenBMB/MiniCPM (10,478 stars, last pushed today), licensed Apache-2.0. It adds 90 tokens to every session and 939 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
accelerate
Run PyTorch training across GPUs with minimal changes.
developing-genkit-python
Develop AI-powered applications using Genkit in Python. Use when the user asks about Genkit, AI agents, flows, or tools in Python, or when encountering Genkit errors, import issues, or API problems.
optimize-for-gpu
GPU-accelerates scientific Python on NVIDIA hardware and verifies that the result is correct and faster. Use for CUDA/GPU optimization; CPU-bound NumPy, SciPy, pandas, scikit-learn, NetworkX, scikit-image, vector-search, image-processing, graph, simulation, or file-I/O workloads; CuPy, cuDF, cuML, cuGraph, cuVS…
marimo-pair
Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.
azure-mgmt-fabric-py
Azure Fabric Management SDK for Python. Use for managing Microsoft Fabric capacities and resources. Triggers: "azure-mgmt-fabric", "FabricMgmtClient", "Fabric capacity", "Microsoft Fabric", "Power BI capacity".
ax-python-llm
Use when writing Python code with axllm for using the generated Ax package, factory functions, package docs, examples, and API reference.