频道:@DavidOndrej · 时长:23:38
| 项目 | 内容 |
|---|---|
| 视频标题 | Google just destroyed all open-source models (Gemma 4) |
| 视频ID | HdohxOTO6lo |
| 频道 | @DavidOndrej |
| 时长 | 23:38 |
| 主题 | Gemma 4 开源模型的能力分析、在 MacBook 和 iPhone 上的本地部署、与 Hermes Agent 集成的完整教程 |
| 视频链接 | https://www.youtube.com/watch?v=HdohxOTO6lo |
“Google 用 Gemma 4 震撼了整个 AI 行业。这是一个能力极强的全新开源模型,疯狂的部分是——它能在你的手机上跑。Gemma 4 可能为你省下几百美元,因为你不再需要为 ChatGPT 付费。”
David 这期视频讲了一个 AI 行业默契地不太愿意谈的话题:本地模型。
如果你能在自己的笔记本上跑 AI,OpenAI、Anthropic 的商业模式就会受到挑战。所以大公司有动机让你以为”本地模型不好用”。但 Gemma 4 改变了这件事。它的31B dense 模型在 Arena benchmark 上排名第 3 名——击败了所有 700B 参数级别的开源模型。
视频教你: - Gemma 4 的 4 个版本(E2B/E4B/26B/31B)和该选哪个 - 在 MacBook 上用 Ollama 跑 Gemma 4 31B - 在 iPhone / Android 上用 Google AI Edge Gallery 跑 Gemma 4 E4B - 把 Gemma 4 接入 Hermes Agent 作为本地代理 - Dense vs Mixture of Experts 架构区别
这是一份”用 AI 不用为 AI 付费”的可行性报告。
对比 Gemma 3(去年的开源模型)到 Gemma 4: - 健康知识:大幅提升 - 整体文本:大幅提升 - 创意写作:大幅提升 - 指令跟随:大幅提升 - 多轮对话:大幅提升 - 数学:大幅提升 - 软件代码:大幅提升
“Needless to say, this is a huge, maybe even the biggest improvement in open source since the release of DeepSeek.”
Gemma 4 31B(dense 模型)在 LMArena 上排名第 3——这意味着它打败了所有 700 billion 参数级别的开源模型。
“It’s even defeating like 700 billion parameter models, which is just unheard of in the realm of open-source models.”
Gemma 4 31B 31 亿参数 vs Kimi K2.5 1.1 万亿参数——智能水平相同。
这意味着 Google 在参数效率上取得了 ~30 倍的领先。
Gemma 系列从一开始就是多模态的: - 音频输入 - 图像输入 - 视频输入 - 文本输出
视频里展示了一个开发者用 Gemma 4 E2B(最小版本)构建的实时图像分类器——边看屏幕边描述用户在做什么,几乎零延迟。
过去 5 年,本地 AI 模型的流行度直线上升。
“If you’re not running any AI models locally, you’re falling behind.”
| 版本 | 参数 | 架构 | 适合设备 |
|---|---|---|---|
| Gemma 4 E2B | 2B effective | MoE | 手机 |
| Gemma 4 E4B | 4B effective | MoE | 手机(推荐) |
| Gemma 4 26B | 26B (~3B active) | MoE | 笔记本(16GB+ RAM) |
| Gemma 4 31B | 31B all active | Dense | 高端笔记本(24GB+ VRAM) |
Dense(密集)模型: - 所有参数在每个 token 生成时都激活 - 31B = 每次推理都用全部 31B 参数 - 更可预测的行为 - 但运行成本高
MoE(Mixture of Experts,专家混合)模型: - 总参数大但每次只激活一部分 - 26B 模型可能每次只激活 ~3B 参数 - 更稀疏的架构 - 运行速度快得多,因为不需要全部参数都参与
“E” = Effective(有效参数)。这是 MoE 模型常用的标记方式——名义参数总量很大,但有效激活的只有这么多。
| 你的设备 | 推荐 |
|---|---|
| iPhone / Android | E4B(如果存储够;3.6GB) |
| 旧手机 / 存储紧张 | E2B(2.5GB) |
| MacBook Air 8GB | E4B 或 26B |
| MacBook Pro 16GB | 26B |
| MacBook Pro 24GB+ | 31B Dense(最强) |
| Windows + Nvidia 24GB VRAM | 31B Dense |
| 工具 | 优势 | 劣势 |
|---|---|---|
| Ollama | 最简单 | 比 llama.cpp 慢一点 |
| llama.cpp | 最快 | 配置复杂 |
| LM Studio | 有 GUI | 默认设置不够灵活 |
David 演示用 Ollama——理由:简单、文档清晰、生态最广。
“Stop being afraid of the terminal. It’s the easiest way to interact with your computer.”
Mac:Spotlight 搜 “terminal” Windows:Win+R 输入 cmd 任何系统:直接问 AI:“How do I open the terminal on my [系统] system?”
回到 Ollama 网站,左上 Models,找到 Gemma 4,复制模型名称:
ollama run gemma4:31b或者更小的版本:
ollama run gemma4:26b
ollama run gemma4:e4b
ollama run gemma4:e2b首次运行会下载:根据你的网络,5~15 分钟。
ollama list会列出所有你下载过的模型。
David 在 MacBook 上跑 Gemma 4 31B: > “I think this is like 40~50 tokens per second, and it’s fully loaded on my MacBook.”
40~50 tokens/秒 = 完全够用的对话体验,接近 ChatGPT 的速度。
“GPT-4 was like the first model that was officially above 1 trillion parameters, and just 2 and a half years ago, that was the greatest model in the world. And now we’re running these on our laptops.”
让这件事的重要性沉淀一下:2.5 年前世界上最强的 AI 模型,现在你笔记本就能跑。
bye 退出 Ollama CLIollama launch cloud)官方 App,完全免费: - iOS:App Store 搜 “Google AI Edge Gallery” - Android:Google Play 搜 “Google AI Edge Gallery”
打开 App 后会看到一堆模型——注意区分: - 底部两个是 Gemma 3(去年的,别用) - 顶部两个是 Gemma 4(今年的,要用)
更具体: - Gemma 4 E2B:2.5GB 存储 - Gemma 4 E4B:3.6GB 存储(推荐如果你存储够)
David 在 iPhone 16 Pro Max 上跑 E4B: > “This is like 40 tokens per second, all running on my iPhone. I have a 16 Pro Max so it’s not even the latest generation. This is usable.”
40 tokens/秒 = 完全可用。
“If you’re in a forest and you get injured, you got a broken leg, you don’t have a signal—this could actually save your life.”
但对于 90% 的日常使用,Gemma 4 在手机上就够了。
视频里展示了 Steve Vibe 的测试结果——让 Gemma 4 复刻参考网页设计。
“If you’re on a long flight and you want to keep building your app, you can plug this into Cursor, into Open Code, into Hermes Agent and keep building.”
Gemma 4 的代码能力对 20~30B 参数级别的模型来说惊人地强。
你已经知道怎么在终端聊 Gemma 4。下一步:让 Gemma 4 作为一个完整 AI 代理运行——能读文件、跑命令、写代码。
Hermes Agent 是 Open Claw 的”前身”之一(比 Open Claw 重量级,比 Pi 重量级)。把 Gemma 4 接入它 = 你有了一个完全本地、零联网、零费用的 AI 代理。
打开终端:
ollama serve如果显示”address already in use”——好事,说明 Ollama 已经在跑。
David 建议用 IDE(Cursor 或 VS
Code)打开你的目标文件夹,然后用集成终端: - ls
看当前目录内容 - cd testing 进入子目录 - 粘贴 Hermes
install 命令
hermes version
hermes updatehermes model会列出可选 providers。滚动到底部选 “Custom Endpoint, enter URL manually”。
输入:
localhost:11434/v1
注意:必须完全准确——localhost:11434/v1。11434
是 Ollama 默认端口。
API Key 留空(本地无需 key),回车。
Hermes 会自动检测 Ollama 上可用的模型并列出。选你想用的编号(比如 Gemma 4 31B 是 1): - Context length:Auto-detect
完成。
hermes启动 Hermes Agent,使用 Gemma 4 31B 作为本地大脑。
测试 prompt:
hey
第一次 prompt 会慢——因为 Hermes 的 system prompt 大约 12,000 tokens,模型要先把全部上下文加载进内存。
后续 prompts 会快得多。
show me the contents of your .hermes folder as a file tree
Gemma 4 应该会调用 bash 工具列出文件夹结构。如果成功,你已经有了一个完全本地的 AI 代理。
David 在视频里坦诚: - Hermes + Gemma 4 31B:有点慢 - 主要瓶颈是 12k token 的 Hermes system prompt + 本地推理速度 - PiDev 因为只有 1k system prompt,更适合本地模型
| 用例 | 推荐 |
|---|---|
| 完全本地 + 重型代理 | Hermes Agent + Gemma 4 31B |
| 完全本地 + 轻型代理 | Pi Agent + Gemma 4 26B |
| 偶尔本地(飞机上) | Cursor + Ollama + Gemma 4 |
MLX 是 Apple 自己开发的机器学习框架,专为 M 系列芯片优化。
Gemma 4 发布后 12 小时内,开发者 Prince Canuma(波兰 Kraków 的开发者)就为 Gemma 4 添加了 MLX 支持。
这意味着: - 在 M 系列 Mac 上,MLX 版本比标准版快很多 - 适合 M1/M2/M3/M4/M5 用户优化推理速度
“I’m going to be building an office in Katowice. If you are an AI first developer, someone who’s really technical, DM me on Instagram or Twitter.”
David 在视频里宣布要在波兰 Katowice 建一个 AI 优先的精英团队,招技术深度强的开发者。
“You just paying couple thousand dollars for a powerful machine, and then never having to pay the subscriptions ever again. This is what OpenAI fears.”
但要诚实——本地模型也有成本: - 电费:长时间跑大模型耗电不少 - 时间成本:调试、维护、更新 - 机会成本:本地模型在最难任务上不如 SOTA
不是非此即彼: - 日常任务(90%):本地 Gemma 4 - 难任务(10%):云端 Opus 4.6 / GPT-5.4
这样你的订阅可以从 Plus / Pro 降到 Go ($8/月),长期省下大笔钱。
应该用本地模型的场景: - 涉及商业机密的对话 - 涉及法律风险的咨询 - 涉及个人隐私的问题 - 涉及未发布产品的讨论 - 涉及政治敏感话题的讨论
回看教程 17(Mythos 那期),David 警告说云端 LLM 可能被滥用。Gemma 4 本地化是一个具体的应对方案。
| 概念 | 解释 |
|---|---|
| Gemma 4 | Google 2026 年发布的开源模型 |
| Dense 模型 | 所有参数每次都激活 |
| MoE(Mixture of Experts) | 每次只激活部分专家参数 |
| E2B / E4B | Effective 2B / 4B 参数,手机版 |
| 26B / 31B | 笔记本版(26B 是 MoE,31B 是 Dense) |
| Ollama | 最简单的本地 LLM 运行工具 |
| llama.cpp | 最快的本地 LLM 运行库 |
| LM Studio | 带 GUI 的本地 LLM 工具 |
| Google AI Edge Gallery | 官方手机端本地模型 App |
| MLX | Apple Silicon 优化的 ML 框架 |
ollama list |
列出已下载的模型 |
ollama run <model> |
运行模型 |
ollama serve |
启动 Ollama HTTP server |
localhost:11434/v1 |
Ollama 默认 endpoint |
ollama run
比下载 App 快多了ollama run gemma4:31bollama listlocalhost:11434/v1)| 资源 | 说明 |
|---|---|
| ollama.com | Ollama 官方网站 |
| huggingface.co | Hugging Face,所有开源模型托管 |
| ai.google.dev/gemma | Gemma 系列官方文档 |
| Google AI Edge Gallery(App Store) | iOS 手机端 |
| Google AI Edge Gallery(Google Play) | Android 手机端 |
| github.com/ggerganov/llama.cpp | llama.cpp 源代码 |
| lmstudio.ai | LM Studio 官方 |
| Prince Canuma Twitter | MLX 适配作者 |
| Supabase | 开源数据库(视频赞助商,配合本地 AI 用) |
| The New Society | David 的 AI 编程付费社区 |
“And again, all of this data stays private on your machine. You’re not sending it to Sam Altman or Dario Amodei or Mark Zuckerberg.”
Gemma 4 的真正意义不在跑分多高,而在它重新定义了 AI 工具的所有权关系: - 在 OpenAI 主导的世界里,AI 是一种服务,你租用 - 在 Gemma 4 时代,AI 是一种资产,你拥有
这种所有权的转移在几个维度上都很关键: 1. 经济维度:长期成本下降 2. 隐私维度:数据不离开你 3. 可靠性维度:不依赖云端可用性 4. 独立性维度:不被任何公司单方面定义
今晚的行动: 1. 安装 Ollama 2. 跑
ollama run gemma4:26b(或 31B 如果你硬件够) 3. 在手机上装
Google AI Edge Gallery 4. 下载 E4B 模型 5. 把你 ChatGPT Plus
的订阅降级到 Go ($8/月)——你不需要 $20 了
省下的钱拿去买 OpenRouter API 额度,让你的本地 + 云端混合策略真正跑起来。