Run this model with HF Jobs

Run gilbert2324/MiniCPM5-15B-A2.5B 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 and TRL to fine-tune https://huggingface.co/gilbert2324/MiniCPM5-15B-A2.5B. 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/gilbert2324/MiniCPM5-15B-A2.5B 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/gilbert2324/MiniCPM5-15B-A2.5B. 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/gilbert2324/MiniCPM5-15B-A2.5B. 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.

MiniCPM Tech Report | MiniCPM Wiki(Chinese) | GitHub Repo | UltraData | Online Demo

English | δΈ­ζ–‡

✨ Highlights

MiniCPM5-15B-A2.5B is a sparse Mixture-of-Experts (MoE) model in the MiniCPM5 series, designed for on-device agents.

  • πŸ“± An efficient foundation model for on-device agents: Built for on-device agents, MiniCPM5-15B-A2.5B delivers efficient inference locally on phones and PCs. It is compatible with agent harnesses such as Codex, Claude Code, DeepSeek Harness, and WorkBuddy, and offers general-purpose work-agent and coding-agent capabilities. It provides reliable agent services while keeping users' private data entirely on-device.
  • ⚑ On-device inference speed: On an iPhone 18 Pro Max with no memory constraints, MiniCPM5-15B-A2.5B reaches a decoding speed of 52 tokens/s. Building on LES 1.0, MiniCPM5-15B-A2.5B further introduces native prefetch-routing training, improving expert-prefetch prediction accuracy by an average of about 11%. With about 3 GB of memory usage, it reaches 30 tokens/s on an iPhone 18 Pro Max.
  • πŸ† The top-performing LLM under 20B: MiniCPM5-15B-A2.5B demonstrates exceptional capability density, outperforming Qwen3.6-35B-A3B in overall capability with less than half the total parameter count of Qwen3.6-35B-A3B. On the AA-Index benchmark, it scores 11 and ranks first among models under 20B.
  • 🧠 IMO/CMO gold-medal-level reasoning: MiniCPM5-15B-A2.5B officially participated in the 2026 Chinese Mathematical Olympiad (CMO 2026) finals, earning an official gold-medal certification with a score of 123 out of 126. This model also achieved a score of 32 in a self-evaluation on the 2026 International Mathematical Olympiad (IMO 2026), surpassing the gold-medal cutoff of 29. MiniCPM5-15B-A2.5B is the first on-device model to reach IMO gold-medal level.
Capability Radar by Dimension MiniCPM5-15B-A2.5B Qwen3.6-35B-A3B Qwen3.5-35B-A3B Gemma-4-26B-A4B-it LFM2.5-24B-A2B Nemotron-Lightning-30B-A3B General KnowledgeScore range: 15-75 MathScore range: 25-85 CodeScore range: 15-75 Instruction FollowingScore range: 25-85 Long ContextScore range: 25-85 Tool UseScore range: 10-70 Coding AgentScore range: 0-60 General AgentScore range: 0-60 Qwen3.6-35B-A3B Qwen3.5-35B-A3B Gemma-4-26B-A4B-it LFM2.5-24B-A2B Nemotron-Lightning-30B-A3B MiniCPM5-15B-A2.5B

🎬 Showcase

MiniCPM5-15B-A2.5B completes several agent tasks on its own, entirely on-device β€” planning, calling tools, and working step by step until each task is finished.

Model List

Use this list to choose the model format that matches your runtime:

MiniCPM5-15B-A2.5B

Other models in the MiniCPM5 series:

MiniCPM5-2B
MiniCPM5-1B

Model Information

MiniCPM5-15B-A2.5B has the following features:

  • Type: Causal Language Model
  • Architecture: MiniCPM5MoEForCausalLM
  • Number of Parameters: 15B in total and 2.5B activated
  • Hidden Size: 2,048
  • Vocabulary Size: 130,560
  • Number of Layers: 28
  • Gated Attention:
    • Attention Heads (GQA): 32 Q heads / 2 KV heads
    • Head Dimension: 128
  • Feed-forward Network:
    • Layer 0: Dense MLP with an intermediate size of 8,192
    • Layers 1–27: MoE
      • Routed Experts: 160
      • Activated Experts: 16 routed + 1 shared
      • Expert Intermediate Size: 512
  • Context Length: 524,288

