Text Generation
Transformers
Safetensors
Chinese
English
minicpm
conversational
custom_code
4-bit precision
gptq
Instructions to use openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format" # 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-0.5B-QAT-Int4-GPTQ-format", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format
- SGLang
How to use openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format 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-0.5B-QAT-Int4-GPTQ-format" \ --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-0.5B-QAT-Int4-GPTQ-format", "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-0.5B-QAT-Int4-GPTQ-format" \ --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-0.5B-QAT-Int4-GPTQ-format", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM4-0.5B-QAT-Int4-GPTQ-format
Add link to paper
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,18 +1,20 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- zh
|
| 5 |
- en
|
| 6 |
-
pipeline_tag: text-generation
|
| 7 |
library_name: transformers
|
|
|
|
|
|
|
| 8 |
---
|
|
|
|
| 9 |
<div align="center">
|
| 10 |
<img src="https://github.com/OpenBMB/MiniCPM/blob/main/assets/minicpm_logo.png?raw=true" width="500em" ></img>
|
| 11 |
</div>
|
| 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>
|
|
@@ -141,7 +143,7 @@ print(outputs[0].outputs[0].text)
|
|
| 141 |
- This repository and MiniCPM models are released under the [Apache-2.0](https://github.com/OpenBMB/MiniCPM/blob/main/LICENSE) License.
|
| 142 |
|
| 143 |
## Citation
|
| 144 |
-
- Please cite our [paper](https://
|
| 145 |
|
| 146 |
```bibtex
|
| 147 |
@article{minicpm4,
|
|
@@ -149,4 +151,4 @@ print(outputs[0].outputs[0].text)
|
|
| 149 |
author={MiniCPM Team},
|
| 150 |
year={2025}
|
| 151 |
}
|
| 152 |
-
```
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- zh
|
| 4 |
- en
|
|
|
|
| 5 |
library_name: transformers
|
| 6 |
+
license: apache-2.0
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
---
|
| 9 |
+
|
| 10 |
<div align="center">
|
| 11 |
<img src="https://github.com/OpenBMB/MiniCPM/blob/main/assets/minicpm_logo.png?raw=true" width="500em" ></img>
|
| 12 |
</div>
|
| 13 |
|
| 14 |
<p align="center">
|
| 15 |
<a href="https://github.com/OpenBMB/MiniCPM/" target="_blank">GitHub Repo</a> |
|
| 16 |
+
<a href="https://github.com/OpenBMB/MiniCPM/tree/main/report/MiniCPM_4_Technical_Report.pdf" target="_blank">Technical Report</a> |
|
| 17 |
+
<a href="https://huggingface.co/papers/2506.07900" target="_blank">Paper</a>
|
| 18 |
</p>
|
| 19 |
<p align="center">
|
| 20 |
👋 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>
|
|
|
|
| 143 |
- This repository and MiniCPM models are released under the [Apache-2.0](https://github.com/OpenBMB/MiniCPM/blob/main/LICENSE) License.
|
| 144 |
|
| 145 |
## Citation
|
| 146 |
+
- Please cite our [paper](https://huggingface.co/papers/2506.07900) if you find our work valuable.
|
| 147 |
|
| 148 |
```bibtex
|
| 149 |
@article{minicpm4,
|
|
|
|
| 151 |
author={MiniCPM Team},
|
| 152 |
year={2025}
|
| 153 |
}
|
| 154 |
+
```
|