Instructions to use openbmb/MiniCPM-V-4.7-1B-DSpark with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-V-4.7-1B-DSpark with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM-V-4.7-1B-DSpark")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("openbmb/MiniCPM-V-4.7-1B-DSpark") model = AutoModel.from_pretrained("openbmb/MiniCPM-V-4.7-1B-DSpark", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM-V-4.7-1B-DSpark with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM-V-4.7-1B-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/MiniCPM-V-4.7-1B-DSpark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/openbmb/MiniCPM-V-4.7-1B-DSpark
- SGLang
How to use openbmb/MiniCPM-V-4.7-1B-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/MiniCPM-V-4.7-1B-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/MiniCPM-V-4.7-1B-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/MiniCPM-V-4.7-1B-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/MiniCPM-V-4.7-1B-DSpark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use openbmb/MiniCPM-V-4.7-1B-DSpark with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-V-4.7-1B-DSpark
MiniCPM-V-4.7-1B-DSpark
MiniCPM-V-4.7-1B-DSpark is a DSpark draft checkpoint trained for exact pairing with MiniCPM-V-4.7-1B and its tokenizer.
The llama.cpp version please see: MiniCPM-V-4.7-1B-DSpark-gguf
Model Specification
| Property | Value |
|---|---|
| Target model | MiniCPM-V-4.7-1B |
| Draft layers | 5 |
| Draft parameters | 213,547,777 |
| Draft tokens per forward pass | 15 |
| Target hidden-state layers | [3, 7, 11, 15, 19] |
| Checkpoint precision | BF16 |
Training Recipe
Training responses were generated by MiniCPM-V-4.7-1B from a mixture of Vision & Text prompts.
| Setting | Value |
|---|---|
| Training sequences | 2M |
| Epochs | 6 |
| Optimizer | AdamW |
| Objective | CE + L1 + confidence loss |
Evaluation
Acceptance length is defined as the total number of completion tokens divided by the total number of speculative verification steps. Evaluation uses natural EOS termination and max_new_tokens=8192.
| Domain | Accept Length |
|---|---|
| Vision | |
| MMMU | 3.452 |
| MathVista | 4.333 |
| CharXiv_reasoning_val | 4.452 |
| OCRBench | 4.752 |
| Text | |
| Math | 5.891 |
| Code | 5.347 |
| General | 3.370 |
Usage with vLLM
vllm serve \
--model openbmb/MiniCPM-V-4.7-1B \
--served-model-name MiniCPM-V-4.7-1B \
--max-model-len 40960 \
--max-num-batched-tokens 40960 \
--max-num-seqs 1 \
--attention-backend FLASH_ATTN \
--mm-encoder-attn-backend FLASH_ATTN \
--mm-processor-kwargs '{"downsample_mode":"4x"}' \
--trust-request-mm-kwargs \
--speculative-config '{"method":"dspark","model":"openbmb/MiniCPM-V-4.7-1B-DSpark","num_speculative_tokens":15,"enable_adaptive_verification":false}' \
--default-chat-template-kwargs '{"enable_thinking":false}' \
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.
- Downloads last month
- 8,241