Introduction

MiniCPM5-15B-A2.5B is a sparse Mixture-of-Experts (MoE) model, designed for native on-device agents. It runs locally on phones, PCs, and other edge devices, providing general work, coding, tool-use, and complex reasoning capabilities under constrained resources. The model supports hybrid thinking and long-context understanding, enabling it to fit into real personal workflows while keeping data and execution on the user's device.

Evaluation Results

With only 15B total and 2.5B activated parameters, MiniCPM5-15B-A2.5B achieves outstanding performance, outperforming both 30B-class MoE models and 10B-class dense models. Among all compared MoE baselines, it ranks first on 22 out of 36 benchmarks across general knowledge, math, coding, long context, tool use, and agentic tasks. Even when compared against some 30B-class dense models, it maintains competitive performance, demonstrating exceptional capability density.

MiniCPM5-15B-A2.5B Benchmark Comparison MoE 10B-class Dense 30B-class Dense MiniCPM5- 15B-A2.5B Qwen3.6- 35B-A3B Qwen3.5- 35B-A3B Gemma-4- 26B-A4B-it LFM2.5- 24B-A2B Nemotron- Lightning- 30B-A3B Qwen3.5- 9B Gemma-4- 12B-it Qwen3.6- 27B Qwen3.5- 27B Muse- Glimmer-30B Average 64.4 59.9 58.7 55.1 49.5 47.9 53.7 51.9 63.0 63.2 61.5 General Knowledge MMLU-Pro 83.5 84.7 85.0 83.9 75.8 80.6 81.6 77.2 85.7 85.8 83.4 MMLU-Redux 92.5 93.0 93.3 91.9 87.6 38.7 90.9 90.4 93.3 93.6 85.6 AA-HLE-Diamond 8.0 * 6.9 * 4.9 6.2 * 5.2 4.0 4.8 * 4.4 6.6 6.2 8.3 GPQA-Diamond 84.4 84.1 84.5 79.2 77.1 72.7 80.6 75.3 84.2 85.8 82.9 RBench 76.2 78.7 80.1 80.8 69.8 51.8 76.2 75.8 82.8 82.2 76.4 Math AIME 2025 97.3 92.3 91.9 88.3 84.8 87.1 86.3 81.9 92.9 92.3 94.6 AIME 2026 95.8 89.2 91.7 87.5 82.7 86.0 87.9 82.1 94.4 93.1 93.1 HMMT Feb 2026 90.0 80.9 78.0 76.0 71.0 71.6 71.6 63.8 84.5 81.4 82.0 HMMT Nov 2026 94.8 92.5 90.2 87.5 87.3 86.0 86.7 83.8 95.0 91.9 90.0 Apex 2025 6.8 4.7 1.6 2.1 0.5 1.0 1.6 1.0 3.7 1.0 3.1 IMO-AnswerBench 88.2 79.6 78.9 74.1 55.4 33.8 71.0 77.8 87.3 84.2 83.8 IMO-ProofBench 64.1 28.0 30.7 19.5 32.7 23.2 22.7 21.3 35.8 34.1 35.8 Code LCB-Pro 25Q2 (Easy) 90.7 84.5 82.5 79.4 61.9 62.9 66.7 79.4 87.6 89.7 89.7 LCB-Pro 25Q2 (Medium) 43.9 26.3 21.1 26.3 7.0 8.8 10.7 24.6 36.8 31.6 47.4 LiveCodeBench v6 82.1 73.0 74.5 76.0 66.7 71.4 65.1 72.0 79.4 81.9 83.4 SciCode (wbg) 43.5 37.4 37.7 38.8 33.3 30.4 28.8 37.7 41.7 40.5 45.8 Instruction Following Multi-IF 80.7 79.5 80.1 83.2 85.0 72.0 78.2 83.8 81.3 81.9 82.2 MultiChallenge 53.5 56.1 59.4 58.8 34.8 54.7 56.0 61.1 59.2 62.8 58.5 IFBench 64.3 66.7 73.0 83.7 75.0 70.7 65.3 76.7 70.3 78.3 75.3 Long Context LongBench v2 128K 51.1 59.4 60.6 58.5 38.6 46.3 56.1 60.0 61.2 59.8 58.9 AA-LCR v1.1 76.0 71.7 * 72.0 * 65.7 * 32.7 58.3 70.0 * 63.7 * 77.3 * 77.7 * 82.3 GraphWalks 128K 92.3 96.0 95.4 68.9 40.6 57.6 93.5 67.1 96.8 97.0 81.9 Tool Use BFCL v4 65.1 64.4 67.3 62.8 56.6 56.1 66.1 37.4 65.6 68.5 60.9 AutomationBench (v1.0.6) 26.2 8.3 2.8 13.8 9.5 0.0 4.3 8.2 14.5 8.2 14.3 τ³-Bench Banking 27.6 8.8 9.3 12.9 9.6 7.2 7.2 7.2 11.1 9.0 22.9 τ³-Bench Telecom 96.9 97.4 84.0 39.5 76.8 59.2 90.4 37.3 92.3 91.2 75.2 τ³-Bench Airline 86.0 80.5 80.5 80.0 77.5 74.5 80.5 71.0 83.5 84.5 85.5 τ³-Bench Retail 81.6 82.2 83.3 75.4 73.7 79.8 79.6 73.7 83.8 85.3 84.0 Coding Agent NL2Repo 27.3 29.2 25.9 22.2 14.3 16.7 15.8 13.5 29.3 26.2 26.5 SWE-Bench Verified 68.4 67.8 66.4 58.4 47.4 53.2 59.8 44.2 70.7 70.2 72.0 SWE-Bench Pro Verified 52.2 47.3 41.7 20.9 20.4 27.2 35.2 21.9 50.6 46.7 44.9 Terminal-Bench v2.1 50.2 44.9 40.5 39.0 32.2 33.7 29.2 27.3 60.7 41.6 50.2 General Agent Claw-Gym 73.2 64.5 62.9 72.0 49.7 68.5 56.5 69.4 65.1 63.6 65.1 QwenClaw 52.0 53.4 47.3 39.1 47.6 47.9 44.2 37.2 54.9 51.0 53.1 AA-Briefcase v1.1 14.6 * 10.7 * 2.8 * 0.0 * -- 3.6 * 0.0 * -- 15.9 * -- 0.0 * GDPval-AA v2.1 36.7 32.6 30.8 30.4 10.0 26.9 11.3 6.3 33.6 28.0 35.0 1. Blue bold marks the best result in the row (including 30B-class Dense models); black bold marks the best among MoE and 10B-class Dense models. 2. Except where marked with *, all scores are internal evaluations (think mode). Coding agents: NL2Repo runs on codex-0.142.1; SWE-Bench series and Terminal-Bench v2.1 on mswe-2.4.6; τ³-Bench domain tasks use v1.0.1; IFBench is the 0830 build; AA-HLE-Diamond, AA-LCR v1.1 and AA-Briefcase v1.1 are Artificial Analysis-aligned benchmarks; GDPval-AA v2.1 is an internal AA-aligned run (official AA values for these models are not published). 3. * = official Artificial Analysis value; "--" in AA-Briefcase v1.1 means the model is not covered by AA, and models below the 500-Elo floor are shown as 0.0.

