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)# pip install -U transformers accelerate # 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
What is the difference between T0 and T1, and why is there such a large discrepancy in acceptance rate?
In Evaluation, what is the difference between T=0 and T=1, and why is there such a large discrepancy in acceptance rate?
T denotes the sampling temperature. T=0 uses greedy decoding; T=1.0 uses sampling at temperature 1.0. Both use the same draft checkpoint and preserve the target's output distribution under the respective decoding settings.
Under rejection sampling, expected per-token acceptance is:
where p and q are the target and draft distributions. This measures their overlapping probability mass: greater overlap means higher acceptance.
At T=0, all probability mass is concentrated on the top token, so the distributions overlap completely whenever their top choices agree. T=1.0 retains the sampling entropy, with multiple candidates carrying non-negligible probability mass. Even when the models prefer the same token, they can assign different probabilities to the candidates. Rejection sampling corrects these differences by rejecting some proposals, so the same draft can achieve strong greedy agreement yet substantially lower acceptance under sampling.