Text Generation
Transformers
Safetensors
English
Chinese
qwen3
minicpm
minicpm5
llama
long-context
tool-calling
on-device
edge-ai
custom_code
text-generation-inference
Instructions to use openbmb/MiniCPM5-2B-DSpark with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM5-2B-DSpark with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM5-2B-DSpark", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("openbmb/MiniCPM5-2B-DSpark", trust_remote_code=True) model = AutoModel.from_pretrained("openbmb/MiniCPM5-2B-DSpark", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM5-2B-DSpark with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM5-2B-DSpark" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM5-2B-DSpark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/openbmb/MiniCPM5-2B-DSpark
- SGLang
How to use openbmb/MiniCPM5-2B-DSpark 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/MiniCPM5-2B-DSpark" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM5-2B-DSpark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/MiniCPM5-2B-DSpark" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/MiniCPM5-2B-DSpark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use openbmb/MiniCPM5-2B-DSpark with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM5-2B-DSpark
Update README.md
Browse files
README.md
CHANGED
|
@@ -95,3 +95,28 @@ python -m sglang.launch_server \
|
|
| 95 |
--speculative-draft-model-path <draft-model-path> \
|
| 96 |
--speculative-dspark-block-size 7
|
| 97 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
--speculative-draft-model-path <draft-model-path> \
|
| 96 |
--speculative-dspark-block-size 7
|
| 97 |
```
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
## Limitations and Disclaimer
|
| 101 |
+
|
| 102 |
+
This model has no autonomous intent or legal personhood; its outputs are text generated from statistical patterns and may be inaccurate, biased, or offensive, and may be manipulated by carefully crafted prompts ("jailbreaks") into producing unintended content. Its responses on sensitive topics such as politics, health, finance, and law are not reviewed by experts and should not be treated as professional advice.
|
| 103 |
+
|
| 104 |
+
This model is provided "**AS IS**", without warranty of any kind, express or implied, and the developers are not liable for any damages arising from its use. Users must employ the model only for lawful, compliant, and ethical purposes, configure their own safeguards, and label AI-generated content where required; deliberate jailbreaking, injection attacks, or inducing harmful output is prohibited, and any such testing is at the user's own risk.
|
| 105 |
+
|
| 106 |
+
## License
|
| 107 |
+
|
| 108 |
+
This repository and MiniCPM model weights are released under the [Apache-2.0](https://github.com/OpenBMB/MiniCPM/blob/main/LICENSE) License.
|
| 109 |
+
|
| 110 |
+
## Citation
|
| 111 |
+
|
| 112 |
+
Please cite our paper if you find our work valuable:
|
| 113 |
+
|
| 114 |
+
```bibtex
|
| 115 |
+
@article{minicpm4,
|
| 116 |
+
title={Minicpm4: Ultra-efficient llms on end devices},
|
| 117 |
+
author={MiniCPM, Team},
|
| 118 |
+
journal={arXiv preprint arXiv:2506.07900},
|
| 119 |
+
year={2025}
|
| 120 |
+
}
|
| 121 |
+
```
|
| 122 |
+
|