See eval/imo-harness for the code and instructions to reproduce the IMO 2026 evaluation.

Training Recipe

The training of MiniCPM5-15B-A2.5B is a practice of UltraData Tiered Data Management, covering three stages: pre-training, mid-training, and large-scale post-training.

During pre-training, the model goes through stable training and decay training to build core language capability. It then enters mid-training to further strengthen target capabilities and adapt to the target data distribution. Parts of the training corpus are released alongside the model as Ultra-FineWeb, Ultra-FineWeb-L3, UltraX, UltraData-Code and UltraData-Math.

We conducted large-scale post-training to strengthen the model's agentic and general-purpose capabilities. We synthesized millions of interactive environments with complex tasks and used JustRL-II for stable long-horizon reinforcement learning. We then used large-scale multi-teacher on-policy distillation (MOPD) to consolidate the capabilities of 22 specialized teachers into a single release model. Parts of our post-training data are released as UltraData-SFT-2605 and UltraData-SFT-Agent-2609.

MiniCPM5-15B-A2.5B Training Recipe

What does RL + OPD bring?

RL + OPD is a key part of MiniCPM5-15B-A2.5B post-training.

During the RL stage, we use JustRL II for large-scale reinforcement learning, enabling the model to continuously explore and iterate its policy across diverse environments and tasks. We train dedicated RL teachers for agentic, mathematical, coding, writing, and other domains to expand the model's capability frontier.

