MiniCPM-V-4.6
Collection
1 item • Updated
How to use llaa33219/MiniCPM-V-4.6-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="llaa33219/MiniCPM-V-4.6-GGUF", filename="MiniCPM-V-4.6-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"
}
}
]
}
]
)How to use llaa33219/MiniCPM-V-4.6-GGUF with llama.cpp:
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
# 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 llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
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 llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
docker model run hf.co/llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
How to use llaa33219/MiniCPM-V-4.6-GGUF with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "llaa33219/MiniCPM-V-4.6-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": "llaa33219/MiniCPM-V-4.6-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"
}
}
]
}
]
}'docker model run hf.co/llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
How to use llaa33219/MiniCPM-V-4.6-GGUF with Ollama:
ollama run hf.co/llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
How to use llaa33219/MiniCPM-V-4.6-GGUF with Unsloth Studio:
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 llaa33219/MiniCPM-V-4.6-GGUF to start chatting
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 llaa33219/MiniCPM-V-4.6-GGUF to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for llaa33219/MiniCPM-V-4.6-GGUF to start chatting
How to use llaa33219/MiniCPM-V-4.6-GGUF with Pi:
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
# 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": "llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M"
}
]
}
}
}# Start Pi in your project directory: pi
How to use llaa33219/MiniCPM-V-4.6-GGUF with Hermes Agent:
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
# 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 llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
hermes
How to use llaa33219/MiniCPM-V-4.6-GGUF with Docker Model Runner:
docker model run hf.co/llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
How to use llaa33219/MiniCPM-V-4.6-GGUF with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull llaa33219/MiniCPM-V-4.6-GGUF:Q4_K_M
lemonade run user.MiniCPM-V-4.6-GGUF-Q4_K_M
lemonade list
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"
}
}
]
}
]
)GGUF format quantized versions of openbmb/MiniCPM-V-4.6.
| File | Quantization | Size | BPW | Description |
|---|---|---|---|---|
| MiniCPM-V-4.6-F16.gguf | F16 | 1.5GB | 16.0 | Full precision |
| MiniCPM-V-4.6-Q4_K_M.gguf | Q4_K_M | 812MB | 8.5 | 4-bit, medium |
| MiniCPM-V-4.6-Q4_K_S.gguf | Q4_K_S | 812MB | 8.5 | 4-bit, small |
| MiniCPM-V-4.6-Q3_K_M.gguf | Q3_K_M | 812MB | 8.5 | 3-bit, medium |
| MiniCPM-V-4.6-Q3_K_S.gguf | Q3_K_S | 812MB | 8.5 | 3-bit, small |
| MiniCPM-V-4.6-Q2_K.gguf | Q2_K | 812MB | 8.5 | 2-bit, smallest |
llama-server -m MiniCPM-V-4.6-Q2_K.gguf --port 8080
from llama_cpp import Llama
llm = Llama(model_path="./MiniCPM-V-4.6-Q2_K.gguf", n_ctx=512, n_threads=4)
output = llm.create_chat_completion(
messages=[{"role": "user", "content": "你好,你是谁?"}],
max_tokens=100,
temperature=0.0,
)
print(output['choices'][0]['message']['content'])
FROM ./MiniCPM-V-4.6-Q2_K.gguf
ollama create minicpm-v-4.6 -f Modelfile
ollama run minicpm-v-4.6
| Type | Bits | Quality | Speed | Use Case |
|---|---|---|---|---|
| F16 | 16 | Best | Slow | Development |
| Q4_K_M | 4 | Good | Fast | General use |
| Q3_K_M | 3 | Medium | Faster | Balanced |
| Q2_K | 2 | Lower | Fastest | Edge/mobile |
python convert_hf_to_gguf.py openbmb/MiniCPM-V-4.6 --outfile MiniCPM-V-4.6-F16.gguf --outtype f16
llama-quantize MiniCPM-V-4.6-F16.gguf MiniCPM-V-4.6-Q2_K.gguf Q2_K
Apache-2.0
2-bit
3-bit
4-bit
16-bit
Base model
openbmb/MiniCPM-V-4.6
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="llaa33219/MiniCPM-V-4.6-GGUF", filename="", )