Instructions to use openbmb/MiniCPM-V-4_5-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-V-4_5-gguf 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-gguf", 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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/MiniCPM-V-4_5-gguf", trust_remote_code=True, dtype="auto") - llama-cpp-python
How to use openbmb/MiniCPM-V-4_5-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="openbmb/MiniCPM-V-4_5-gguf", filename="MiniCPM-V-4_5-F16.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use openbmb/MiniCPM-V-4_5-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
Use Docker
docker model run hf.co/openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use openbmb/MiniCPM-V-4_5-gguf 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-gguf" # 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-gguf", "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-gguf:Q4_K_M
- SGLang
How to use openbmb/MiniCPM-V-4_5-gguf 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-gguf" \ --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-gguf", "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-gguf" \ --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-gguf", "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" } } ] } ] }' - Ollama
How to use openbmb/MiniCPM-V-4_5-gguf with Ollama:
ollama run hf.co/openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
- Unsloth Studio
How to use openbmb/MiniCPM-V-4_5-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for openbmb/MiniCPM-V-4_5-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for openbmb/MiniCPM-V-4_5-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for openbmb/MiniCPM-V-4_5-gguf to start chatting
- Pi
How to use openbmb/MiniCPM-V-4_5-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "openbmb/MiniCPM-V-4_5-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use openbmb/MiniCPM-V-4_5-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use openbmb/MiniCPM-V-4_5-gguf with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
- Lemonade
How to use openbmb/MiniCPM-V-4_5-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull openbmb/MiniCPM-V-4_5-gguf:Q4_K_M
Run and chat with the model
lemonade run user.MiniCPM-V-4_5-gguf-Q4_K_M
List all available models
lemonade list
MiniCPM-V-4_5-Q5_K_M.gguf not running on llama.cpp. gives "GGML_ASSERT(false && "unsupported minicpmv version") failed"
I am running your q5 gguf on the llama-server (build b6271) with the following parameters:
-m "..\models\MiniCPM\MiniCPM-V-4_5-Q5_K_M.gguf" --mmproj "..\models\MiniCPM\mmproj-MiniCPM-V-4_5-f16.gguf"
--image "..\models\hydration_page.png" --threads 8
--ctx-size 10000 --flash-attn
--n-gpu-layers 99 --cache-type-k q8_0
--cache-type-v q8_0 --temp 0.4
--top-p 0.95 --min-p 0.05
--top-k 0 --repeat-penalty 1.1
--seed 3407 `
I am getting the error:
D:\LLMs\llama.cpp\tools\mtmd\mtmd.cpp:223: GGML_ASSERT(false && "unsupported minicpmv version") failed.
We have merged it in llama.cpp, but the merge was not long ago, so you may need to synchronize the latest code.
Thanks. it works after updating llama.cpp.
There's another issue. Its thinking is way too long. is there a way to disable thinking on llama.cpp? I tried adding "/no_think " in the prompt, but it didnt work,
@mku1988
I've received your question and figured out the source of the issue. I'll submit a pull request to llama.cpp this week to fix this.
This likely means llama.cpp doesn't yet have a control for enabling or disabling COT in multimodal mode. I'll contribute this to the community.
Adding "--reasoning-budget 0" to my llama-server launch parameters worked for me to disable thinking.
I’m experiencing the same issue. After starting llama-server with --reasoning-budget 0, it still performs reasoning when asked with complex images. I hope this can be fixed soon. Thanks!
