char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
7a4ca3cbd
char/aliceai-t5-moe
MiniCPM-V 4.5
Prepare models and code
Download MiniCPM-V-4_5 PyTorch model from huggingface to "MiniCPM-V-4_5" folder.
Build llama.cpp
Readme modification time: 20250826
If there are differences in usage, please refer to the official build documentation
Clone llama.cpp:
git clone https://github.com/ggml-org/llama.cppcd llama.cpp
Build llama.cpp using CMake:
cmake -B buildcmake --build build--config Release
Usage of MiniCPM-V 4
Convert PyTorch model to gguf files (You can also download the converted gguf by us)
python ./tools/mtmd/legacy-models/minicpmv-surgery.py-m ../MiniCPM-V-4_5python ./tools/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py-m ../MiniCPM-V-4_5--minicpmv-projector ../MiniCPM-V-4_5/minicpmv.projector--output-dir ../MiniCPM-V-4_5/--minicpmv_version 6python ./convert_hf_to_gguf.py ../MiniCPM-V-4_5/model# quantize int4 version ./build/bin/llama-quantize ../MiniCPM-V-4_5/model/ggml-model-f16.gguf ../MiniCPM-V-4_5/model/ggml-model-Q4_K_M.gguf Q4_K_M
Inference on Linux or Mac
# run in single-turn mode ./build/bin/llama-mtmd-cli -m ../MiniCPM-V-4_5/model/ggml-model-f16.gguf--mmproj ../MiniCPM-V-4_5/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 in conversation mode ./build/bin/llama-mtmd-cli -m ../MiniCPM-V-4_5/model/ggml-model-Q4_K_M.gguf--mmproj ../MiniCPM-V-4_5/mmproj-model-f16.gguf
1## MiniCPM-V 4.5 2 3### Prepare models and code 4 5Download [MiniCPM-V-4_5](https://huggingface.co/openbmb/MiniCPM-V-4_5) PyTorch model from huggingface to "MiniCPM-V-4_5" folder. 6 7 8### Build llama.cpp 9Readme modification time: 20250826 10 11If there are differences in usage, please refer to the official build [documentation](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md) 12 13Clone llama.cpp: 14``` bash 15git clone https://github.com/ggml-org/llama.cpp 16cd llama.cpp 17``` 18 19Build llama.cpp using `CMake`: 20``` bash 21cmake -B build 22cmake --build build --config Release 23``` 24 25 26### Usage of MiniCPM-V 4 27 28Convert PyTorch model to gguf files (You can also download the converted [gguf](https://huggingface.co/openbmb/MiniCPM-V-4_5-gguf) by us) 29 30``` bash 31python ./tools/mtmd/legacy-models/minicpmv-surgery.py -m ../MiniCPM-V-4_5 32python ./tools/mtmd/legacy-models/minicpmv-convert-image-encoder-to-gguf.py -m ../MiniCPM-V-4_5 --minicpmv-projector ../MiniCPM-V-4_5/minicpmv.projector --output-dir ../MiniCPM-V-4_5/ --minicpmv_version 6 33python ./convert_hf_to_gguf.py ../MiniCPM-V-4_5/model 34 35# quantize int4 version 36./build/bin/llama-quantize ../MiniCPM-V-4_5/model/ggml-model-f16.gguf ../MiniCPM-V-4_5/model/ggml-model-Q4_K_M.gguf Q4_K_M 37``` 38 39 40Inference on Linux or Mac 41``` bash 42# run in single-turn mode 43./build/bin/llama-mtmd-cli -m ../MiniCPM-V-4_5/model/ggml-model-f16.gguf --mmproj ../MiniCPM-V-4_5/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?" 44 45# run in conversation mode 46./build/bin/llama-mtmd-cli -m ../MiniCPM-V-4_5/model/ggml-model-Q4_K_M.gguf --mmproj ../MiniCPM-V-4_5/mmproj-model-f16.gguf 47```