Run this model with HF Jobs
Run openbmb/MiniCPM5-15B-A2.5B-DSpark on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/openbmb/MiniCPM5-15B-A2.5B-DSpark. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/openbmb/MiniCPM5-15B-A2.5B-DSpark on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/openbmb/MiniCPM5-15B-A2.5B-DSpark. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/openbmb/MiniCPM5-15B-A2.5B-DSpark. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use openbmb/MiniCPM5-15B-A2.5B-DSpark with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM5-15B-A2.5B-DSpark with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM5-15B-A2.5B-DSpark", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("openbmb/MiniCPM5-15B-A2.5B-DSpark", trust_remote_code=True) model = AutoModel.from_pretrained("openbmb/MiniCPM5-15B-A2.5B-DSpark", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM5-15B-A2.5B-DSpark with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM5-15B-A2.5B-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-15B-A2.5B-DSpark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/openbmb/MiniCPM5-15B-A2.5B-DSpark
- SGLang
How to use openbmb/MiniCPM5-15B-A2.5B-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-15B-A2.5B-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-15B-A2.5B-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-15B-A2.5B-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-15B-A2.5B-DSpark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use openbmb/MiniCPM5-15B-A2.5B-DSpark with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM5-15B-A2.5B-DSpark
MiniCPM Tech Report | MiniCPM Wiki(Chinese) | GitHub Repo | UltraData | Online Demo
English | 中文
MiniCPM5-15B-A2.5B-DSpark
MiniCPM5-15B-A2.5B-DSpark is a speculative decoding draft model for MiniCPM5-15B-A2.5B. Following DeepSeek's DSpark architecture, it shares the target model's tokenizer and accelerates autoregressive decoding without altering the output distribution. GGUF weights are available at MiniCPM5-15B-A2.5B-DSpark-GGUF.
Model Specification
| Property | Value |
|---|---|
| Target model | MiniCPM5-15B-A2.5B |
| Draft layers | 5 |
| Draft parameters | ~0.43B (excluding shared token embeddings and LM head) |
| Draft tokens per forward pass | 7 |
| Target hidden-state layers | [1, 7, 13, 19, 25] |
| Checkpoint precision | BF16 |
Training Recipe
We curate roughly 2M instruction prompts from open-source dialogue corpora such as Open-PerfectBlend and internal mathematics and code datasets. For each prompt, we sample target-model completions (temperature=1.0, top_p=0.95) in both thinking and non-thinking modes, for a total of ~4M training examples. The draft model shares the target model's frozen token embeddings and LM head, and is supervised jointly on its intermediate hidden states and output distributions.
| Hyperparameter | Value |
|---|---|
| Training examples | ~4.0M (2.0M thinking, 2.0M non-thinking) |
| Training tokens | ~10.4B |
| Epochs | 10 |
| Max sequence length | 8,192 |
| Optimizer | AdamW |
| Loss objective | CE + L1 + confidence loss |
Evaluation
The table below reports mean acceptance length, defined as total generated tokens divided by speculative verification steps. Decoding runs until natural EOS termination, with max_new_tokens capped at 4,096 in thinking mode and 2,048 in non-thinking mode.
| Domain | Thinking (T=0) |
Thinking (T=1.0) |
Non-thinking (T=0) |
Non-thinking (T=1.0) |
|---|---|---|---|---|
| Math | 4.98 | 4.38 | 5.77 | 5.32 |
| Code | 4.41 | 3.76 | 4.66 | 3.96 |
| General | 3.67 | 2.97 | 2.89 | 2.59 |
| Aggregate | 4.12 | 3.46 | 3.82 | 3.40 |
Deployment
SGLang
python -m sglang.launch_server \
--model-path openbmb/MiniCPM5-15B-A2.5B \
--served-model-name MiniCPM5-15B-A2.5B \
--port 8000 \
--speculative-algorithm DSPARK \
--speculative-draft-model-path openbmb/MiniCPM5-15B-A2.5B-DSpark \
--speculative-dspark-block-size 7
vLLM
vllm serve openbmb/MiniCPM5-15B-A2.5B \
--served-model-name MiniCPM5-15B-A2.5B \
--port 8000 \
--speculative-config '{"method":"dspark","model":"openbmb/MiniCPM5-15B-A2.5B-DSpark","num_speculative_tokens":7}'
Limitations and Disclaimer
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.
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.
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
- 3