Instructions to use koshuro/MiniCPM5-1B-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use koshuro/MiniCPM5-1B-heretic with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M # Run inference directly in the terminal: llama cli -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M # Run inference directly in the terminal: llama cli -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M
Use Docker
docker model run hf.co/koshuro/MiniCPM5-1B-heretic:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use koshuro/MiniCPM5-1B-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "koshuro/MiniCPM5-1B-heretic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "koshuro/MiniCPM5-1B-heretic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/koshuro/MiniCPM5-1B-heretic:Q4_K_M
- Ollama
How to use koshuro/MiniCPM5-1B-heretic with Ollama:
ollama run hf.co/koshuro/MiniCPM5-1B-heretic:Q4_K_M
- Unsloth Studio
How to use koshuro/MiniCPM5-1B-heretic with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for koshuro/MiniCPM5-1B-heretic to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for koshuro/MiniCPM5-1B-heretic to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for koshuro/MiniCPM5-1B-heretic to start chatting
- Pi
How to use koshuro/MiniCPM5-1B-heretic with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "koshuro/MiniCPM5-1B-heretic:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use koshuro/MiniCPM5-1B-heretic with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "koshuro/MiniCPM5-1B-heretic:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use koshuro/MiniCPM5-1B-heretic with Docker Model Runner:
docker model run hf.co/koshuro/MiniCPM5-1B-heretic:Q4_K_M
- Lemonade
How to use koshuro/MiniCPM5-1B-heretic with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull koshuro/MiniCPM5-1B-heretic:Q4_K_M
Run and chat with the model
lemonade run user.MiniCPM5-1B-heretic-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use koshuro/MiniCPM5-1B-heretic with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf koshuro/MiniCPM5-1B-heretic:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default koshuro/MiniCPM5-1B-heretic:Q4_K_M
Run Hermes
hermes
- Atomic Chat
This is a decensored version of openbmb/MiniCPM5-1B, made using Heretic v1.4.0
This model is reproducible!
See the README in the
reproducedirectory for more information.
Abliteration parameters
| Parameter | Value |
|---|---|
| direction_index | 12.35 |
| attn.o_proj.max_weight | 1.30 |
| attn.o_proj.max_weight_position | 16.19 |
| attn.o_proj.min_weight | 1.13 |
| attn.o_proj.min_weight_distance | 13.02 |
| mlp.down_proj.max_weight | 1.46 |
| mlp.down_proj.max_weight_position | 15.35 |
| mlp.down_proj.min_weight | 0.60 |
| mlp.down_proj.min_weight_distance | 8.95 |
Performance
| Metric | This model | Original model (openbmb/MiniCPM5-1B) |
|---|---|---|
| KL divergence | 0.0383 | 0 (by definition) |
| Refusals | 3/100 | 95/100 |
Available Model files:
minicpm5-1b-heretic-q4_k_m.ggufminicpm5-1b-heretic-q5_k_m.ggufminicpm5-1b-heretic-q8_0.gguf
MiniCPM Tech Report | GitHub Repo | UltraData | MiniCPM Desk Pet | Online Demo
English | 中文
Highlights
We are releasing MiniCPM5-1B, the first model in the MiniCPM5 series. It is a dense 1B Transformer built for on-device, local deployment, and resource-constrained scenarios, reaching 1B-class open-source SOTA.
🏆 1B-class open-source SOTA: compared with strong open-source models in the same size class, MiniCPM5-1B reaches SOTA within this comparison set. Its advantage is most visible in agentic tool use, code generation, and difficult reasoning.
🧠 Hybrid Reasoning: built-in <think> chat template, switch via enable_thinking. The same checkpoint serves as both a fast assistant and a deliberate reasoner.
🛠️ Deployment / Fine-tuning Resources: the MiniCPM GitHub repo provides single-page cookbooks and Agent Skills for major inference backends and fine-tuning frameworks.
🐱 Desktop Pet: a local-LLM desktop pet driven by MiniCPM5-1B.
Model List
Use this directory to choose the model format that matches your runtime:
- MiniCPM5-1B · ModelScope · BF16 final release (post-trained with RL + OPD) 👈 you are here
- 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
Model Information
MiniCPM5-1B has the following features:
- Type: Causal Language Model
- Architecture: Standard
LlamaForCausalLM - Number of Parameters: 1,080,632,832
- Number of Non-Embedding Parameters: 679,552,512
- Number of Layers: 24
- Number of Attention Heads (GQA): 16 for Q and 2 for KV
- Context Length: 131,072
Introduction
MiniCPM5-1B is the first checkpoint 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 and both Think / No Think chat modes through the same checkpoint.
Evaluation Results
We compare MiniCPM5-1B with strong open-source models in the same size class, including LFM2.5-1.2B-Thinking, Qwen3-0.6B/think and Qwen3.5-0.8B/think. These are capable baselines; within this comparison set, MiniCPM5-1B reaches 1B-class open-source SOTA, with its advantage most visible in tool use, code generation, and difficult reasoning. This makes it a practical choice for local coding agents, tool assistants, and reasoning assistants.
Training Recipe
The training of MiniCPM5-1B is a full-stack practice of UltraData Tiered Data Management, covering three stages: base training, mid-training, and post-training.
During base training, the model goes through stable training and decay training to build core language capability and training stability. It then enters mid-training to further strengthen target capabilities and adapt to the target data distribution. The training corpus is released alongside the model as Ultra-FineWeb, Ultra-FineWeb-L3, and UltraData-Math.
During post-training, we proceed in three steps: SFT, RL, and OPD. We first use 200B tokens of deep-thinking SFT and 200B tokens of hybrid-thinking SFT to establish deep-thinking, hybrid-thinking, and general chat abilities; the SFT data is released as UltraData-SFT-2605. We then train specialized RL teachers for math, code, closed-book QA, writing, and related domains, and use On-Policy Distillation (OPD) to distill these teachers back into one release model.
What does RL + OPD bring?
RL + OPD is a key part of MiniCPM5-1B post-training. On math, code and instruction-following tasks, RL + OPD raises the average score by ↑16 points while cutting the share of responses that hit the max-tokens budget by ↓29 percentage points. The figures below show the two-stage Reasoning RL pipeline, score gains, and the drop in overlong responses.
RL combines complementary training signals for reasoning, closed-book QA, writing, instruction following, long-context understanding, and general dialogue. Reasoning RL is based on DAPO-Math-17k (inspired by JustRL's minimalist recipe) and uses a two-stage length schedule to reduce overlong responses while improving reasoning accuracy. We also use TriviaQA, NQ-Open, LongWriter-Zero-RLData, synthesized verifiable RLVR data, and pair-wise RLHF signals to improve reliability, instruction following, and user experience.
OPD builds on Thinking Machines Lab's On-Policy Distillation and incorporates implementation improvements from Rethinking On-Policy Distillation. In the RL framework, we use reverse KL divergence as the advantage estimate, replacing the original verification-based advantage. At each response position, we take top-k logits from both the student and teacher models, compute reverse KL on the union of the two token sets, and balance the accuracy of the RKL signal with training efficiency. OPD reuses the in-domain prompts used to train each RL teacher as distillation data, so no additional data curation is required.
Tool Calling
For tool / function calling, SGLang is the recommended backend. MiniCPM5-1B emits XML-style tool calls and SGLang's built-in minicpm5 parser converts them to OpenAI-compatible tool_calls natively:
python -m sglang.launch_server --model-path koshuro/MiniCPM5-1B-heretic --port 30000 \
--tool-call-parser minicpm5 # or: --tool-call-parser auto
GitHub Cookbooks and Agent Skills
MiniCPM5-1B uses the standard LlamaForCausalLM architecture, 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.
Deployment
| Backend | Model format / use case | Cookbook | Agent Skill |
|---|---|---|---|
| Transformers | BF16 / FP16 local Python inference, GPU + CPU | transformers.md | minicpm5-deploy-transformers |
| vLLM | BF16 / FP16 OpenAI server | vllm.md | minicpm5-deploy-vllm |
| SGLang | BF16 / FP16 OpenAI server, recommended for tool calling | sglang.md | minicpm5-deploy-sglang |
| llama.cpp | GGUF local inference, CPU/GPU | llama_cpp.md | minicpm5-deploy-llama-cpp |
| Ollama | GGUF local on-device runtime | ollama.md | minicpm5-deploy-ollama |
| LM Studio | GGUF Mac desktop app and OpenAI server | lmstudio.md | minicpm5-deploy-lmstudio |
| MLX | MLX / 4bit local inference on Apple Silicon | mlx.md | minicpm5-deploy-mlx |
| ArcLight | GGUF local on-device, CPU, Desktop & Server | arclight.md | minicpm5-deploy-arclight |
Limitations and Responsible Use
MiniCPM5-1B is a language model that generates content based on learned statistical patterns from training data. It may produce inaccurate, biased, or unsafe outputs, and generated content should be reviewed and verified before use in high-stakes settings.
Users are responsible for evaluating outputs, applying appropriate safeguards, and complying with applicable laws, regulations, and platform policies.
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
- -





