MiniCPM5-1B
MiniCPM Text Series
MiniCPM5-1B is the first model in the MiniCPM5 series, built for local assistants, coding agents, tool-calling workflows and inference scenarios that need a compact model. It offers native long-context capability at a low deployment cost and supports both Think and No Think chat modes from the same weights.
Choose the BF16, GGUF or MLX weights that suit your runtime environment; for training or research, you can also look at the SFT and Base versions.
Model Downloads
Currently recommended version: MiniCPM5-1B (BF16 / GGUF / MLX):
| HuggingFace | ModelScope |
|---|---|
| MiniCPM5-1B | MiniCPM5-1B |
| MiniCPM5-1B-SFT | MiniCPM5-1B-SFT |
| MiniCPM5-1B-Base | MiniCPM5-1B-Base |
| MiniCPM5-1B-GGUF | MiniCPM5-1B-GGUF |
| MiniCPM5-1B-MLX | MiniCPM5-1B-MLX |
Quick Start
For the three most common inference paths, you can start a service or run local inference as shown below.
vLLM (OpenAI-compatible service, NVIDIA GPU)
pip install "vllm>=0.21" && vllm serve openbmb/MiniCPM5-1B --port 8000
Test request:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "openbmb/MiniCPM5-1B",
"messages": [{"role": "user", "content": "你是谁?可以简单介绍一下自己吗?"}],
"max_tokens": 128,
"temperature": 0.7
}'
SGLang (OpenAI-compatible service, NVIDIA GPU)
pip install "sglang[srt]>=0.5.12" && python -m sglang.launch_server --model-path openbmb/MiniCPM5-1B --port 30000
Test request:
curl http://localhost:30000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "openbmb/MiniCPM5-1B",
"messages": [{"role": "user", "content": "你是谁?可以简单介绍一下自己吗?"}],
"max_tokens": 128,
"temperature": 0.7
}'
Transformers (local Python inference, CPU or GPU)
pip install -U "transformers>=5.6" accelerate torch
Local inference test:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "openbmb/MiniCPM5-1B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "你是谁?可以简单介绍一下自己吗?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
enable_thinking=False,
return_tensors="pt",
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
Recommended chat template sampling parameters:
| Mode | Recommended sampling parameters | How to enable |
|---|---|---|
| Think | temperature=0.9, top_p=0.95 | enable_thinking=True |
| No Think | temperature=0.7, top_p=0.95 | enable_thinking=False |
For the other backends (llama.cpp / Ollama / LM Studio / MLX), see the cookbook table.
Tool Calling (Function Call)
SGLang is recommended for tool calling: MiniCPM5-1B emits tool calls in XML format, and SGLang's built-in minicpm5 parser automatically converts them into the OpenAI-compatible tool_calls field.
python -m sglang.launch_server --model-path openbmb/MiniCPM5-1B --port 30000 \
--tool-call-parser minicpm5 # or: --tool-call-parser auto
Related Resources
| Topic | Link |
|---|---|
| Deployment | MiniCPM5-1B deployment guide |
| Fine-tuning | MiniCPM5-1B fine-tuning guide |
| Code repository | OpenBMB/MiniCPM |
| Agent Skills | Deployment and fine-tuning skills |