Image-Text-to-Text
Transformers
Safetensors
minicpmv4_7
minicpm-v
multimodal
On-Device Model
lightweight
conversational
Instructions to use openbmb/MiniCPM-V-4.7-1B 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 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.7-1B") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("openbmb/MiniCPM-V-4.7-1B") model = AutoModelForMultimodalLM.from_pretrained("openbmb/MiniCPM-V-4.7-1B", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM-V-4.7-1B 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" # 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.7-1B", "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.7-1B
- SGLang
How to use openbmb/MiniCPM-V-4.7-1B 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" \ --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.7-1B", "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.7-1B" \ --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.7-1B", "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.7-1B with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-V-4.7-1B
Commit History
3 days ago
-
Add the MiniCPM-OCR open-source news at the top of the model card
Verified signaturead9bf37 -
Delete folder minicpm_v4dot7_assets with huggingface_hub
Verified signature7bc45e3 -
chore: drop unused asset LFS rules
Verified signatureae76b0e
7 days ago
-
update readme
Verified signaturebb99eab
14 days ago
-
Update tokenizer_config.json
Verified signature379f120 -
fix: set enable_thinking as false
Verified signatured2d0264
18 days ago
-
Update README.md
Verified signature286817f
19 days ago
-
docs: restore GitHub/SRFT/Qwen3.5 links
Verified signatureb0918c7 -
Update README.md
Verified signaturecd360e7 -
docs: add OpenVINO notebook link
Verified signature3cf5933 -
docs: inline sampling parameters in generate examples
Verified signature916a412 -
docs: add recommended sampling parameters
Verified signature115fa01
20 days ago
-
update figure
Verified signature6fde9ec -
Update README.md (#1)
- Update README.md (b0901edda8d7fbadb8b9d1042a05af2615ecd221) Co-authored-by: LuMingcong <lmc8133@users.noreply.huggingface.co>ef3ab3b -
Update README.md (#2)
- Update README.md (7ca37308a1a197fd50a00e2064fc5d3d1e8a97a2) Co-authored-by: LuMingcong <lmc8133@users.noreply.huggingface.co>d18440d
21 days ago
-
add get started
Verified signature984a89a -
add get started
Verified signature7075777 -
add get started
Verified signatured67df58 -
absolute asset urls
Verified signature1ee2633 -
add metadata
Verified signature8c2af35 -
update links
Verified signaturefcd197c -
update model card
Verified signature76bf512 -
add model card
Verified signature39b8f6d
25 days ago
-
init
Verified signature478b3f8 -
init
Verified signature2ed38d8 -
init
Verified signaturef9233a2 -
init
Verified signature993d0ea -
init
Verified signatured256321
27 days ago
-
init
Verified signature540fac8 -
initial commit
Verified signature5a7dc0a