🧠 模型管理

最新模型下载、列表、自定义与部署

📥 模型下载

Qwen3 系列 (阿里)

ollama pull qwen3           # 基础版
ollama pull qwen3:8b        # 8B 参数
ollama pull qwen3:32b       # 32B 参数
ollama pull qwen3-vl        # 视觉理解
ollama pull qwen3-coder-next # 代码专用
ollama pull qwen3-embedding # 向量嵌入

NVIDIA Nemotron

ollama pull nemotron-super  # 120B MoE
ollama pull nemotron-nano   # 30B 轻量

智谱 GLM 系列

ollama pull glm-4.7-flash   # 快速推理
ollama pull glm-5          # 40B 强推理
ollama pull glm-ocr        # OCR 识别

月之暗面 Kimi

ollama pull kimi-k2.5       # 多模态代理

MiniMax

ollama pull minimax-m2.5    # 中文优化

Mistral AI

ollama pull ministral-3     # 3B-14B
ollama pull lfm2           # 24B MoE
ollama pull lfm2.5-thinking # 思考模式

📊 主流模型对比

模型 参数量 下载量 特点 推荐配置
QWEN3-VL 2B - 235B 2.1M 视觉+推理 ≥8GB VRAM
QWEN3.5 0.8B - 122B 1.8M 通用对话 ≥16GB VRAM
Nemotron-Super 120B MoE 28.9K 工具调用 ≥24GB VRAM
GLM-5 40B 活跃 109K 强推理 ≥16GB VRAM
Kimi-K2.5 多模态 151K 原生代理 ≥12GB VRAM
LFM2.5-Thinking 1.2B 971K 深度思考 ≥4GB VRAM

🏷️ 按功能分类模型

🖼️ 视觉理解

ollama pull qwen3-vl
ollama pull glm-ocr
ollama pull deepseek-ocr
ollama pull translategemma

🧠 思考/推理

ollama pull qwen3.5
ollama pull lfm2.5-thinking
ollama pull glm-4.7-flash

🔧 工具调用

ollama pull nemotron-super
ollama pull qwen3-coder-next
ollama pull glm-4.7-flash
ollama pull granite4

📐 向量嵌入

ollama pull qwen3-embedding

⚙️ Modelfile 详细介绍

📖 什么是 Modelfile

Modelfile 是 Ollama 的模型配置文件,它允许你自定义模型行为调整推理参数注入系统提示词,无需重新训练模型即可创建专属的 AI 助手。

🎯 为什么要引入 Modelfile

  • 定制行为:让模型扮演特定角色(客服、代码助手、翻译官等)
  • 调整输出:控制创造力、响应长度、格式等
  • 知识注入:内置专业知识库,无需 RAG
  • 可复用:一次配置,随时加载使用

⚡ 典型使用场景

  • 企业内部知识库助手
  • 代码审查 / 编写专家
  • 特定领域顾问(医疗、法律、金融)
  • 翻译、摘要、写作助手

📋 Modelfile 参数详解

参数 说明 取值范围 默认值
FROM 基础模型 模型名称 -
SYSTEM 系统提示词(模型角色设定) 任意文本 -
PARAMETER temperature 随机性:越高越有创意,越低越确定性 0.0 - 2.0 0.8
PARAMETER top_p 核采样:控制词汇选择范围 0.0 - 1.0 0.9
PARAMETER top_k 限制最高概率词数量 1 - 100 40
PARAMETER num_ctx 上下文窗口大小 128 - 8192 2048
PARAMETER num_gpu GPU 层数(-1 自动) -1 或正整数 -1
PARAMETER repeat_penalty 重复惩罚:减少重复输出 0.0 - 2.0 1.1
PARAMETER seed 随机种子:固定则输出确定 整数 随机
ADAPTER LoRA 适配器(微调) 路径 -

🚀 最优化利用建议

💬 对话助手

FROM qwen3
PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER num_ctx 4096
SYSTEM """
你是一个专业、友好的AI助手。
回答要简洁明了,不超过200字。
"""

💻 代码专家

FROM qwen3-coder-next
PARAMETER temperature 0.3
PARAMETER top_k 20
PARAMETER num_ctx 8192
SYSTEM """
你是资深程序员,精通多种语言。
代码要规范、注释清晰、考虑性能。
"""

📚 知识库问答

FROM qwen3
PARAMETER temperature 0.2
PARAMETER top_p 0.8
PARAMETER num_ctx 8192
SYSTEM """
基于以下知识库回答问题:
[这里可以内置常见问答]
只回答知识库相关的问题。
"""

🎨 创意写作

FROM qwen3
PARAMETER temperature 1.2
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1.2
SYSTEM """
你是创意作家,擅长各种文体。
发挥你的想象力,创造精彩内容。
"""

🔧 常用命令

# 1. 创建 Modelfile
vim ./my-model

# 2. 从 Modelfile 创建模型
ollama create my-assistant -f ./my-model

# 3. 查看模型信息
ollama show my-assistant

# 4. 运行自定义模型
ollama run my-assistant

# 5. 导出模型文件
ollama show my-assistant --modelfile

# 6. 复制模型
ollama cp my-assistant my-backup
Modelfile 工作流程
编写 Modelfile
ollama create
模型实例化
参数固化
ollama run

🗂️ 模型管理命令

查看与运行

ollama list        # 已下载列表
ollama ps          # 运行中的模型
ollama run qwen3

删除与复制

ollama rm qwen3           # 删除
ollama cp qwen3 my-copy   # 复制

搜索模型

ollama search qwen      # 搜索可下载
ollama search glm        # 搜索 GLM 系列

📈 模型加载时序图

Client
ollama run qwen3
Ollama
检查模型文件
Ollama
加载 GGUF/权重
GPU
初始化推理引擎
Client
Ready! 可交互