openbmb/MiniCPM5-2B
Summary
OpenBMB releases MiniCPM5-2B, a 2B-parameter dense Transformer model achieving state-of-the-art performance in its size class for on-device deployment, along with open-source high-quality training datasets.
View Cached Full Text
Cached at: 09/08/26, 12:07 AM
openbmb/MiniCPM5-2B · Hugging Face
Source: https://huggingface.co/openbmb/MiniCPM5-2B

MiniCPM Tech Report|MiniCPM Wiki(Chinese)|GitHub Repo|UltraData|Online Demo
English |中文
https://huggingface.co/openbmb/MiniCPM5-2B#highlightsHighlights
We are releasingMiniCPM5-2B, the second model in theMiniCPM5series, followingMiniCPM5-1B. It is a dense 2B Transformer that scales up the same training recipe, built for on-device, local deployment, and resource-constrained scenarios, reaching 2B-class open-source SOTA.
🏆2B-class open-source SOTA: compared with strong open-source models of similar size, MiniCPM5-2B achieves SOTA performance within this comparison set. It remains competitive with 4B-class models overall, while showing its advantages over models of comparable size in coding, mathematics, long-context understanding, tool use, and agentic tasks.
📂Open High-Quality Data: Alongside the model, we are releasing the high-quality training datasets behind it as part of theUltraDatafamily:UltraX, a high-quality web pre-training dataset;UltraData-Code, featuring L0–L3 tiered code data management to drive a significant leap in coding capabilities;UltraData-SFT-Agent-2609, comprising 500K agent training samples to enhance comprehensive on-device agent capabilities; andUltraData-RL-2609, with 80K+ high-quality RL training samples covering mathematics, code, general knowledge, and long-context reasoning.
https://huggingface.co/openbmb/MiniCPM5-2B#model-listModel List
Use this directory to choose the model format that matches your runtime:
MiniCPM5-2B
- MiniCPM5-2B·ModelScope· BF16 final release (post-trained with RL + OPD)👈 you are here
- MiniCPM5-2B-SFT·ModelScope· BF16 SFT-only checkpoint (before RL / OPD)
- MiniCPM5-2B-Midtrain·ModelScope· BF16 mid-training checkpoint (before SFT)
- MiniCPM5-2B-Base·ModelScope· BF16 base checkpoint (pre-training only)
- MiniCPM5-2B-GGUF·ModelScope· GGUF for llama.cpp / Ollama / LM Studio
- MiniCPM5-2B-MLX·ModelScope· MLX / 4bit for Apple Silicon
- MiniCPM5-2B-GPTQ·ModelScope· GPTQ / 4bit quantized model
- MiniCPM5-2B-DSpark·ModelScope· DSpark draft model for inference acceleration
MiniCPM5-1B
- MiniCPM5-1B·ModelScope· BF16 final release (post-trained with RL + OPD)
- MiniCPM5-1B-SFT·ModelScope· BF16 SFT-only checkpoint (before RL / OPD)
- MiniCPM5-1B-Base·ModelScope· BF16 base checkpoint (pre-training only)
- MiniCPM5-1B-GGUF·ModelScope· GGUF for llama.cpp / Ollama / LM Studio
- MiniCPM5-1B-MLX·ModelScope· MLX / 4bit for Apple Silicon
https://huggingface.co/openbmb/MiniCPM5-2B#model-informationModel Information
MiniCPM5-2B has the following features:
- Type: Causal Language Model
- Architecture: Standard
LlamaForCausalLM - Number of Parameters: 2,516,756,480
- Number of Non-Embedding Parameters: 1,981,982,720
- Number of Layers: 42
- Number of Attention Heads (GQA): 16 for Q and 2 for KV
- Context Length: 131,072
https://huggingface.co/openbmb/MiniCPM5-2B#introductionIntroduction
MiniCPM5-2B is the second model in the MiniCPM5 series. It is designed for local assistants, coding agents, tool-use workflows, and reasoning scenarios where a compact model is preferred. The model keeps a small deployment footprint while providing native long-context support.
https://huggingface.co/openbmb/MiniCPM5-2B#evaluation-resultsEvaluation Results
We compareMiniCPM5-2Bwith strong open-source models in the same size class, includingLFM2.5-2.6B,Qwen3.5-2B, andGemma-4-E2B-it, while also listing larger models such asQwen3.5-4B,granite-4.2-3B,Nemotron-3-Nano-4B,Gemma-4-E4B-it, andLFM2.5-8B-A1Bfor reference.
Within this comparison set, MiniCPM5-2B reaches 2B-class open-source SOTA with an average score of53.9, and also exceeds all of the larger models included here (the highest is51.1). Its advantages are most visible in code reasoning, math reasoning, long-context understanding, tool use, and multiple agentic tasks.
Evaluation Results of MiniCPM5-2B and Baselines
MiniCPM5-2B2B-class Models4B-class ModelsLFM2.5-2.6BQwen3.5-2BGemma-4-E2B-itQwen3.5-4Bgranite-4.2-3BNemotron-3-Nano-4BGemma-4-E4B-itLFM2.5-8B-A1BAverage
53.933.228.024.651.142.732.631.228.4Code ReasoningLiveCodeBench v6
69.142.120.242.956.458.950.753.939.8LCB-Pro 25Q2 (Easy)
68.030.910.327.158.354.651.645.827.8LCB-Pro 25Q2 (Medium)
17.50.00.00.07.05.35.31.80.0OJBench
32.511.22.611.624.821.820.019.08.2SciCode (wbg)
26.3†14.2†2.8†20.9†16.1†24.9†16.4†24.4†7.8†Math ReasoningAIME 2025
86.541.929.631.778.879.456.337.146.0AIME 2026
86.545.229.039.882.783.562.145.056.7HMMT Feb 2026
63.833.720.517.864.060.851.330.138.5MATH-500
94.689.685.885.499.097.091.688.293.2Instruction FollowingIFBench
66.359.046.025.759.073.058.328.351.0IFEval
86.793.477.531.490.293.788.044.490.8Multi-IF
71.876.857.140.373.675.965.945.971.4General KnowledgeMMLU-Pro
70.865.264.356.078.065.865.768.363.1MMLU-Redux
84.780.080.071.888.778.979.883.780.0HLE
8.9†6.2†2.6†4.8†9.9†6.6†4.9†3.8†6.9†GPQA-Diamond
70.2†55.8†45.6†43.3†77.1†55.9†51.3†57.6†51.3†SuperGPQA
40.826.238.630.352.839.937.838.734.5Long ContextAA-LCR
59.0†5.3†28.7†17.0†61.0†24.3†17.3†33.0†0.0†NoLiMa
68.10.717.13.943.55.11.12.30.5LongBenchPro
44.823.78.242.258.434.827.953.519.6LongBench v2
43.730.324.933.247.336.032.042.730.4Tool Useτ³-Bench Banking
20.8†7.2†2.13.96.8†5.6†1.24.13.4τ²-Bench Telecom
97.190.469.0†20.8†92.1†40.928.1†20.8†16.1†BFCL v4
66.661.143.636.656.852.243.747.049.2Coding AgentSWE-bench Verified
46.46.05.02.033.636.83.015.00.4SWE-bench Pro
14.40.60.80.028.212.30.13.30.4Terminal-Bench v2.1
8.6†4.5†3.0†0.4†25.8†13.9†3.8†1.9†1.9Search AgentBrowseComp-ZH
43.59.818.24.739.621.13.37.013.2BrowseComp Top100
39.713.719.36.033.319.04.76.39.7GAIA Text-103
88.749.547.930.178.657.326.539.541.1General AgentGDPval-AA v2
19.6†4.50.00.011.70.0†0.00.00.0Claw-Gym
59.219.325.531.351.660.033.737.92.7WildClaw
23.910.29.28.917.020.08.914.34.5QwenClaw
42.919.318.214.537.136.416.816.74.51.Blue boldindicates the best result across all models in the row (including 4B-class models);Black boldindicates the best result among 2B-class models. 2. Scores marked†come from the official Artificial Analysis release; all others are reproduced internally.
https://huggingface.co/openbmb/MiniCPM5-2B#training-recipeTraining Recipe
The training of MiniCPM5-2B is a full-stack practice of**UltraData Tiered Data Management**, covering three stages: base training, mid-training, and post-training.
Duringbase training, the model goes through stable training and decay training to build core language capability and training stability. It then entersmid-trainingto further strengthen target capabilities and adapt to the target data distribution. The training corpus is released alongside the model asUltra-FineWeb,Ultra-FineWeb-L3,UltraX,UltraData-CodeandUltraData-Math.
Duringpost-training, we proceed in three steps:SFT,RL, andOPD. We first use400B tokens of deep-thinking SFTto establish deep-thinking and general chat abilities; the SFT data is released asUltraData-SFT-2605and the Agent SFT data is released asUltraData-SFT-Agent-2609. We then train specializedRL teachersfor math, code, agentic tasks, writing, and related domains (with the corresponding data also open-sourced asUltraData-RL-2609), and use**On-Policy Distillation (OPD)**to distill these teachers back into one release model.
https://huggingface.co/openbmb/MiniCPM5-2B#what-does-rl–opd-bringWhat does RL + OPD bring?
RL + OPDis a key part of MiniCPM5-2B post-training. During theRLstage, we adopted the critic-based algorithm described inJustRL II, substantially improving training stability and achieving significant gains across multiple domains. On the benchmarks listed below, RL + OPD improves reasoning and general capabilities by an average of**↑10.96 points**, and agentic capabilities by**↑6.96 points**.
OPDmerges the capabilities of 16 expert models produced by RL training, including 5 agentic expert models. At each response position, we compute the full-vocabulary reverse KL divergence between student and teacher logits 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.
https://huggingface.co/openbmb/MiniCPM5-2B#quickstartQuickstart
https://huggingface.co/openbmb/MiniCPM5-2B#vllmvLLM
pip install "vllm>=0.21"
vllm serve openbmb/MiniCPM5-2B --port 8000
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "openbmb/MiniCPM5-2B",
"messages": [{"role": "user", "content": "Who are you? Please briefly introduce yourself."}],
"max_tokens": 128,
"temperature": 1.0
}'
https://huggingface.co/openbmb/MiniCPM5-2B#sglangSGLang
pip install "sglang[srt]>=0.5.16"
python -m sglang.launch_server --model-path openbmb/MiniCPM5-2B --port 30000
curl http://localhost:30000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "openbmb/MiniCPM5-2B",
"messages": [{"role": "user", "content": "Who are you? Please briefly introduce yourself."}],
"max_tokens": 128,
"temperature": 1.0
}'
Speculative decoding (DSpark): we also releaseMiniCPM5-2B-DSpark, a DSpark draft model trained for MiniCPM5-2B. Enable it in SGLang to accelerate decoding while keeping the target model’s outputs unchanged:
python -m sglang.launch_server \
--model-path openbmb/MiniCPM5-2B \
--trust-remote-code \
--speculative-algorithm DSPARK \
--speculative-draft-model-path openbmb/MiniCPM5-2B-DSpark \
--speculative-dspark-block-size 7 \
--port 30000
https://huggingface.co/openbmb/MiniCPM5-2B#transformersTransformers
pip install -U "transformers>=5.6" accelerate torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "openbmb/MiniCPM5-2B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_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,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Recommended sampling params:temperature=1\.0, top\_p=0\.95
https://huggingface.co/openbmb/MiniCPM5-2B#tool-callingTool Calling
For tool / function calling,SGLang is the recommended backend. MiniCPM5-2B emits XML-style tool calls and SGLang’s built-inminicpm5parser converts them to OpenAI-compatibletool\_callsnatively:
python -m sglang.launch_server --model-path openbmb/MiniCPM5-2B --port 30000 \
--tool-call-parser minicpm5 # or: --tool-call-parser auto
https://huggingface.co/openbmb/MiniCPM5-2B#github-cookbooks-and-agent-skillsGitHub Cookbooks and Agent Skills
MiniCPM5-2B uses thestandardLlamaForCausalLMarchitecture, so mainstream inference engines can load it directly:no custom kernels, no model-code fork. For step-by-step deployment and fine-tuning instructions, use the GitHub cookbooks below. Agent Skills are linked as GitHub resources for users working with Cursor / Claude Code style coding agents.
https://huggingface.co/openbmb/MiniCPM5-2B#deploymentDeployment
https://huggingface.co/openbmb/MiniCPM5-2B#fine-tuningFine-tuning
https://huggingface.co/openbmb/MiniCPM5-2B#other-supported-frameworksOther Supported Frameworks
In addition to the deployment and fine-tuning frameworks listed above, MiniCPM5-2B is also supported by FlagOS for multi-chip deployment.
https://huggingface.co/openbmb/MiniCPM5-2B#flagos-overviewFlagOS Overview
To enable large-scale deployment across different AI chips, Beijing Zhiyuan Research Institute, together with numerous research institutions, chip manufacturers, system vendors, and algorithm and software organizations both domestically and internationally, jointly initiated and established the FlagOS Open Source Community.
The FlagOS community is dedicated to building a unified, open-source system software stack for various AI chips, encompassing core open-source projects such as a large-scale operator library, a unified AI compiler, parallel training and inference frameworks, and a unified communication library. It aims to create an open technology ecosystem connecting the “model-system-chip” layers. By enabling “develop once, deploy across chips”, FlagOS unlocks the computational potential of hardware, breaks down the ecosystem silos between different chip software stacks, and effectively reduces migration costs for developers.The FlagOS community fosters an AI hardware and software ecosystem, overcomes single-vendor closed-source monopolies, promotes widespread deployment of AI hardware technologies, and is committed to rooted in China while embracing global collaboration.
Official website express:https://flagos.io
FlagOS multi-chip support and usage#### https://huggingface.co/openbmb/MiniCPM5-2B#flagos-supporting-multiple-ai-chipsFlagOS: Supporting Multiple AI Chips
Thanks to FlagOS’s unified multi-chip AI system software stack, MiniCPM5-2B was adapted to 9 different AI chips in an extremely short time. Currently, the multi-chip version of MiniCPM5-2B has been released on FlagRelease, FlagOS’s platform for automatic migration, adaptation, and deployment of large models across multi-architecture AI chips. Details are as follows:
https://huggingface.co/openbmb/MiniCPM5-2B#flagos-usageFlagOS Usage
https://huggingface.co/openbmb/MiniCPM5-2B#flagos-performance-acceleration-on-nvidiaFlagOS Performance Acceleration on Nvidia
https://huggingface.co/openbmb/MiniCPM5-2B#from-flagrelease-recommendationFrom FlagRelease (Recommendation)
FlagRelease is a platform developed by the FlagOS team for automatic migration, adaptation, and deployment of large models across multi-architecture AI chips. The multi-chip version of MiniCPM5-2B has already been released on FlagRelease. All necessary software packages are pre-installed on the platform, so users do not need to install anything.
https://huggingface.co/openbmb/MiniCPM5-2B#flagrelease-image-key-versionsFlagRelease Image Key Versions
https://huggingface.co/openbmb/MiniCPM5-2B#flagrelease-quick-startFlagRelease Quick Start
https://huggingface.co/openbmb/MiniCPM5-2B#from-scratchFrom Scratch
- Dependencies: Python 3.12, GLIBC 2.39, GLIBCXX 3.4.33, CXXABI 1.3.15
https://huggingface.co/openbmb/MiniCPM5-2B#vllm-versionVllm Version
https://huggingface.co/openbmb/MiniCPM5-2B#installing-the-flagos-operator-libraryInstalling the FlagOS Operator Library
Official Repository:https://github.com/flagos-ai/FlagGems
pip install flag-gems==4.2.1rc0
pip install triton==3.5.1
https://huggingface.co/openbmb/MiniCPM5-2B#activating-accelerationActivating Acceleration
You can enable flagGems acceleration by adding the import of flagGems in the source code of vllm where inference is performed.
import flag_gems
flag_gems.enable(record=True, once=True, path="/root/gems.txt")
vllm serve ${model_path} \
--trust-remote-code \
--dtype bfloat16 \
--enforce-eager \
--port ${Port} \
--served-model-name ${model_name} \
--gpu-memory-utilization 0.85
https://huggingface.co/openbmb/MiniCPM5-2B#using-flagos-unified-multi-chip-backend-pluginUsing FlagOS Unified Multi-Chip Backend Plugin
vllm-plugin-FLis a plugin built for the vLLM inference/service framework. Developed on top of FlagOS’s unified multi-chip backend, it is designed to extend vLLM’s capabilities and performance across a variety of hardware environments.
https://huggingface.co/openbmb/MiniCPM5-2B#using-vllm-plugin-flUsing vllm-plugin-FL
https://huggingface.co/openbmb/MiniCPM5-2B#limitations-and-disclaimerLimitations 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.
https://huggingface.co/openbmb/MiniCPM5-2B#licenseLicense
This repository and MiniCPM model weights are released under theApache-2.0License.
https://huggingface.co/openbmb/MiniCPM5-2B#citationCitation
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}
}
Similar Articles
MiniCPM5-1B
OpenBMB releases MiniCPM5-1B, a dense 1B Transformer model achieving SOTA among open-source 1B-class models, designed for on-device deployment with hybrid reasoning and long-context support.
openbmb released MiniCPM5-2B, not yet available at huggingface
OpenBMB released MiniCPM5-2B, a 2 billion parameter language model, currently not yet available on Hugging Face.
@ModelScope2022: MiniCPM5-1B is now fully open source, including weights, training data, and deployment code. 1B params, #1 on Artificia…
MiniCPM5-1B is fully open-sourced with weights, training data, and deployment code; it achieves top scores among sub-2B models and runs on edge devices.
openbmb/MiniCPM-RobotManip
OpenBMB releases MiniCPM-RobotManip, a 1.5B vision-language-action model for on-device robot manipulation that outperforms larger models with efficient streaming inference and long-horizon visual memory.
MiniCPM5-1B Shows Why the Small-Model Race Isn't Over
MiniCPM5-1B is a 1B parameter model from OpenBMB that achieves impressive scores on AIME 2025 and τ2-Bench Telecom, outperforming larger models. It features both fast and reasoning modes from a single checkpoint, enabled by a three-stage post-training process including supervised fine-tuning, reinforcement learning, and on-policy distillation.

