Image-Text-to-Text
Transformers
Safetensors
multilingual
minicpmv
feature-extraction
minicpm-v
vision
ocr
multi-image
video
custom_code
conversational
Eval Results
Instructions to use openbmb/MiniCPM-V-4_5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-V-4_5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="openbmb/MiniCPM-V-4_5", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/MiniCPM-V-4_5", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM-V-4_5 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_5" # 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/MiniCPM-V-4_5", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM-V-4_5
- SGLang
How to use openbmb/MiniCPM-V-4_5 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_5" \ --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/MiniCPM-V-4_5", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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_5" \ --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/MiniCPM-V-4_5", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use openbmb/MiniCPM-V-4_5 with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-V-4_5
Commit History
5 days ago
-
Remote processor: ignore extra keyword arguments
Verified signatureTransformers 4.40 to 4.52 pass the keys of `processor_config.json`, and 4.49 to 4.52 the chat template, to the remote `MiniCPMVProcessor.__init__`. It now takes `**kwargs` and ignores them, as MiniCPM-V-4's does.c611baa -
Chat template as a processor-only chat_template.json
Verified signatureThe tokenizer also loads a repo-level `chat_template.jinja`, so it replaced the tokenizer's own chat template. `chat_template.json` is read by the processor only, and the tokenizer keeps its template.34c10ba -
Add native Transformers support (config and processor files only)
Verified signatureThis PR adds native Transformers support for MiniCPM-V 4.5, images and video, while keeping the existing remote code working. It goes with https://github.com/huggingface/transformers/pull/51300, which adds the model to Transformers as `minicpmv4_5`, on top of MiniCPM-V 4.0's `minicpmv2_6` (https://github.com/huggingface/transformers/pull/51299; its Hub files are openbmb/MiniCPM-V-4#6, with the same layout). **The weights are not changed.** Transformers maps the original weight names at load time. **It can be merged now:** the remote code keeps loading as before (`trust_remote_code=True`, `auto_map` unchanged), and Transformers versions that include the model load it natively. | File | Change | |---|---| | `config.json` | All original keys kept, incl. `auto_map`. Added: `model_type: "minicpmv4_5"`, `text_config`, `resampler_n_latents`, `resampler_n_heads`, `image_token_id`, `video_token_id`. `vision_config` gets `model_type: "minicpmv4_5_vision"` and the activation and norm epsilon t…0e64a14
22 days ago
-
update docs link
Verified signature14a2004
-
Update README.md
Verified signaturedaef484 -
Update README.md
Verified signature1a043e0
-
Update README.md
Verified signaturefd3209b
-
Update modeling_minicpmv.py
Verified signaturec1a6986
-
Fix data parsing in forward() method (#18)
Verified signature- Fix data parsing in forward() method (482d9ffc5660ee228f84613f759e6cf29e053d3d) Co-authored-by: Jasiek Kostecki <bialykostek@users.noreply.huggingface.co>343b490
-
Update: README.md
Verified signature0e2e644
-
Update: README.md
Verified signatured328a17 -
Update README.md
Verified signature9fa194f
-
Update README.md
Verified signaturea3bb84d -
Update: README.md
Verified signaturea626b89 -
Update README.md
Verified signature76bc8b9 -
Update: license
Verified signatureebb1f6c
-
Update resampler.py
Verified signaturec331656
-
Update: README
Verified signatured7bbb09
-
Update README.md
Verified signaturea18bbd9
-
Update README.md
Verified signaturef5b97f1
-
Update README.md
Verified signature0fe9c69 -
Update README.md
Verified signature0f80664
-
update readme
tc-mbSigned-off-by: tc-mb <caitianchi@modelbest.cn>1fd8118 -
update readme
tc-mbSigned-off-by: tc-mb <caitianchi@modelbest.cn>c87166b -
add cookbook link
tc-mbSigned-off-by: tc-mb <caitianchi@modelbest.cn>54249c4 -
update readme
tc-mbSigned-off-by: tc-mb <caitianchi@modelbest.cn>7fee240 -
Update configuration_minicpm.py
Verified signaturebee21bd
-
Update README.md
Verified signature17353d1 -
Update README.md
Verified signaturec255f57
-
Update README.md
Verified signaturea8dd5db
-
Update README.md
Verified signature37c5181 -
Update README.md
Verified signaturea426d2a -
add multi-image infer usage
wangchongyid272cfd
-
update readme
tc-mbSigned-off-by: tc-mb <caitianchi@modelbest.cn>73cb2e7 -
Update modeling_minicpmv.py (#7)
Verified signature- Update modeling_minicpmv.py (8d2b25a0833fa6e97000f2b987665e4a637e8066) Co-authored-by: Sviatoslav Dovidchenko <dertyu1@users.noreply.huggingface.co>d755459 -
add stream demo
wangchongyi7584097
-
Update README.md
Verified signature11bfb79 -
Update README.md
Verified signature2bed3a2 -
Update resampler.py (#3)
Verified signature- Update resampler.py (cc31e963f29bb5e66f0d399572ba0650e7fc92d4) Co-authored-by: ed <ssdsdfsdf@users.noreply.huggingface.co>dacabb6
-
Update README.md
Verified signature52e6b29 -
Update README.md
Verified signature6d2099c -
Update README.md
Verified signature37edc54 -
Update README.md
Verified signature100c576
-
Initial commit: MiniCPM-V-4_5 model
tc-mb2e3dbac -
Initial commit: MiniCPM-V-4_5 model
tc-mbc13aabe -
Update README.md
Verified signature3acc1cf -
Update README.md
Verified signature61961f9 -
Initial commit: MiniCPM-V-4_5 model
tc-mbea73194 -
Initial commit: MiniCPM-V-4_5 model
tc-mb3bbd798 -
add readme
tc-mbbf6f912