During the OPD stage, we merge 22 expert models produced by RL training into a unified general-purpose model. By incorporating an offline data-generation strategy, we significantly improve the training efficiency of multi-teacher on-policy distillation (MOPD). At each response position, we compute the reverse KL divergence between student and teacher full-vocabulary probability distributions as the advantage estimate, replacing the original verification-based advantage. OPD directly reuses the prompts used to train each RL teacher as distillation data, so no additional corpus construction is required.

On the agent benchmarks shown below, RL + OPD improves scores by an average of ↑7.85 points over the SFT baseline.

MiniCPM5-15B-A2.5B RL + OPD Gains

Quickstart

We recommend using the following sets of sampling parameters for generation:

  • General tasks:
    • Thinking mode: temperature=1.0, top_p=0.95, min_p=0.0. If you encounter repetitive outputs, try: temperature=1.0, top_p=0.95, min_p=0.0, repetition_penalty=1.05.
    • Non-thinking mode: temperature=0.7, top_p=0.80, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0.
  • Creative writing tasks:
    • Thinking mode: temperature=0.7, top_p=0.95, min_p=0.0, repetition_penalty=1.05.
    • Non-thinking mode: temperature=0.7, top_p=0.80, top_k=20, min_p=0.0, presence_penalty=0.5, repetition_penalty=1.0.

Please note that the support for sampling parameters varies across inference frameworks.

vLLM

Install:

MiniCPM5-15B-A2.5B can be used directly with vLLM. Please use the latest main branch that includes PR #69127 and PR #69128:

git clone https://github.com/vllm-project/vllm.git
cd vllm
pip install -e .

Or use the latest nightly wheel:

uv pip install -U vllm --torch-backend=auto --extra-index-url https://wheels.vllm.ai/nightly

Standard mode: the following command starts an OpenAI-compatible API server with a default context length of 524,288 tokens. If you run out of GPU memory, increase --tensor-parallel-size or reduce --max-model-len:

vllm serve openbmb/MiniCPM5-15B-A2.5B --served-model-name MiniCPM5-15B-A2.5B --port 8000

You can also use the 4-bit quantized MiniCPM5-15B-A2.5B-GPTQ by simply replacing the model path.

Speculative decoding (DSpark): we also release MiniCPM5-15B-A2.5B-DSpark, a DSpark draft model trained for MiniCPM5-15B-A2.5B. Enable it in vLLM to accelerate decoding while keeping the target model's outputs unchanged. Use the argument --speculative-config '{"method":"dspark","model":"openbmb/MiniCPM5-15B-A2.5B-DSpark","num_speculative_tokens":7}':

vllm serve openbmb/MiniCPM5-15B-A2.5B --served-model-name MiniCPM5-15B-A2.5B --port 8000 \
  --speculative-config '{"method":"dspark","model":"openbmb/MiniCPM5-15B-A2.5B-DSpark","num_speculative_tokens":7}'

Tool-calling mode: enable tool calling with the arguments --enable-auto-tool-choice --tool-call-parser minicpm5 --reasoning-parser qwen3:

vllm serve openbmb/MiniCPM5-15B-A2.5B --served-model-name MiniCPM5-15B-A2.5B --port 8000 \
  --enable-auto-tool-choice --tool-call-parser minicpm5 --reasoning-parser qwen3

Request example:

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniCPM5-15B-A2.5B",
    "messages": [{"role": "user", "content": "Who are you? Please briefly introduce yourself."}],
    "max_tokens": 512, "temperature": 1.0, "top_p": 0.95
  }'

See Tool Usage & Agentic Integration below for a tool-calling request example and agent harness integration guides.

