MiniCPM5 2B
MiniCPM5-2B is an Apache-2.0 licensed dense 2B Transformer text-generation model from OpenBMB, released as the second model in the MiniCPM5 series after MiniCPM5-1B. The model card describes it as designed for on-device, local deployment, and resource-constrained scenarios, supporting English and Chinese, with tags including long-context and tool-calling. It is intended to be used with transformers and is distributed with safetensors weights. Training data references listed datasets such as Ultra-FineWeb, UltraX-Preview, UltraData-Math, UltraData-Code, and UltraData SFT/Agent/RL collections. The card claims 2B-class open-source SOTA within its comparison set and competitiveness with 4B-class models, with stated advantages in coding, mathematics, long-context understanding, tool use, and agentic tasks.
At a glance
- Parameters
- 2.52B
- Architecture
- llama
- Context length
- 131,072
- License
- apache-2.0
- Disk space
- 4.7 GB
- Software
- llama.cpp, SGLang, vLLM, Transformers
Will it run on your machine?
Save your machine to see a personalized rating and its reasoning.
Add my hardwareBest for
- Local text generation in English or Chinese.
- On-device or edge deployment where a small dense model is preferred.
- Tool-calling and agentic task workflows as indicated by model tags.
- Coding and mathematics-oriented text generation, as described in the model card claims.
- Long-context understanding tasks, subject to the model's documented context capabilities.
Tradeoffs
- The supplied facts do not include specific performance benchmarks, numerical hardware requirements, or compatibility details beyond the transformers library and safetensors format.
- The model card's SOTA and 4B-class competitiveness claims are provided by the source and are not independently verified in the supplied facts.
- Supported languages listed are English and Chinese; other languages are not stated.
- No information is provided about maximum context length, quantization support, or deployment memory requirements.
- No testing, purchase recommendation, or independent evaluation is implied by the supplied model facts.
Ways to run it
llama.cpp · Windows, macOS, Linux
Repository-specific command in publisher documentation; confirm dependencies and hardware in the source.
llama-server -m MiniCPM5-2B-F16.gguf -a MiniCPM5-2B --port 8080 -ngl 99 -c 8192 --jinjaSGLang · Linux
Repository-specific command in publisher documentation; confirm dependencies and hardware in the source.
python -m sglang.launch_server --model-path openbmb/MiniCPM5-2B --port 30000vLLM · Linux
Repository-specific command in publisher documentation; confirm dependencies and hardware in the source.
vllm serve openbmb/MiniCPM5-2B --port 8000Transformers · See official guide
Repository-specific command in publisher documentation; confirm dependencies and hardware in the source.
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))Explore its uses
Keep exploring
Bonsai 2 · 27B
A compressed 27B-class reasoning model with publisher-provided GGUF packs and a dedicated llama.cpp fork for CUDA, Metal, and CPU.
DeepSeek V4.1 Flash
A multimodal reasoning model with a compressed key-value cache, published as open weights.
Qwen3.8
Explore 4 versions of Qwen3.8. Compare model sizes, packages, hardware requirements, and available setups.