MiniCPM-V MiniCPM-V & o Cookbook

MiniCPM-V 4.5 - SGLang

1. SGLang安装

SGLang源码安装

git clone https://github.com/sgl-project/sglang.git
cd sglang

pip install --upgrade pip
pip install -e "python[all]"

flashinfer依赖安装

方法1:pip 安装(网速可能不行)

pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/

方法2: whl文件安装

2. sglang发起推理服务

默认情况下,它将从 Hugging Face Hub 下载模型文件

python -m sglang.launch_server --model-path openbmb/MiniCPM-V-4_5 --port 30000

也可以在参数 --model-path 后指定本地路径

python -m sglang.launch_server --model-path your_model_path --port 30000 --trust-remote-code

3. 调用服务接口