SGLang

Install:

MiniCPM5-15B-A2.5B can be used directly with SGLang. Please use the latest main branch that includes PR #52071 and PR #52072:

git clone https://github.com/sgl-project/sglang.git
cd sglang
pip install -e "python[all]"

Standard mode: the following command starts an OpenAI-compatible API server with a default context length of 524,288 tokens. If you run out of GPU memory, increase --tp-size or reduce --context-length:

python -m sglang.launch_server --model-path openbmb/MiniCPM5-15B-A2.5B --served-model-name MiniCPM5-15B-A2.5B --port 8000

You can also use the 4-bit quantized MiniCPM5-15B-A2.5B-GPTQ by simply replacing the model path.

Speculative decoding (DSpark): we also release MiniCPM5-15B-A2.5B-DSpark, a DSpark draft model trained for MiniCPM5-15B-A2.5B. Enable it in SGLang to accelerate decoding while keeping the target model's outputs unchanged. Use the arguments --speculative-algorithm DSPARK --speculative-draft-model-path openbmb/MiniCPM5-15B-A2.5B-DSpark --speculative-dspark-block-size 7:

python -m sglang.launch_server --model-path openbmb/MiniCPM5-15B-A2.5B --served-model-name MiniCPM5-15B-A2.5B --port 8000 \
  --speculative-algorithm DSPARK --speculative-draft-model-path openbmb/MiniCPM5-15B-A2.5B-DSpark --speculative-dspark-block-size 7

Tool-calling mode: enable tool calling with the arguments --tool-call-parser minicpm5 --reasoning-parser qwen3:

python -m sglang.launch_server --model-path openbmb/MiniCPM5-15B-A2.5B --served-model-name MiniCPM5-15B-A2.5B --port 8000 \
  --tool-call-parser minicpm5 --reasoning-parser qwen3

Request example:

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniCPM5-15B-A2.5B",
    "messages": [{"role": "user", "content": "Who are you? Please briefly introduce yourself."}],
    "max_tokens": 512, "temperature": 1.0, "top_p": 0.95
  }'

See Tool Usage & Agentic Integration below for a tool-calling request example and agent harness integration guides.

Llama.cpp

Install:

Use official llama.cpp b12847 or later to run the GGUF model. The following commands build llama-server from upstream source.

git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON
cmake --build build --config Release --target llama-server -j

For CPU-only builds, omit -DGGML_CUDA=ON. The built binaries are located in ./build/bin/; change to that directory before running the commands below:

Run Server: The following command starts an OpenAI-compatible API server with the Q4_K_M quantized weights:

./llama-server -m MiniCPM5-15B-A2.5B-Q4_K_M.gguf -a MiniCPM5-15B-A2.5B --port 8080 -ngl 99 -fa on --min-p 0 -c 8192 --jinja

Here -c 8192 sets the context length to 8192 (adjust as needed). llama.cpp sets min_p=0.05 by default, which discards tokens whose probability falls below 5% of the highest-probability token. This can actually trigger repetition β€” the discarded tokens are often exactly the ones the model needs to break out of a repetition loop, so we explicitly set --min-p 0 in the command to disable this filtering.

Other weights

If you have enough GPU memory, swap -m to the unquantized MiniCPM5-15B-A2.5B-BF16.gguf:

./llama-server -m MiniCPM5-15B-A2.5B-BF16.gguf -a MiniCPM5-15B-A2.5B --port 8080 -ngl 99 -fa on --min-p 0 -c 8192 --jinja

Or use the higher-precision quantized MiniCPM5-15B-A2.5B-Q8_0.gguf:

./llama-server -m MiniCPM5-15B-A2.5B-Q8_0.gguf -a MiniCPM5-15B-A2.5B --port 8080 -ngl 99 -fa on --min-p 0 -c 8192 --jinja

Speculative decoding (DSpark): we also release MiniCPM5-15B-A2.5B-DSpark-GGUF, the GGUF version of the DSpark draft model. Start with the following command:

