Instructions to use openbmb/MiniCPM4.1-8B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM4.1-8B-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM4.1-8B-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/MiniCPM4.1-8B-GGUF", dtype="auto") - llama-cpp-python
How to use openbmb/MiniCPM4.1-8B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="openbmb/MiniCPM4.1-8B-GGUF", filename="MiniCPM4.1-8B-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use openbmb/MiniCPM4.1-8B-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf openbmb/MiniCPM4.1-8B-GGUF: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 openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf openbmb/MiniCPM4.1-8B-GGUF: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 openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use openbmb/MiniCPM4.1-8B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM4.1-8B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM4.1-8B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M
- SGLang
How to use openbmb/MiniCPM4.1-8B-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "openbmb/MiniCPM4.1-8B-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM4.1-8B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "openbmb/MiniCPM4.1-8B-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM4.1-8B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use openbmb/MiniCPM4.1-8B-GGUF with Ollama:
ollama run hf.co/openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M
- Unsloth Studio
How to use openbmb/MiniCPM4.1-8B-GGUF 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 openbmb/MiniCPM4.1-8B-GGUF 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 openbmb/MiniCPM4.1-8B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for openbmb/MiniCPM4.1-8B-GGUF to start chatting
- Docker Model Runner
How to use openbmb/MiniCPM4.1-8B-GGUF with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M
- Lemonade
How to use openbmb/MiniCPM4.1-8B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.MiniCPM4.1-8B-GGUF-Q4_K_M
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M# Run inference directly in the terminal:
llama-cli -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_MUse 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 openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M# Run inference directly in the terminal:
./llama-cli -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_MBuild 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 openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M# Run inference directly in the terminal:
./build/bin/llama-cli -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_MUse Docker
docker model run hf.co/openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M
GitHub Repo | Technical Report | Join Us
👋 Contact us in Discord and WeChat
What's New
- [2025.09.05] MiniCPM4.1 series are released! This series is a hybrid reasoning model, which can be used in both deep reasoning mode and non-reasoning mode. 🔥🔥🔥
- [2025.06.06] MiniCPM4 series are released! This model achieves ultimate efficiency improvements while maintaining optimal performance at the same scale! It can achieve over 5x generation acceleration on typical end-side chips! You can find technical report here.🔥🔥🔥
MiniCPM4 and MiniCPM4.1 Series
MiniCPM4 and MiniCPM4.1 series are highly efficient large language models (LLMs) designed explicitly for end-side devices, which achieves this efficiency through systematic innovation in four key dimensions: model architecture, training data, training algorithms, and inference systems.
- MiniCPM4.1-8B: The latest version of MiniCPM4, with 8B parameters, support fusion thinking.
- MiniCPM4.1-8B-GPTQ: MiniCPM4.1-8B in GPTQ format.
- MiniCPM4.1-8B-AutoAWQ: MiniCPM4.1-8B in AutoAWQ format.
- MiniCPM-4.1-8B-Marlin: MiniCPM4.1-8B in Marlin format.
- MiniCPM4.1-8B-GGUF: MiniCPM4.1-8B in GGUF format. (<-- you are here)
- MiniCPM4.1-8B-MLX: MiniCPM4.1-8B in MLX format.
- MiniCPM4.1-8B-Eagle3: Eagle3 model for MiniCPM4.1-8B.
- MiniCPM4 Series
Click to expand all MiniCPM4 series models
- MiniCPM4-8B: The flagship model with 8B parameters, trained on 8T tokens
- MiniCPM4-0.5B: Lightweight version with 0.5B parameters, trained on 1T tokens
- MiniCPM4-8B-Eagle-FRSpec: Eagle head for FRSpec, accelerating speculative inference
- MiniCPM4-8B-Eagle-FRSpec-QAT-cpmcu: Eagle head with QAT for FRSpec, integrating speculation and quantization for ultra acceleration
- MiniCPM4-8B-Eagle-vLLM: Eagle head in vLLM format for speculative inference
- MiniCPM4-8B-marlin-Eagle-vLLM: Quantized Eagle head for vLLM format
- BitCPM4-0.5B: Extreme ternary quantization of MiniCPM4-0.5B, achieving 90% bit width reduction
- BitCPM4-1B: Extreme ternary quantization of MiniCPM3-1B, achieving 90% bit width reduction
- MiniCPM4-Survey: Generates trustworthy, long-form survey papers from user queries
- MiniCPM4-MCP: Integrates MCP tools to autonomously satisfy user requirements
Introduction
MiniCPM4 and MiniCPM4.1 are extremely efficient edge-side large model that has undergone efficient optimization across four dimensions: model architecture, learning algorithms, training data, and inference systems, achieving ultimate efficiency improvements.
🏗️ Efficient Model Architecture:
- InfLLM v2 -- Trainable Sparse Attention Mechanism: Adopts a trainable sparse attention mechanism architecture where each token only needs to compute relevance with less than 5% of tokens in 128K long text processing, significantly reducing computational overhead for long texts
🧠 Efficient Learning Algorithms:
- Model Wind Tunnel 2.0 -- Efficient Predictable Scaling: Introduces scaling prediction methods for performance of downstream tasks, enabling more precise model training configuration search
- BitCPM -- Ultimate Ternary Quantization: Compresses model parameter bit-width to 3 values, achieving 90% extreme model bit-width reduction
- Efficient Training Engineering Optimization: Adopts FP8 low-precision computing technology combined with Multi-token Prediction training strategy
📚 High-Quality Training Data:
- UltraClean -- High-quality Pre-training Data Filtering and Generation: Builds iterative data cleaning strategies based on efficient data verification, open-sourcing high-quality Chinese and English pre-training dataset UltraFinweb
- UltraChat v2 -- High-quality Supervised Fine-tuning Data Generation: Constructs large-scale high-quality supervised fine-tuning datasets covering multiple dimensions including knowledge-intensive data, reasoning-intensive data, instruction-following data, long text understanding data, and tool calling data
⚡ Efficient Inference System:
- CPM.cu -- Lightweight and Efficient CUDA Inference Framework: Integrates sparse attention, model quantization, and speculative sampling to achieve efficient prefilling and decoding
- ArkInfer -- Cross-platform Deployment System: Supports efficient deployment across multiple backend environments, providing flexible cross-platform adaptation capabilities
Usage
Inference with llama.cpp
# case 1: main-cli
./build/bin/llama-cli -m MiniCPM4.1-8B-Q4_K_M.gguf -p "北京有什么好玩的地方?" -n 1500
# case 2: server
## launch server
./build/bin/llama-server -m MiniCPM4.1-8B-Q4_K_M.gguf --host 127.0.0.1 --port 8080 -c 4096 -fa on &
## send request
curl -X POST http://127.0.0.1:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "北京有什么好玩的地方?"}],
"max_tokens": 1500
}'
- Downloads last month
- 258
4-bit
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M# Run inference directly in the terminal: llama-cli -hf openbmb/MiniCPM4.1-8B-GGUF:Q4_K_M