跳到主要内容

MiniCPM-V 4.7

MiniCPM-V 多模态系列

MiniCPM-V 4.7 是 MiniCPM-V 系列最新一代,提供两个尺寸:端侧友好的 1B 与稀疏 MoE 的 35B-A3B —— 后者是该系列的首个 MoE 模型。它延续系列的单图、多图与视频理解能力,重点解决「MoE 模型能不能在端侧跑顺」这个问题:借助随 MiniCPM-V 4.7 一同提出的 Lookahead Expert Scheduling(LES) 专家预取调度、分层细粒度量化与 DSpark 投机采样,35B-A3B 成为首个在端侧流畅运行且不牺牲性能的开源 MoE 模型,在 iPhone 17 Pro Max 上可达 13+ tokens/s 的解码速度。

视觉侧沿用 LLaVA-UHD v4 的 ViT 内部早期压缩,在视觉编码器内部就压缩视觉 token,并支持 4×/16× 混合压缩率,可按任务在细节与开销之间取舍。模型覆盖 iOS、Android、HarmonyOS 三大移动平台,并对瑞芯微、后摩、Intel、AMD、Arm 等芯片平台提供 day-0 支持;推理侧适配 SGLang、vLLM、llama.cpp、Ollama,微调侧适配 SWIFT 与 LLaMA-Factory,量化提供 GGUF、BNB、AWQ、GPTQ 并新增 FP8。

模型列表​

Checkpoint参数量语言骨干上下文
MiniCPM-V-4.7-1B1.55 Bqwen3_5_text(dense)256K
MiniCPM-V-4.7-35B-A3B35.2 B 总 · ~3.5 B 激活qwen3_5_moe_text(256 专家,8/token)256K

两者共用同一套 SigLIP canvas M-RoPE 视觉塔(27 层,patch 14,4×/16× 混合压缩),均支持单图、多图与视频理解。1B 面向端侧 / 低资源,35B-A3B 面向高吞吐服务。

核心特性​

  • Canvas M-RoPE:视觉 token 铺在二维 canvas 上,各带 (时间, 高, 宽) 位置,因此同一张图的切片保持空间关系、视频帧保持时间顺序。这是相对 MiniCPM-V 4.6 的主要变化。
  • 两尺寸、同架构族:dense 1B 与 256 专家 MoE 的 35B-A3B 共用视觉塔与 processor。
  • 原生 transformers 架构:注册为 MiniCPMV4_7ForConditionalGeneration,需 transformers >= 5.18.0;标准 AutoProcessor + AutoModelForImageTextToText 流程可用,无需 trust_remote_code。
  • Thinking 是请求开关:不同于 MiniCPM-V 4.6 的独立 -Thinking 权重,MiniCPM-V 4.7 每个尺寸只有一个 checkpoint,通过 chat_template_kwargs 里的 enable_thinking 开启思考。

快速开始​

Bash
pip install "transformers[torch]>=5.18.0" torchvision
Python
import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForImageTextToText

model_path = "openbmb/MiniCPM-V-4.7-1B" # 或 "openbmb/MiniCPM-V-4.7-35B-A3B"

processor = AutoProcessor.from_pretrained(model_path)
model = AutoModelForImageTextToText.from_pretrained(
model_path,
dtype="auto",
device_map="auto",
).eval()

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))

思考模式​

对话模板默认开启 <think> 块。如需关闭(普通问答建议关闭):

Python
inputs = processor.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt",
chat_template_kwargs={"enable_thinking": False},
).to(model.device)

部署​

框架状态入口
vLLM上游已支持(PR #58674)vllm serve
SGLang走 fork tc-mb/sglang(分支 Support-MiniCPM-V4.7);上游暂未支持sglang.launch_server
llama.cpp上游已支持(PR #29416)llama-mtmd-cli / llama-server
Ollama模型代码已就绪;运行时待其内置 llama.cpp 同步到 #29416ollama create -f

各框架的完整安装、启动与调用步骤见部署。

量化​

格式1B35B-A3B仓库后缀
GGUF✅✅-gguf
BNB (int4)✅✅-int4
AWQ✅✅-AWQ
GPTQ✅✅-GPTQ
FP8—✅-FP8(llm-compressor)
  • GGUF 是推荐的通用 / CPU-Metal 格式。
  • 35B-A3B 的 HF 4-bit 权重(-AWQ / -GPTQ / -int4 / -FP8)由支持融合专家的工具(llm-compressor / GPTQModel)产出;普通 AutoAWQ / AutoGPTQ / bitsandbytes 无法量化融合的 MoE 专家参数。

转换与量化脚本见量化。

模型仓库​

  • 基座:MiniCPM-V-4.7-1B、MiniCPM-V-4.7-35B-A3B
  • 量化:-gguf、-int4、-AWQ、-GPTQ(1B)· -gguf、-FP8、-INT4、-AWQ、-GPTQ、-int4(35B-A3B)
  • 投机解码 draft:MiniCPM-V-4.7-1B-DSpark、MiniCPM-V-4.7-35B-A3B-DSpark

相关资源​

主题入口
代码仓库OpenBMB/MiniCPM-V
在线体验MiniCPM-V 4.7 Demo
端侧应用与下载MiniCPM-V-Apps 安装包
API 接入API 使用文档