Instructions to use openbmb/MiniCPM4-8B-Eagle-FRSpec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM4-8B-Eagle-FRSpec with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM4-8B-Eagle-FRSpec", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM4-8B-Eagle-FRSpec", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM4-8B-Eagle-FRSpec with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM4-8B-Eagle-FRSpec" # 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-8B-Eagle-FRSpec", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM4-8B-Eagle-FRSpec
- SGLang
How to use openbmb/MiniCPM4-8B-Eagle-FRSpec 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-8B-Eagle-FRSpec" \ --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-8B-Eagle-FRSpec", "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-8B-Eagle-FRSpec" \ --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-8B-Eagle-FRSpec", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM4-8B-Eagle-FRSpec with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM4-8B-Eagle-FRSpec
update README.md
Browse files
README.md
CHANGED
|
@@ -12,15 +12,14 @@ library_name: transformers
|
|
| 12 |
|
| 13 |
<p align="center">
|
| 14 |
<a href="https://github.com/OpenBMB/MiniCPM/" target="_blank">GitHub Repo</a> |
|
| 15 |
-
<a href="
|
| 16 |
</p>
|
| 17 |
<p align="center">
|
| 18 |
π Join us on <a href="https://discord.gg/3cGQn9b3YM" target="_blank">Discord</a> and <a href="https://github.com/OpenBMB/MiniCPM/blob/main/assets/wechat.jpg" target="_blank">WeChat</a>
|
| 19 |
</p>
|
| 20 |
|
| 21 |
## What's New
|
| 22 |
-
- [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
|
| 23 |
-
|
| 24 |
|
| 25 |
## MiniCPM4 Series
|
| 26 |
MiniCPM4 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.
|
|
@@ -31,7 +30,32 @@ MiniCPM4 series are highly efficient large language models (LLMs) designed expli
|
|
| 31 |
- [BitCPM4-0.5B](https://huggingface.co/openbmb/BitCPM4-0.5B): Extreme ternary quantization applied to MiniCPM4-0.5B compresses model parameters into ternary values, achieving a 90% reduction in bit width.
|
| 32 |
- [BitCPM4-1B](https://huggingface.co/openbmb/BitCPM4-1B): Extreme ternary quantization applied to MiniCPM3-1B compresses model parameters into ternary values, achieving a 90% reduction in bit width.
|
| 33 |
- [MiniCPM4-Survey](https://huggingface.co/openbmb/MiniCPM4-Survey): Based on MiniCPM4-8B, accepts users' quiries as input and autonomously generate trustworthy, long-form survey papers.
|
| 34 |
-
- [MiniCPM4-MCP](https://huggingface.co/openbmb/MiniCPM4-MCP): Based on MiniCPM4-8B, accepts users' queries and available MCP tools as input and autonomously calls relevant MCP tools to satisfy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## Statement
|
| 37 |
- As a language model, MiniCPM generates content by learning from a vast amount of text.
|
|
@@ -40,14 +64,15 @@ MiniCPM4 series are highly efficient large language models (LLMs) designed expli
|
|
| 40 |
- Therefore, when using content generated by MiniCPM, users should take full responsibility for evaluating and verifying it on their own.
|
| 41 |
|
| 42 |
## LICENSE
|
| 43 |
-
- This repository
|
| 44 |
-
- The usage of MiniCPM model weights must strictly follow [MiniCPM Model License](https://github.com/OpenBMB/MiniCPM/blob/main/MiniCPM%20Model%20License.md).
|
| 45 |
-
- The models and weights of MiniCPM are completely free for academic research. after filling out a [questionnaire](https://modelbest.feishu.cn/share/base/form/shrcnpV5ZT9EJ6xYjh3Kx0J6v8g) for registration, are also available for free commercial use.
|
| 46 |
|
| 47 |
## Citation
|
| 48 |
-
|
| 49 |
-
- Please cite our [paper](TODO) if you find our work valuable.
|
| 50 |
|
| 51 |
```bibtex
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
```
|
|
|
|
| 12 |
|
| 13 |
<p align="center">
|
| 14 |
<a href="https://github.com/OpenBMB/MiniCPM/" target="_blank">GitHub Repo</a> |
|
| 15 |
+
<a href="https://github.com/OpenBMB/MiniCPM/tree/main/report/MiniCPM_4_Technical_Report.pdf" target="_blank">Technical Report</a>
|
| 16 |
</p>
|
| 17 |
<p align="center">
|
| 18 |
π Join us on <a href="https://discord.gg/3cGQn9b3YM" target="_blank">Discord</a> and <a href="https://github.com/OpenBMB/MiniCPM/blob/main/assets/wechat.jpg" target="_blank">WeChat</a>
|
| 19 |
</p>
|
| 20 |
|
| 21 |
## What's New
|
| 22 |
+
- [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](https://github.com/OpenBMB/MiniCPM/tree/main/report/MiniCPM_4_Technical_Report.pdf).π₯π₯π₯
|
|
|
|
| 23 |
|
| 24 |
## MiniCPM4 Series
|
| 25 |
MiniCPM4 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.
|
|
|
|
| 30 |
- [BitCPM4-0.5B](https://huggingface.co/openbmb/BitCPM4-0.5B): Extreme ternary quantization applied to MiniCPM4-0.5B compresses model parameters into ternary values, achieving a 90% reduction in bit width.
|
| 31 |
- [BitCPM4-1B](https://huggingface.co/openbmb/BitCPM4-1B): Extreme ternary quantization applied to MiniCPM3-1B compresses model parameters into ternary values, achieving a 90% reduction in bit width.
|
| 32 |
- [MiniCPM4-Survey](https://huggingface.co/openbmb/MiniCPM4-Survey): Based on MiniCPM4-8B, accepts users' quiries as input and autonomously generate trustworthy, long-form survey papers.
|
| 33 |
+
- [MiniCPM4-MCP](https://huggingface.co/openbmb/MiniCPM4-MCP): Based on MiniCPM4-8B, accepts users' queries and available MCP tools as input and autonomously calls relevant MCP tools to satisfy users' requirements.
|
| 34 |
+
|
| 35 |
+
## Introduction
|
| 36 |
+
MiniCPM4-8B-Eagle-FRSpec is a Eagle model trained with MiniCPM4-8B. It clould be apply on our inference framework [cpm.cu](https://github.com/xxx) with FRSpec, accelerating the generation speed by 7 times compared to Qwen3-8B.
|
| 37 |
+
|
| 38 |
+
## Usage
|
| 39 |
+
### Inference with cpm.cu
|
| 40 |
+
```
|
| 41 |
+
# case 1: verify model is fp16 or bf16
|
| 42 |
+
cd cpm.cu/tests
|
| 43 |
+
python3 test_generate.py \
|
| 44 |
+
--no-apply-quant \
|
| 45 |
+
--no-apply-eagle-quant
|
| 46 |
+
|
| 47 |
+
# case 2: verify model is quanted with Marlin (W4A16, group size = 128)
|
| 48 |
+
cd cpm.cu/tests
|
| 49 |
+
python3 test_generate.py \
|
| 50 |
+
--apply-quant \
|
| 51 |
+
--no-apply-eagle-quant
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
## Evaluation
|
| 55 |
+
|
| 56 |
+
Tested on two representative edge devices, the Jetson AGX Orin and RTX 4090, MiniCPM4 with MiniCPM4-8B-Eagle-FRSpec demonstrates significantly superior processing speed over models of comparable size for long-text processing tasks. Its performance advantage becomes increasingly pronounced as the text length increases. On the Jetson AGX Orin platform, MiniCPM4 achieves approximately a 7x improvement in generation speed compared to Qwen3-8B.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
|
| 60 |
## Statement
|
| 61 |
- As a language model, MiniCPM generates content by learning from a vast amount of text.
|
|
|
|
| 64 |
- Therefore, when using content generated by MiniCPM, users should take full responsibility for evaluating and verifying it on their own.
|
| 65 |
|
| 66 |
## LICENSE
|
| 67 |
+
- This repository and MiniCPM models are released under the [Apache-2.0](https://github.com/OpenBMB/MiniCPM/blob/main/LICENSE) License.
|
|
|
|
|
|
|
| 68 |
|
| 69 |
## Citation
|
| 70 |
+
- Please cite our [paper](https://github.com/OpenBMB/MiniCPM/tree/main/report/MiniCPM_4_Technical_Report.pdf) if you find our work valuable.
|
|
|
|
| 71 |
|
| 72 |
```bibtex
|
| 73 |
+
@article{minicpm4,
|
| 74 |
+
title={{MiniCPM4}: Ultra-Efficient LLMs on End Devices},
|
| 75 |
+
author={MiniCPM Team},
|
| 76 |
+
year={2025}
|
| 77 |
+
}
|
| 78 |
```
|