惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
NISL@THU
NISL@THU
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tenable Blog
Forbes - Security
Forbes - Security
V2EX - 技术
V2EX - 技术
Webroot Blog
Webroot Blog
Schneier on Security
Schneier on Security
T
The Exploit Database - CXSecurity.com
T
Tor Project blog
C
Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
PCI Perspectives
PCI Perspectives
O
OpenAI News
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
D
Docker
AI
AI
Blog — PlanetScale
Blog — PlanetScale
S
Security @ Cisco Blogs
S
Schneier on Security
The GitHub Blog
The GitHub Blog
W
WeLiveSecurity
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
C
Check Point Blog
A
About on SuperTechFans
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Engineering at Meta
Engineering at Meta
I
InfoQ
T
Threat Research - Cisco Blogs
Project Zero
Project Zero
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
Cisco Talos Blog
Cisco Talos Blog
L
Lohrmann on Cybersecurity
S
Securelist

博客园 - VipSoft

MinerU - 将非结构化文档(PDF、图片、Office 文件等)转换为机器可读的 Markdown 和 JSON LangChain 入门 服务端部署-FastAPI LangChain 入门 LangSmith LangChain 入门 实战 - 食谱推荐 LangChain 入门 Memory 会话记忆 LangChain 入门 Tools 工具 LangChain 入门 Tools 工具 LangChain 入门 Prompts 提示词 LangChain 入门 Message 消息 LangChain 入门 Model 的初始化和调用 LangChain 入门 Agent 的基本运行机制 AI 0基础学习,名词解析 LangChain 和 LangGraph AI大模型知识体系 Dify — Workflow - 数据可视化 Dify — 连接MySQL配置 Dify — Chatflow - 数据库智能查询 Dify — Chatflow - 文档知识库 Dify — Agent 智能体 高安全券码、注册码生成 Dify — 文本生成应用 Dify — 聊天助手 -- 知识库 Windows 下 Docker 安装 Dify Ollama — 命令 Ollama — 接口 Qwen — 自定义模型文件 Ollama Qwen — 安装测试 Ollama Windows 安装 & 指定安装目录 跟着AI学AI - 诊断结论信息抽取 - 批量处理脚本 跟着AI学AI - 诊断结论信息抽取 - 模型压缩与部署 跟着AI学AI - 诊断结论信息抽取 - 模型评估与调试 跟着AI学AI - 诊断结论信息抽取 - 模型训练 轻型民用无人驾驶航空器安全操控理论考试培训材料 FreeRedis Helper Windbg w3wp.DMP 内存分析 跟着AI学AI - 诊断结论信息抽取 - 数据增强 QQ 录屏软件 Java - 加权随机算法 - 示例 Java - 加权随机算法--Demo Java LoadBalanceUtil 负载均衡、轮询加权 SpringBoot 集成 IP2Region 获取IP地域信息 Windows 服务器和虚拟主机,创建.开头的文件夹 .well-known 跟着AI学AI - 诊断结论信息抽取 - 数据格式转换BERT训练格式 跟着AI学AI - 诊断结论信息抽取 - LabelStudio 标注 -- 结论标注 跟着AI学AI - 诊断结论信息抽取 - 学习路径 跟着AI学AI - UV 安装 数据标注工具 Label-Studio `VIRTUAL_ENV=venv` does not match the project environment 跟着AI学AI - 学习路径 - 命名实体识别(NER)和信息抽取(IE) 跟着AI学AI - 需要购买显卡吗? C# 无BOM的UTF-8编码 Vue ref reactive Vue - el-table 嵌套表 Spring `@Scheduled` 中这些参数的区别、组合和应用场景 Python 找出同步日志中的重复数据 Python - UV PyCharm 不能识别 .venv 的环境
Ollama — 为什么能够运行不同的模型
VipSoft · 2026-05-22 · via 博客园 - VipSoft

模型能在 Ollama 下运行,并不是因为它遵循了某种开源协议(如 GPL、MIT),而是因为它采用了与 Ollama 兼容的底层技术架构和文件格式

简单来说,Ollama 是一个“播放器”,而模型是“磁带”。只要磁带是按照播放器能读懂的规格(格式)录制的,就能运行。这背后的核心是 GGUF 格式Llama.cpp 架构

一、核心原因:GGUF 格式与 Llama.cpp 生态

Ollama 的底层引擎是基于 Llama.cpp 的。Llama.cpp 定义了一套通用的模型格式标准(GGUF),任何模型只要被转换成这种格式,就能被 Ollama 加载。

  1. GGUF 格式(Granite Graph Unified Format)

    • 这是 Llama.cpp 生态的通用容器格式。它包含了模型的权重、架构配置(如层数、注意力头数)、分词器(Tokenizer)信息等。
    • 只要模型被量化并打包成 .gguf 文件,Ollama 就能识别并运行它。
  2. 转换门槛低

    • 许多非 Meta 的模型(如 Qwen、DeepSeek)在发布时,除了原版 PyTorch 格式,也会主动提供 GGUF 版本,或者社区会有热心人进行转换。这使得它们能无缝接入 Ollama。

二、为什么感觉“什么模型都能跑”?

你之所以能在 Ollama 里跑 Qwen、Gemma 等非 Meta 模型,是因为它们都满足了这个底层兼容性:

模型类型 如何兼容 Ollama
Meta Llama 系列 原生支持,Ollama 就是为它设计的。
其他开源模型(Qwen, Gemma, Phi) 通过工具(如 llama.cppconvert.py)将其 PyTorch 权重转换为 GGUF 格式。
自定义微调模型 只要基座模型是兼容的(如 Llama),微调后的模型(如 Alpaca)结构不变,依然是 GGUF 格式,因此可直接运行。

三、协议 vs 架构:关键区别

这是一个常见的误解,需要把“法律”和“技术”分开看:

  • 开源协议(License):如 MIT、Apache 2.0、GPL。这规定了你如何使用、修改和分发模型的代码/权重。它不决定模型能不能在某个软件里运行。
  • 技术架构(Architecture):如 Transformer 架构、GGUF 格式。这才是决定兼容性的关键。

举个例子:Qwen 用的是 MIT 协议,Llama 2 用的是自定义商业协议。虽然协议不同,但只要它们的文件都是 GGUF 格式,就都能在基于 Llama.cpp 的 Ollama 上运行。

四、Ollama 的 Modelfile:描述而非限制

当你看到 Ollama 的 Modelfile 时,它并不是在“编译”模型,而是在描述如何加载一个已有的 GGUF 文件。它指定了基础镜像(FROM)、参数设置(PARAMETER)等,这类似于 Dockerfile 描述如何构建镜像,但底层的镜像(模型文件)本身已经是可执行格式了。

总结

模型能在 Ollama 下运行,是因为它们都被转换成了 GGUF 格式,并遵循了相同的模型加载接口。这更像是一个技术生态的兼容性问题(类似于 Android 手机能安装各种 APK),而非法律协议问题。

只要模型作者或社区愿意提供一个 GGUF 格式的版本,这个模型就能加入 Ollama 的“全家桶”。