MiniCPM
Collection
The MiniCPM family of LLMs and VLLMs. โข 33 items โข Updated โข 76
How to use openbmb/MiniCPM-V-2_6-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="openbmb/MiniCPM-V-2_6-gguf", filename="ggml-model-IQ3_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
How to use openbmb/MiniCPM-V-2_6-gguf with llama.cpp:
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf openbmb/MiniCPM-V-2_6-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf openbmb/MiniCPM-V-2_6-gguf:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf openbmb/MiniCPM-V-2_6-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf openbmb/MiniCPM-V-2_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 openbmb/MiniCPM-V-2_6-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf openbmb/MiniCPM-V-2_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 openbmb/MiniCPM-V-2_6-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf openbmb/MiniCPM-V-2_6-gguf:Q4_K_M
docker model run hf.co/openbmb/MiniCPM-V-2_6-gguf:Q4_K_M
How to use openbmb/MiniCPM-V-2_6-gguf with Ollama:
ollama run hf.co/openbmb/MiniCPM-V-2_6-gguf:Q4_K_M
How to use openbmb/MiniCPM-V-2_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 openbmb/MiniCPM-V-2_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 openbmb/MiniCPM-V-2_6-gguf to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for openbmb/MiniCPM-V-2_6-gguf to start chatting
How to use openbmb/MiniCPM-V-2_6-gguf with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-V-2_6-gguf:Q4_K_M
How to use openbmb/MiniCPM-V-2_6-gguf with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull openbmb/MiniCPM-V-2_6-gguf:Q4_K_M
lemonade run user.MiniCPM-V-2_6-gguf-Q4_K_M
lemonade list
Download MiniCPM-V-2_6 PyTorch model from huggingface to "MiniCPM-V-2_6" folder.
Clone llama.cpp:
git clone git@github.com:OpenBMB/llama.cpp.git
cd llama.cpp
git checkout minicpmv-main
Convert PyTorch model to gguf files (You can also download the converted gguf by us)
python ./examples/llava/minicpmv-surgery.py -m ../MiniCPM-V-2_6
python ./examples/llava/minicpmv-convert-image-encoder-to-gguf.py -m ../MiniCPM-V-2_6 --minicpmv-projector ../MiniCPM-V-2_6/minicpmv.projector --output-dir ../MiniCPM-V-2_6/ --image-mean 0.5 0.5 0.5 --image-std 0.5 0.5 0.5 --minicpmv_version 3
python ./convert_hf_to_gguf.py ../MiniCPM-V-2_6/model
# quantize int4 version
./llama-quantize ../MiniCPM-V-2_6/model/ggml-model-f16.gguf ../MiniCPM-V-2_6/model/ggml-model-Q4_K_M.gguf Q4_K_M
Build for Linux or Mac
make
make llama-minicpmv-cli
Inference on Linux or Mac
# run f16 version
./llama-minicpmv-cli -m ../MiniCPM-V-2_6/model/ggml-model-f16.gguf --mmproj ../MiniCPM-V-2_6/mmproj-model-f16.gguf -c 4096 --temp 0.7 --top-p 0.8 --top-k 100 --repeat-penalty 1.05 --image xx.jpg -p "What is in the image?"
# run quantized int4 version
./llama-minicpmv-cli -m ../MiniCPM-V-2_6/model/ggml-model-Q4_K_M.gguf --mmproj ../MiniCPM-V-2_6/mmproj-model-f16.gguf -c 4096 --temp 0.7 --top-p 0.8 --top-k 100 --repeat-penalty 1.05 --image xx.jpg -p "What is in the image?"
# or run in interactive mode
./llama-minicpmv-cli -m ../MiniCPM-V-2_6/model/ggml-model-Q4_K_M.gguf --mmproj ../MiniCPM-V-2_6/mmproj-model-f16.gguf -c 4096 --temp 0.7 --top-p 0.8 --top-k 100 --repeat-penalty 1.05 --image xx.jpg -i
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit
Base model
openbmb/MiniCPM-V-2_6