跳到主要内容

MiniCPM-V 4.6

MiniCPM-V 多模态系列

MiniCPM-V 4.6 是面壁至今最适合端侧部署的多模态模型,基于 SigLIP2-400M 与 Qwen3.5-0.8B 构建,总参数量 1.3B。它继承 MiniCPM-V 系列的单图、多图与视频理解能力,同时把重心放在计算效率上:基于 LLaVA-UHD v4 的 ViT 内部早期压缩技术,视觉编码计算量降低 50% 以上,token 吞吐约为 Qwen3.5-0.8B 的 1.5 倍;并首次支持 4×/16× 混合视觉 token 压缩,可按任务在精度与速度之间切换。

能力上,MiniCPM-V 4.6 在 Artificial Analysis 智能指数上得 13 分,以 19 倍更低的 token 开销超过 Qwen3.5-0.8B 的 10 分,也超过更大的 Ministral 3 3B;在 OpenCompass、RefCOCO、HallusionBench、MUIRBench、OCRBench 等多项基准上达到 Qwen3.5 2B 级别水平。模型可部署到 iOS、Android、HarmonyOS 三大移动平台,端侧适配代码全部开源,并已合入 Ollama 官方模型库。

核心特性​

  • 两个独立 checkpoint,统一架构。 与 MiniCPM-V 4.5(一份模型 + enable_thinking 切换)不同,MiniCPM-V 4.6 拆为两个独立 checkpoint,按需选用。
  • Qwen3.5 hybrid backbone。 线性注意力与全注意力混合,最长支持 256K 上下文。
  • LLaVA-UHD v4 视觉塔。 用切片编码 + ViT 内部早期压缩(4×/16× 混合压缩)替换原 Perceiver resampler,GGUF 转换流程也大大简化。参见 LLaVA-UHD v4 论文。
  • transformers 独立架构。 在 transformers >= 5.7.0 中以 MiniCPMV4_6ForConditionalGeneration 注册,标准 AutoProcessor + AutoModelForImageTextToText 即可使用。

快速上手​

推理(HF Transformers)​

Python
import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForImageTextToText

model_path = "openbmb/MiniCPM-V-4.6" # 或 MiniCPM-V-4.6-Thinking
processor = AutoProcessor.from_pretrained(model_path)
model = AutoModelForImageTextToText.from_pretrained(
model_path, torch_dtype=torch.bfloat16, attn_implementation="sdpa",
).eval().cuda()

image = Image.open("example.jpg").convert("RGB")
messages = [{"role": "user", "content": [
{"type": "image", "image": image},
{"type": "text", "text": "请描述这张图片"},
]}]
inputs = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt",
).to(model.device)

out = model.generate(**inputs, max_new_tokens=256)
print(processor.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

用 vLLM 部署​

Bash
# v4.6 已合并至官方 vLLM main(PR #41254,2026-05-12 merged),直接装官方仓库即可
git clone https://github.com/vllm-project/vllm.git
cd vllm
MAX_JOBS=6 VLLM_USE_PRECOMPILED=1 pip install --editable . -v

vllm serve openbmb/MiniCPM-V-4.6 --trust-remote-code --max-model-len 8192

详见 vLLM 部署指南。

用 llama.cpp 部署​

Bash
# release b9049 起包含 v4.6 支持
git clone https://github.com/ggml-org/llama.cpp.git && cd llama.cpp
cmake -B build && cmake --build build --config Release

# 用标准脚本转换(v4.6 不再需要 surgery 脚本!)
python ./convert_hf_to_gguf.py /path/to/MiniCPM-V-4.6 \
--outfile /path/to/MiniCPM-V-4.6-F16.gguf --outtype f16
python ./convert_hf_to_gguf.py /path/to/MiniCPM-V-4.6 \
--mmproj --outfile /path/to/mmproj-MiniCPM-V-4.6-F16.gguf

./build/bin/llama-mtmd-cli \
-m /path/to/MiniCPM-V-4.6-F16.gguf \
--mmproj /path/to/mmproj-MiniCPM-V-4.6-F16.gguf \
-c 8192 --reasoning off --image example.jpg -p "请描述这张图片"
# 注:Instruct 模型务必加 --reasoning off,新版 llama.cpp 默认会从模板自动开启 thinking

详见 llama.cpp 部署指南。

与 MiniCPM-V 4.5 的关键差异​

主题MiniCPM-V 4.5MiniCPM-V 4.6
思考模式单模型,请求级 enable_thinking 切换两个独立 checkpoint(Instruct、Thinking)
LM BackboneQwen3Qwen3.5 hybrid(线性 + 全注意力)
最大上下文32K256K
视觉塔Perceiver resamplerLLaVA-UHD v4(切片编码 + ViT 内部压缩)
GGUF 转换minicpmv-surgery.py + image encoder 脚本标准 convert_hf_to_gguf.py
stop_token_ids(vLLM)[1, 151645][248044, 248046]
音频—(仅视觉)—(仅视觉)

从 MiniCPM-V 4.5 迁移过来时,最常见的几个坑:

  1. stop_token_ids 改为 [248044, 248046](Qwen3.5 与 Qwen3 词表不同)。
  2. 不再使用 enable_thinking 请求参数 —— 改为部署对应 checkpoint。
  3. GGUF 转换不再需要 minicpmv-surgery.py,直接用 convert_hf_to_gguf.py。

相关资源​