./llama-server -m MiniCPM5-15B-A2.5B-Q4_K_M.gguf -a MiniCPM5-15B-A2.5B --port 8080 -ngl 99 -fa on --min-p 0 -c 8192 --jinja \
 -md MiniCPM5-15B-A2.5B-DSpark.gguf --spec-type draft-dspark --spec-draft-n-max 7 --spec-draft-p-min 0 --n-gpu-layers-draft 99

Here --spec-draft-n-max controls the maximum number of tokens the draft model predicts per speculation round, up to 7. If you use a quantized model, the acceptance rate may drop, in which case reduce this value (e.g., to 2) for better throughput.

Request example:

curl http://localhost:8080/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "MiniCPM5-15B-A2.5B",
        "messages": [{"role": "user", "content": "Who are you? Please briefly introduce yourself."}],
        "temperature": 1.0, "top_p": 0.95, "min_p": 0.0, "max_tokens": 512
    }'

For Llama.cpp tool calling, see the tool-calling section of the Llama.cpp guide.

Transformers

# MiniCPM5 support is in Transformers 5.25.0 and newer
pip install -U "transformers>=5.25.0" accelerate torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "openbmb/MiniCPM5-15B-A2.5B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "Who are you? Please briefly introduce yourself."}]
inputs = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    enable_thinking=True, # Set to False to disable thinking mode
    return_dict=True,
    return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

Tool Usage & Agentic Integration

MiniCPM5-15B-A2.5B natively supports thinking mode, single-turn parallel multi-tool calling, and long-horizon multi-turn agentic workflows.

Quick Example (Thinking On by Default / Disabling Thinking)

Notes:

  • Thinking mode is enabled by default (<think>...</think> precedes tool calls or responses). To disable thinking for lower latency, explicitly pass enable_thinking: false (chat_template_kwargs: {"enable_thinking": false} for Chat Completions, reasoning: {"effort": "none"} for Responses, or thinking: {"type": "disabled"} for Anthropic Messages).
  • The current chat_template.jinja does not strip historical thinking. In multi-step tool-calling loops and agent trajectories, passing back prior thinking (reasoning_content / reasoning / thinking) is strongly recommended to preserve chain-of-thought continuity and maximize Prefix KV Cache hit rates.
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Get current weather for a city.",
        "parameters": {
            "type": "object",
            "properties": {
                "city": {"type": "string", "description": "City name"},
                "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
            },
            "required": ["city"],
        },
    },
}]

