MiniCPM-V 4.6
MiniCPM-V 多模态系列
把模型接入自己的服务:vLLM 与 SGLang 面向高吞吐的 GPU 服务,llama.cpp 与 Ollama 面向本地与端侧运行,Gradio 与 iOS 则是开箱即用的演示应用。按硬件与场景选择其一,本页给出各自的安装、启动与调用步骤。
MiniCPM-V 4.6 提供 两个独立的 checkpoint,各框架均通过切换模型路径使用:
| 版本 | HuggingFace ID | 魔搭社区 ID |
|---|---|---|
| Instruct | openbmb/MiniCPM-V-4.6 | OpenBMB/MiniCPM-V-4.6 |
| Thinking(思考) | openbmb/MiniCPM-V-4.6-Thinking | OpenBMB/MiniCPM-V-4.6-Thinking |
| 方案 | 适用场景 | 要点 |
|---|---|---|
| vLLM | 高吞吐 GPU 服务 | 官方 main 已支持(PR #43213),无需 fork |
| SGLang | 高吞吐 GPU 服务 | 官方 main 已支持(PR #24998),无需 fork |
| llama.cpp | 本地 CPU / Metal | release b9049 起支持,转换不再需要 surgery 脚本 |
| Ollama | 本地快速体验 | 官方 v0.30 起内置支持,ollama run openbmb/minicpm-v4.6 |
| Gradio | Web 演示(图像 / 视频对话) | 服务端 + 客户端两部分 |
| iOS | 端侧 App(含 Android / HarmonyOS) | 基于 llama.cpp submodule 编译 |
MiniCPM-V 4.6 注册为 MiniCPMV4_6ForConditionalGeneration,需 transformers >= 5.7.0。与 MiniCPM-V 4.5 通过 enable_thinking 切换模式不同,MiniCPM-V 4.6 按需部署对应 checkpoint;vLLM 的 stop_token_ids 改为 [248044, 248046](MiniCPM-V 4.5 是 [1, 151645])。
vLLM
1. 环境准备
1.1 安装 vLLM
MiniCPM-V 4.6 自 PR #43213(2026-05-22 merged)起在官方 vLLM main 分支上完整可用。无需使用 fork,直接从官方仓库安装即可,确保检出的 commit ≥ 该 PR 的 merge 时间:
# 新建干净的 conda 环境
conda create -n vllm-v46 python=3.10 -y
conda activate vllm-v46
# 从官方 main 源码安装(需要 CUDA 工具链;HEAD 需包含 #43213)
git clone https://github.com/vllm-project/vllm.git
cd vllm
MAX_JOBS=6 VLLM_USE_PRECOMPILED=1 pip install --editable . -v
[!TIP] 等到 vLLM 发布包含 #43213 的正式 release 之后,可直接
pip install -U vllm升级,无需源码安装。请关注 vLLM Releases。
进行视频推理时,需要安装相应的视频模块:
pip install vllm[video]
vLLM 要求 transformers>=5.7.0,MiniCPM-V 4.6 在 transformers 中以独立架构 MiniCPMV4_6ForConditionalGeneration 形式合并。
校验安装:
python -c "import vllm, transformers; print('vllm', vllm.__version__, '| transformers', transformers.__version__)"
2. API 服务部署
2.1 启动 API 服务
vllm serve <模型路径> \
--dtype auto \
--max-model-len 8192 \
--api-key token-abc123 \
--gpu_memory_utilization 0.9 \
--trust-remote-code \
--max-num-batched-tokens 8192
参数说明:
<模型路径>:MiniCPM-V-4.6 的本地路径,或 HuggingFace IDopenbmb/MiniCPM-V-4.6/openbmb/MiniCPM-V-4.6-Thinking--api-key:API 访问密钥--max-model-len:最大上下文长度。MiniCPM-V 4.6 backbone 最长支持 256K,部署时按需设置即可--gpu_memory_utilization:GPU 显存使用率
2.2 图片推理
from openai import OpenAI
import base64
openai_api_key = "token-abc123" # 需与启动服务时设置的密钥保持一致
openai_api_base = "http://localhost:8000/v1"
client = OpenAI(api_key=openai_api_key, base_url=openai_api_base)
with open('./assets/airplane.jpeg', 'rb') as file:
image = "data:image/jpeg;base64," + base64.b64encode(file.read()).decode('utf-8')
chat_response = client.chat.completions.create(
model="<模型路径>",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "请描述这张图片"},
{"type": "image_url", "image_url": {"url": image}},
],
}],
extra_body={
# v4.6 使用 Qwen3.5 词表,stop_token_ids 与 v4.5 不同
"stop_token_ids": [248044, 248046]
}
)
print("Chat response:", chat_response)
print("Chat response content:", chat_response.choices[0].message.content)
2.3 视频推理
from openai import OpenAI
import base64
openai_api_key = "token-abc123"
openai_api_base = "http://localhost:8000/v1"
client = OpenAI(api_key=openai_api_key, base_url=openai_api_base)
with open('./videos/video.mp4', 'rb') as video_file:
video_base64 = base64.b64encode(video_file.read()).decode('utf-8')
chat_response = client.chat.completions.create(
model="<模型路径>",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "user",
"content": [
{"type": "text", "text": "请描述这个视频"},
{"type": "video_url", "video_url": {"url": f"data:video/mp4;base64,{video_base64}"}},
],
},
],
extra_body={"stop_token_ids": [248044, 248046]}
)
print(chat_response.choices[0].message.content)
MiniCPM-V 4.6 的视频通路非常简单:图像处理器逐帧调用,单视频帧切片预算由
mm_processor_kwargs/video_processor.max_slice_nums控制,无需enhanced_opencv等特殊后端。
调整单视频帧切片数量:
extra_body = {
"stop_token_ids": [248044, 248046],
"mm_processor_kwargs": {"max_slice_nums": 2},
}
2.4 思考模式
如果部署的是 openbmb/MiniCPM-V-4.6-Thinking 模型,chat template 会默认在 assistant 起始位置插入 <think> 块;模型先输出推理过程,再以 </think> 分隔后给出回答。可通过 chat_template_kwargs 跳过:
extra_body = {
"stop_token_ids": [248044, 248046],
# 在 Thinking 模型上跳过开头的 <think> 块
"chat_template_kwargs": {"enable_thinking": False},
}
Instruct 模型不会输出 <think> 块,按业务需求选择对应 checkpoint 即可,不再像 MiniCPM-V 4.5 那样需要在请求里切换模式。
2.5 多轮对话
启动参数配置
进行多图 / 多视频对话时,需在启动时调大 --limit-mm-per-prompt:
# 视频多轮对话(最多 3 个视频)
vllm serve <模型路径> --dtype auto --max-model-len 16384 --api-key token-abc123 \
--gpu_memory_utilization 0.9 --trust-remote-code \
--limit-mm-per-prompt '{"video": 3}'
# 图片和视频混合输入
vllm serve <模型路径> --dtype auto --max-model-len 16384 --api-key token-abc123 \
--gpu_memory_utilization 0.9 --trust-remote-code \
--limit-mm-per-prompt '{"image": 5, "video": 2}'
多轮对话示例代码
from openai import OpenAI
import base64
import mimetypes
import os
openai_api_key = "token-abc123"
openai_api_base = "http://localhost:8000/v1"
client = OpenAI(api_key=openai_api_key, base_url=openai_api_base)
messages = [{"role": "system", "content": "You are a helpful assistant."}]
def file_to_base64(file_path):
with open(file_path, 'rb') as f:
return base64.b64encode(f.read()).decode('utf-8')
def get_mime_type(file_path):
mime, _ = mimetypes.guess_type(file_path)
return mime or 'application/octet-stream'
def build_file_content(file_path):
mime_type = get_mime_type(file_path)
base64_data = file_to_base64(file_path)
url = f"data:{mime_type};base64,{base64_data}"
if mime_type.startswith("image/"):
return {"type": "image_url", "image_url": {"url": url}}
elif mime_type.startswith("video/"):
return {"type": "video_url", "video_url": {"url": url}}
else:
print(f"不支持的文件类型: {mime_type}")
return None
while True:
user_text = input("请输入问题(输入 'exit' 退出):")
if user_text.strip().lower() == "exit":
break
content = [{"type": "text", "text": user_text}]
upload_file = input("是否上传文件?(y/n): ").strip().lower() == 'y'
if upload_file:
file_path = input("请输入文件路径: ").strip()
if os.path.exists(file_path):
file_content = build_file_content(file_path)
if file_content:
content.append(file_content)
else:
print("文件路径不存在,跳过文件上传。")
messages.append({"role": "user", "content": content})
chat_response = client.chat.completions.create(
model="<模型路径>",
messages=messages,
extra_body={"stop_token_ids": [248044, 248046]},
)
ai_message = chat_response.choices[0].message
print("MiniCPM-V 4.6:", ai_message.content)
messages.append({"role": "assistant", "content": ai_message.content})
3. 离线推理
from transformers import AutoProcessor
from PIL import Image
from vllm import LLM, SamplingParams
MODEL_NAME = "<模型路径>"
# 或直接使用 HuggingFace ID:
# MODEL_NAME = "openbmb/MiniCPM-V-4.6"
image = Image.open("./assets/airplane.jpeg").convert("RGB")
processor = AutoProcessor.from_pretrained(MODEL_NAME)
llm = LLM(
model=MODEL_NAME,
max_model_len=8192,
trust_remote_code=True,
disable_mm_preprocessor_cache=True,
limit_mm_per_prompt={"image": 5},
)
messages = [{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "请描述这张图片的内容"},
],
}]
prompt = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = {
"prompt": prompt,
"multi_modal_data": {
"image": image,
# 多图推理:
# "image": [image1, image2]
},
}
sampling_params = SamplingParams(
stop_token_ids=[248044, 248046],
temperature=0.7,
top_p=0.8,
max_tokens=1024,
)
outputs = llm.generate(inputs, sampling_params=sampling_params)
print(outputs[0].outputs[0].text)
注意事项
- 模型路径:将示例中的
<模型路径>替换为本地路径,或openbmb/MiniCPM-V-4.6/openbmb/MiniCPM-V-4.6-Thinking。 - 停止符:MiniCPM-V 4.6 采用 Qwen3.5 词表,正确的
stop_token_ids为[248044, 248046](MiniCPM-V 4.5 用的是[1, 151645])。 - API 密钥:客户端密钥需与
vllm serve启动时一致。 - 显存配置:根据硬件调整
--gpu_memory_utilization/--max-model-len/--max-num-batched-tokens。MiniCPM-V 4.6 backbone 最长支持 256K,但通常无需开满。 - 多模态限制:多图 / 多视频对话时设置合适的
--limit-mm-per-prompt。
SGLang
[!NOTE] MiniCPM-V 4.6 自 PR #24998(2026-05-12 merged)起在官方 SGLang
main分支上完整可用。无需使用 fork,直接从官方仓库安装即可,确保检出的 commit ≥ 该 PR 的 merge 时间。MiniCPM-V 4.6 在
transformers>=5.7.0中以独立架构MiniCPMV4_6ForConditionalGeneration注册,SGLang 的适配也基于这一布局。
MiniCPM-V 4.6 提供两个 checkpoint:
- Instruct —
openbmb/MiniCPM-V-4.6 - Thinking(思考) —
openbmb/MiniCPM-V-4.6-Thinking
1. SGLang 安装
从官方 main 源码安装
包含 #24998 的正式 release 出来前,推荐从官方 main 安装(请关注 SGLang Releases;正式版发布后可直接 pip install -U "sglang[all]"):
git clone https://github.com/sgl-project/sglang.git
cd sglang
pip install --upgrade pip
pip install -e "python[all]"
上述命令会自动安装 transformers>=5.7.0,而它会牵入一个较新版本的
PyTorch(截至撰写时 ≥ 2.6)。安装 FlashInfer 之前先确认实际 torch /
CUDA 版本,避免下一步装错 wheel 把 torch 又降回去:
python -c "import torch, transformers; print('torch', torch.__version__, '| cuda', torch.version.cuda, '| transformers', transformers.__version__)"
FlashInfer 依赖(可选,建议安装)
[!IMPORTANT] FlashInfer 的 wheel 是按
(torch 版本, CUDA 版本)组合发布的,必须 选与刚才验证出来的 torch + CUDA 完全匹配的 index。不要直接复制cu121/torch2.4这种老链接——那会偷偷把 torch 降级并破坏前面装好 的 SGLang / transformers 环境。
FlashInfer 总索引:<https://flashinfer.ai/whl/>。挑跟你环境匹配的目录,例如:
| 你的 torch / CUDA | Index URL |
|---|---|
| torch 2.6 + CUDA 12.4 | <https://flashinfer.ai/whl/cu124/torch2.6/> |
| torch 2.6 + CUDA 12.6 | <https://flashinfer.ai/whl/cu126/torch2.6/> |
| torch 2.7 + CUDA 12.8 | <https://flashinfer.ai/whl/cu128/torch2.7/> |
然后任选一种安装:
# 方法 1:从对应索引 pip 安装(国内访问可能慢)
pip install flashinfer-python -i <上表选的 index URL>
# 方法 2:手动下载匹配的 whl 安装
# 1) 浏览器打开索引 URL,选一份匹配你 Python 版本(cp310/cp311/…)
# 与平台(linux_x86_64 / win_amd64)的 whl
# 2) pip install <下载的 whl 文件>
其它(Docker 镜像、纯 CPU 退路等)参见 SGLang 官方安装文档。
2. 启动推理服务
默认情况下,会从 Hugging Face Hub 下载模型文件:
python -m sglang.launch_server --model-path openbmb/MiniCPM-V-4.6 --port 30000 --trust-remote-code --dtype bfloat16
也可以在 --model-path 后指定本地路径:
python -m sglang.launch_server --model-path /your/local/MiniCPM-V-4.6 --port 30000 --trust-remote-code --dtype bfloat16
部署 Thinking 模型只需替换 model id:
python -m sglang.launch_server --model-path openbmb/MiniCPM-V-4.6-Thinking --port 30000 --trust-remote-code --dtype bfloat16
3. 调用服务接口
-
bash / curl:
Bashcurl -s http://localhost:30000/v1/chat/completions \-H "Content-Type: application/json" \-d '{"model": "MiniCPM-V-4.6","messages": [{"role": "user","content": [{"type": "text", "text": "What is in this image?"},{"type": "image_url","image_url": {"url": "https://github.com/OpenSQZ/MiniCPM-V-CookBook/blob/main/inference/assets/airplane.jpeg?raw=true"}}]}],"max_tokens": 300,"top_k": -1}' -
Python(OpenAI 客户端)调用:
Pythonfrom openai import OpenAIclient = OpenAI(base_url="http://localhost:30000/v1", api_key="None")response = client.chat.completions.create(model="MiniCPM-V-4.6",messages=[{"role": "user","content": [{"type": "text", "text": "请描述这张图片"},{"type": "image_url","image_url": {"url": "https://github.com/OpenSQZ/MiniCPM-V-CookBook/blob/main/inference/assets/airplane.jpeg?raw=true",},},],}],max_tokens=300,extra_body={"top_k": -1, "stop_token_ids": [248044, 248046]},)print(response.choices[0].message.content)
如
image_url无法访问,可替换为本地图片路径或 base64 data URL。MiniCPM-V 4.6 使用 Qwen3.5 词表 —— 若发现模型在回答后继续生成,请显式传入
stop_token_ids=[248044, 248046]。更多调用方法可参考 SGLang 使用文档。
llama.cpp
[!NOTE] MiniCPM-V 4.6 已合并到官方
llama.cpp(PR #22529),从 releaseb9049开始包含。与 MiniCPM-V 4.5 相比,MiniCPM-V 4.6 重做了视觉塔(resampler 被替换为新的 merger 结构,提升 ViT 推理效率),并且 GGUF 转换合并到了标准的
convert_hf_to_gguf.py流程中 —— 不再需要专用的 surgery 脚本。
1. 编译安装 llama.cpp
克隆 llama.cpp 代码仓库(需要 release b9049 及之后的提交):
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
使用 CMake 构建(详见构建文档):
CPU / Metal:
cmake -B build
cmake --build build --config Release
CUDA:
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release
2. 获取 GGUF 权重
方法一:下载官方 GGUF 文件
从仓库中下载语言模型文件(如 MiniCPM-V-4.6-Q4_K_M.gguf)与视觉模型文件(mmproj-MiniCPM-V-4.6-F16.gguf):
- HuggingFace:<https://huggingface.co/openbmb/MiniCPM-V-4.6-gguf>
- 魔搭社区:<https://modelscope.cn/models/OpenBMB/MiniCPM-V-4.6-gguf>
Thinking 版本在以下仓库单独发布:
方法二:从 PyTorch 模型转换
下载 PyTorch 模型:
- HuggingFace:<https://huggingface.co/openbmb/MiniCPM-V-4.6>(或
MiniCPM-V-4.6-Thinking) - 魔搭社区:<https://modelscope.cn/models/OpenBMB/MiniCPM-V-4.6>
用 llama.cpp 仓库自带的标准脚本 convert_hf_to_gguf.py 直接转换:
# 1) 将语言模型 + 视觉 merger 转为 GGUF
python ./convert_hf_to_gguf.py /path/to/MiniCPM-V-4.6 \
--outfile /path/to/MiniCPM-V-4.6/MiniCPM-V-4.6-F16.gguf \
--outtype f16
# 2) 转换视觉 projector(mmproj)
python ./convert_hf_to_gguf.py /path/to/MiniCPM-V-4.6 \
--mmproj \
--outfile /path/to/MiniCPM-V-4.6/mmproj-MiniCPM-V-4.6-F16.gguf
convert_hf_to_gguf.py 会从 config.json 自动识别 MiniCPMV4_6ForConditionalGeneration,同时输出 LM 与视觉塔。
MiniCPM-V 4.6 不再需要
legacy-models/minicpmv-surgery.py+minicpmv-convert-image-encoder-to-gguf.py这套两步流程。如果您在跟随旧的 MiniCPM-V 4.5 文档,请忽略这些脚本。
3. 模型推理
[!IMPORTANT] 新版 llama.cpp(PR #20606 之后)的
--reasoning默认值为auto,会从 chat template 自动启用 thinking。MiniCPM-V 4.6 Instruct 模型本身不输出<think>块,但其模板默认会开启 thinking,导致 Instruct 推理输出异常。请在所有 Instruct 推理命令中显式加--reasoning off关闭。 Thinking 模型则保留默认或显式--reasoning on。
cd build/bin/
# F16 版本
./llama-mtmd-cli \
-m /path/to/MiniCPM-V-4.6/MiniCPM-V-4.6-F16.gguf \
--mmproj /path/to/MiniCPM-V-4.6/mmproj-MiniCPM-V-4.6-F16.gguf \
-c 8192 --temp 0.7 --top-p 0.8 --top-k 100 --repeat-penalty 1.05 \
--reasoning off \
--image xx.jpg -p "请描述这张图片"
# INT4 量化版本
./llama-mtmd-cli \
-m /path/to/MiniCPM-V-4.6/MiniCPM-V-4.6-Q4_K_M.gguf \
--mmproj /path/to/MiniCPM-V-4.6/mmproj-MiniCPM-V-4.6-F16.gguf \
-c 8192 --temp 0.7 --top-p 0.8 --top-k 100 --repeat-penalty 1.05 \
--reasoning off \
--image xx.jpg -p "请描述这张图片"
# 交互模式
./llama-mtmd-cli \
-m /path/to/MiniCPM-V-4.6/MiniCPM-V-4.6-Q4_K_M.gguf \
--mmproj /path/to/MiniCPM-V-4.6/mmproj-MiniCPM-V-4.6-F16.gguf \
-c 8192 --temp 0.7 --top-p 0.8 --top-k 100 --repeat-penalty 1.05 \
--reasoning off \
--image xx.jpg -i
部署 Thinking 模型时,可通过 --jinja + --reasoning-budget 控制思考预算(--reasoning 默认 auto,对 Thinking 模型会自动开启):
# Thinking 模型 - 不限制思考输出
./llama-mtmd-cli \
-m /path/to/MiniCPM-V-4.6-Thinking/MiniCPM-V-4.6-Thinking-Q4_K_M.gguf \
--mmproj /path/to/MiniCPM-V-4.6-Thinking/mmproj-MiniCPM-V-4.6-Thinking-F16.gguf \
-c 8192 --temp 0.7 --top-p 0.8 --top-k 100 --repeat-penalty 1.05 \
--image xx.jpg --jinja --reasoning-budget -1 -p "图中有什么?"
# Thinking 模型 - 跳过开头的 <think> 块(直接出答案)
./llama-mtmd-cli \
-m /path/to/MiniCPM-V-4.6-Thinking/MiniCPM-V-4.6-Thinking-Q4_K_M.gguf \
--mmproj /path/to/MiniCPM-V-4.6-Thinking/mmproj-MiniCPM-V-4.6-Thinking-F16.gguf \
-c 8192 --temp 0.7 --top-p 0.8 --top-k 100 --repeat-penalty 1.05 \
--image xx.jpg --jinja --reasoning-budget 0 -p "图中有什么?"
Instruct 模型本身不会生成 <think> 块,因此 --reasoning-budget 在它上面是无效的。
命令行参数说明:
| 参数 | 含义 |
|---|---|
-m, --model | 语言模型路径 |
--mmproj | 视觉模型路径 |
--image | 输入图片路径 |
-p, --prompt | 提示词 |
-c, --ctx-size | 输入上下文最大长度 |
-rea, --reasoning [on|off|auto] | 是否启用思考;默认 auto,会从 chat template 推断。Instruct 模型必须显式 off,Thinking 模型可保留默认或显式 on |
--reasoning-budget | 最大思考输出 token 数(-1 无限制,0 立即结束);仅在 Thinking 模型有效 |
--jinja | 使用模型自带的 Jinja chat template(新版 llama.cpp 默认已启用) |
Ollama
[!NOTE] Ollama 自 v0.30 起官方支持 MiniCPM-V 4.6。请确保 Ollama 版本 不低于 0.30,旧版本不包含该模型支持,会加载失败。
1. 安装 Ollama
- macOS:下载
- Windows:下载
- Linux:
curl -fsSL https://ollama.com/install.sh | sh,或参照 Ollama 官方手动安装指南。 - Docker:官方的 Ollama Docker 镜像
ollama/ollama已在 Docker Hub 上提供。
确认版本不低于 0.30:
ollama --version
2. 快速使用
从 Ollama registry 拉取并运行 OpenBMB 官方模型(<https://ollama.com/openbmb/minicpm-v4.6>):
ollama run openbmb/minicpm-v4.6
# 或 Thinking 版本
ollama run openbmb/minicpm-v4.6-thinking
命令行
用空格分隔输入问题和图片路径:
这张图片描述了什么? xx.jpg
API
import base64, requests
with open(image_path, 'rb') as image_file:
# 将图片文件转换为 base64 编码
encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
data = {
"model": "openbmb/minicpm-v4.6",
"prompt": query,
"stream": False,
"images": [encoded_string], # 列表可以放多张图,每张图用上面的方式转化为 base64
}
url = "http://localhost:11434/api/generate"
response = requests.post(url, json=data)
3. 自定义方式
如果需要加载本地 GGUF(例如自定义量化版本),请按下面的步骤操作。
获取 GGUF 模型
- HuggingFace:<https://huggingface.co/openbmb/MiniCPM-V-4.6-gguf>
- 魔搭社区:<https://modelscope.cn/models/OpenBMB/MiniCPM-V-4.6-gguf>
(Thinking 版本:openbmb/MiniCPM-V-4.6-Thinking-gguf)
创建 ModelFile
vim minicpmv4.6.Modelfile
ModelFile 的内容如下:
FROM ./MiniCPM-V-4.6/MiniCPM-V-4.6-Q4_K_M.gguf
FROM ./MiniCPM-V-4.6/mmproj-MiniCPM-V-4.6-F16.gguf
TEMPLATE """{{- if .Messages }}{{- range $i, $_ := .Messages }}{{- $last := eq (len (slice $.Messages $i)) 1 -}}<|im_start|>{{ .Role }}{{ .Content }}{{- if $last }}{{- if (ne .Role "assistant") }}<|im_end|><|im_start|>assistant{{ end }}{{- else }}<|im_end|>{{ end }}{{- end }}{{- else }}{{- if .System }}<|im_start|>system{{ .System }}<|im_end|>{{ end }}{{ if .Prompt }}<|im_start|>user{{ .Prompt }}<|im_end|>{{ end }}<|im_start|>assistant{{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}"""
SYSTEM """You are a helpful assistant."""
PARAMETER top_p 0.8
PARAMETER num_ctx 8192
PARAMETER stop ["<|im_start|>", "<|im_end|>"]
PARAMETER temperature 0.7
参数说明:
创建 Ollama 模型实例
ollama create minicpm-v4.6 -f minicpmv4.6.Modelfile