resp = client.chat.completions.create(
    model="MiniCPM5-15B-A2.5B",
    messages=[{"role": "user", "content": "Check today's weather in Beijing and Shanghai in celsius."}],
    tools=tools,
    temperature=1.0, top_p=0.95,
    max_tokens=2048,
    # Uncomment to disable thinking mode:
    # extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)
print(resp.choices[0].message.tool_calls)

Agent Harness Integration

Verified to work smoothly via the open-source manager CC Switch:

  • Claude Code (Anthropic Messages protocol)

  • Codex CLI / Desktop (OpenAI Responses protocol, with namespace multi-agent tool passthrough)

  • DeepSeek Harness (OpenAI Chat Completions, Responses, or Anthropic Messages)

  • WorkBuddy (OpenAI Chat Completions protocol)

For the full specification of request, parameter, response, and error formats, multi-turn parallel calling and historical thinking retention, local transformers usage, step-by-step harness setup, and FAQs, see Tool Usage Guide.

API Platform

MiniCPM5-15B-A2.5B is also available on the MiniCPM Open Platform for On-Device Open-Source Models. The platform offers an online playground and hosted API access to the MiniCPM family of on-device open-source models, covering text, multimodal, speech synthesis, real-time conversation, and document parsing, and is compatible with the OpenAI API specification.

After creating an API key in the console, set the base URL to https://api.modelbest.cn/v1, the model name to MiniCPM5-15B-A2.5B, and fill in your API key, and you can call it directly. See the API documentation for API key application and full usage details.

For questions, issues, or feedback, please reach us on Discord or our Feishu group.

Running on iOS

MiniCPM5-15B-A2.5B runs on iOS through MiniCPM-V-Apps:

  1. Install MiniCPM-V-Apps via TestFlight.

  2. In the app's model list, select MiniCPM5-15B-A2.5B and download it.

For faster inference, we recommend the quantized version: MiniCPM5-15B-A2.5B-Q3_gud-LCO-GGUF. See MiniCPM-V-Apps repository for the app and source code. For detailed installation instructions and frequently asked questions, see run MiniCPM5-15B-A2.5B on iOS.

GitHub Cookbooks and Agent Skills

MiniCPM5-15B-A2.5B uses the MiniCPM5 MoE architecture (MiniCPM5MoEForCausalLM), natively supported in Hugging Face Transformers (minicpm5_moe), so no trust_remote_code is needed. Step-by-step deployment and fine-tuning instructions are available in the GitHub cookbooks below. Agent Skills are provided as GitHub resources for coding agents such as Cursor and Claude Code to follow through deployment and validation.

Deployment

Backend Model format / use case Cookbook Agent Skill
HF Transformers BF16 / FP16 local Python inference, GPU + CPU transformers.md SKILL.md
vLLM BF16 / FP16 OpenAI server vllm.md SKILL.md
SGLang BF16 / FP16 OpenAI server, recommended for tool calling sglang.md SKILL.md
llama.cpp GGUF local inference, CPU/GPU llama_cpp.md SKILL.md
Ollama GGUF local on-device runtime ollama.md SKILL.md
LM Studio GGUF desktop app and OpenAI server lmstudio.md SKILL.md
MLX-VLM MLX affine 4-bit inference on Apple Silicon mlx.md SKILL.md
vLLM Ascend BF16 / FP16 OpenAI server vllm_ascend.md SKILL.md
LiteRT-LM .litertlm on-device runtime: desktop / server, CPU + GPU litert.md SKILL.md

Fine-tuning

Framework Use case Cookbook Agent Skill
TRL + PEFT LoRA / SFT fine-tuning trl.md SKILL.md
LLaMA-Factory Fine-tuning llamafactory.md SKILL.md
ms-swift Fine-tuning ms_swift.md SKILL.md
unsloth Fine-tuning unsloth.md SKILL.md

Other Supported Frameworks

In addition to the deployment and fine-tuning frameworks listed above, MiniCPM5-15B-A2.5B is also supported by FlagOS for multi-chip deployment, including BF16 releases for T-Head, NVIDIA, Huawei Ascend, Hygon, Kunlunxin, MetaX, Moore Threads, and Iluvatar, plus a W4A8 release for ARM CPUs.

FlagOS Overview

FlagOS is a fully open-source system software stack designed to unify the model–system–chip layers and foster an open, collaborative ecosystem. It enables a β€œdevelop once, run anywhere” workflow across diverse AI accelerators, unlocking hardware performance, eliminating fragmentation among vendor-specific software stacks, and substantially lowering the cost of porting and maintaining AI workloads. The mission of FlagOS is to enable open AI computation and lower the barrier to AI usage and innovation worldwide.

Official website: flagos.io Β· Developer documentation: docs.flagos.io

FlagOS multi-chip support and usage

FlagOS Multi-Chip Support and Downloads

FlagRelease provides tools for model migration, adaptation, evaluation, and release across AI chip architectures. Select the version for your target hardware from the repositories below.

Chip / Platform Precision MiniCPM5-15B-A2.5B
T-Head BF16 ModelScope / Hugging Face
NVIDIA BF16 ModelScope / Hugging Face
Huawei Ascend BF16 ModelScope / Hugging Face
Hygon BF16 ModelScope / Hugging Face
Kunlunxin BF16 ModelScope / Hugging Face
MetaX BF16 ModelScope / Hugging Face
Moore Threads BF16 ModelScope / Hugging Face
Iluvatar BF16 ModelScope / Hugging Face
ARM CPU W4A8 ModelScope / Hugging Face

The ARM W4A8 release has its own deployment procedure. Refer to its model card for supported devices, operating systems, and inference commands.

FlagOS Installation and Usage

Prepare the drivers and runtime required by your platform's model card, and download the corresponding model files. The example below downloads the T-Head BF16 version:

python -m pip install --upgrade huggingface_hub
hf download FlagRelease/MiniCPM5-15B-A2.5B-BF16-zhenwu-FlagOS \
  --local-dir ./models/MiniCPM5-15B-A2.5B-BF16-zhenwu-FlagOS

For another platform, use its repository from the table above. Model files are also available through ModelScope.

Option 1: Use a FlagRelease Image

If the selected model card provides a container image:

  1. Pull the image specified for your platform.
  2. Start the container with the required device mappings and model directory mounts.
  3. Run the inference example or start the service using the model card's commands and hardware settings.
Option 2: Install from Source

For source deployment, use the inference framework and component revisions specified by the selected model card. FlagOS provides installation guides for its inference plugins:

The following installation sequence is for T-Head with vLLM-plugin-FL. Prepare a compatible PyTorch build and the required build tools, then set MINICPM5_VLLM_REF, MINICPM5_PLUGIN_REF, and MINICPM5_GEMS_REF to the tags or commit IDs specified in the T-Head model card.

: "${MINICPM5_VLLM_REF:?Set the vLLM revision required by the model card}"
: "${MINICPM5_PLUGIN_REF:?Set the vLLM-plugin-FL revision required by the model card}"
: "${MINICPM5_GEMS_REF:?Set the FlagGems revision required by the model card}"

# 1. Install vLLM for the T-Head backend.
git clone https://github.com/vllm-project/vllm.git
cd vllm
git checkout "$MINICPM5_VLLM_REF"
VLLM_TARGET_DEVICE=empty python -m pip install -v --no-build-isolation --no-deps .
cd ..

# 2. Install vLLM-plugin-FL.
git clone https://github.com/flagos-ai/vllm-plugin-FL.git
cd vllm-plugin-FL
git checkout "$MINICPM5_PLUGIN_REF"
python -m pip install --no-build-isolation -e .
cd ..

# 3. Install FlagGems.
git clone https://github.com/flagos-ai/FlagGems.git
cd FlagGems
git checkout "$MINICPM5_GEMS_REF"
python -m pip install --no-build-isolation -e .
cd ..

Install the FlagTree compiler and FlagCX communication library as required by your platform. Apply any model-specific patches and environment settings before running inference.

Run Inference

The following text-generation example uses the downloaded BF16 model files in a configured T-Head vLLM-plugin-FL environment with MiniCPM5-15B-A2.5B support. Save it as inference.py. Set tensor_parallel_size and other runtime parameters in the LLM call as required by your hardware and model card.

from vllm import LLM, SamplingParams


if __name__ == "__main__":
    prompts = ["Explain why the sky appears blue."]
    sampling_params = SamplingParams(max_tokens=512, temperature=0.0)

    llm = LLM(
        model="./models/MiniCPM5-15B-A2.5B-BF16-zhenwu-FlagOS",
        trust_remote_code=True,
    )
    outputs = llm.generate(prompts, sampling_params)
    for output in outputs:
        print(f"Prompt: {output.prompt!r}")
        print(f"Generated: {output.outputs[0].text!r}")
VLLM_PLUGINS=fl python inference.py

Limitations and Disclaimer

This model has no autonomous intent or legal personhood; its outputs are text generated from statistical patterns and may be inaccurate, biased, or offensive, and may be manipulated by carefully crafted prompts ("jailbreaks") into producing unintended content. Its responses on sensitive topics such as politics, health, finance, and law are not reviewed by experts and should not be treated as professional advice.

This model is provided "AS IS", without warranty of any kind, express or implied, and the developers are not liable for any damages arising from its use. Users must employ the model only for lawful, compliant, and ethical purposes, configure their own safeguards, and label AI-generated content where required; deliberate jailbreaking, injection attacks, or inducing harmful output is prohibited, and any such testing is at the user's own risk.

License

This repository and MiniCPM model weights are released under the Apache-2.0 License.

Citation

Please cite our paper if you find our work valuable:

@article{minicpm4,
  title={Minicpm4: Ultra-efficient llms on end devices},
  author={MiniCPM, Team},
  journal={arXiv preprint arXiv:2506.07900},
  year={2025}
}
Downloads last month
-
Safetensors
Model size
15B params
Tensor type
BF16
Β·
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Datasets used to train gilbert2324/MiniCPM5-15B-A2.5B

Papers for gilbert2324/MiniCPM5-15B-A2.5B