GPT中文GPT中文论坛社区AI工具软件大全 GPT.CC Claude Fable 5 · GPT-5.6 直连,不用连国际网 去看看 →
AI工具软件大全
首页 / GitHub 项目 / llama.cpp

llama.cppggml-org/llama.cpp

在自己电脑上跑大模型的开源工具,帮你在本地运行 AI 模型

★ 13.6 万 星 本周 +1,453 C++ 开源许可 MIT · 商用可以 最近更新 2026-11-22 官方仓库 → 官网 →
01

llama.cpp 是干什么的

llama.cpp 是一个开源工具,目的是让普通电脑也能跑起大语言模型(就是像 ChatGPT 背后那种会聊天、会写作的 AI)和能看图的视觉模型。它的最大好处是需要的准备工作少,适配的硬件范围广,可以完全在本地运行,数据不用发到别人的服务器上。

它用 C/C++ 写成,不依赖别的库,对苹果芯片做了专门的加速,也支持 NVIDIA、AMD 等显卡,甚至能在内存不够时让处理器和显卡分工干活。装好后可以直接用命令行和模型对话,还自带一个网页界面,也能把它当接口服务调用。

02

llama.cpp 主要功能

本地跑大模型不用联网,直接在自己电脑上加载并运行大语言模型和多模态模型。
硬件范围广从普通电脑到多显卡服务器都能用,目标是尽量少折腾就有不错的速度。
自带聊天工具提供命令行对话和内置聊天应用,装好后可以直接和模型聊天。
服务接口可以把模型跑成一个本地服务,供其他程序调用,方便做二次开发。
语音与格式控制支持文字转语音模型,也能用语法规则约束模型输出格式。
多平台安装包提供 Windows、macOS、Linux、Android 等平台的现成安装包,也有 Docker 方式。
03

llama.cpp 使用案例 — 能拿来做成什么

案例 1命令行里和模型对话

普通用户在电脑上装好后,用命令行工具直接和本地模型进行对话。

案例 2内置聊天应用聊天

通过内置的聊天应用连接本地服务,像用聊天软件一样和模型交流。

案例 3多模态看图对话

用命令行工具加载多模态模型,进行带图片的对话会话。

案例 4多显卡跑大模型

有多块显卡的用户可以按文档配置多显卡,一起分担模型计算。

案例来自项目官方说明里举的例子和演示,不是本站编的。

04

llama.cpp 怎么下载安装

用之前要准备:需要一台性能尚可的电脑;要用显卡加速的话需要对应显卡驱动;部分模型能用压缩版降低内存占用,但大模型仍要求较高内存或显存

也可以用命令装:

Mac / Linux 一键脚本
curl -LsSf https://llama.app/install.sh | sh
Windows 一键脚本(PowerShell)
irm https://llama.app/install.ps1 | iex

命令原样摘自项目官方说明,本站没有改动。

05

llama.cpp 适合谁用

想本地跑模型的人注重隐私的开发者
06

llama.cpp 好在哪、用之前要注意什么

好在哪

  • 完全在本地运行,数据不用传到外面
  • 支持平台多,Windows、mac、Linux、安卓都有包
  • 开源免费,MIT 许可,商用限制少
  • 社区活跃,星数超过 13 万

要注意

  • 想跑得快通常需要独立显卡
  • 命令行工具为主,需要一点动手能力
  • 版本号还是 b 开头,仍在快速迭代
07

llama.cpp 免费吗?能不能商用?

要钱吗开源免费
开源许可MIT
能不能商用可以

随便用、随便改,也能用在公司产品里,只要保留原作者的版权声明。

以上是对许可证的通俗解释,不是法律意见;正式商用以官方仓库的 LICENSE 文件为准。

08

llama.cpp 最近更新 — 版本动态

最新版 b12633 改了啥
  • 修了 WebGPU 和部分设备上清零计算不正确的问题
  • 同步放出 macOS、iOS、Linux 各平台的新版安装包
09

llama.cpp 大家常问

要花钱吗?

不要,项目是 MIT 开源许可,可以免费使用,也能用于商业场景。

必须要有显卡吗?

不是必须,CPU 也能跑;但想速度快、跑大一点的模型,最好有独立显卡。

Windows 能用吗?

能,官方提供 Windows 安装包,macOS、Linux、Android 也都有对应版本。

数据会不会传到网上?

项目主打本地运行,模型和数据都在你自己机器上,不需要上传到外部服务。

支持中文吗?

能不能用中文主要看加载的模型本身,工具不限制语言,选支持中文的模型即可。

10

llama.cpp 怎么样 — 大家怎么说

下面是海外开发者在 Hacker News(国外程序员常去的技术论坛)上讨论这个项目的真实评论,按讨论热度挑选,中文由 AI 翻译,点「看原文」可以对照英文。

S simonw Hacker News
Georgi Gerganov 和 llama.cpp 对本地模型领域的影响怎么强调都不过分。2023 年 3 月基本是他掀起了这场革命,让 LLaMA 能在消费级笔记本上跑起来。这是 2023 年 3 月 10 日那份 README https://github.com/ggml-org/llama.cpp/blob/775328064e69db1ebd7e19ccb59d2a7fa6142470/README.md > 主要目标是在 MacBook 上用 4 位量化运行模型。[...] 这是一个晚上随手搞出来的——我完全不知道它能不能正确工作。 Hugging Face 一直是 Transformers 很出色的开源管理者,我乐观地认为 GGML 也会如此。我在这里写了一点相关内容:https://simonwillison.net/2026/Feb/20/ggmlai-joins-hugging-face/
看原文

It's hard to overstate the impact Georgi Gerganov and llama.cpp have had on the local model space. He pretty much kicked off the revolution in March 2023, making LLaMA work on consumer laptops. Here's that README from March 10th 2023 https://github.com/ggml-org/llama.cpp/blob/775328064e69db1ebd7e19ccb59d2a7fa6142470/README.md > The main goal is to run the model using 4-bit quantization on a MacBook. [...] This was hacked in an evening - I have no idea if it works correctly. Hugging Face have been a great open source steward of Transformers, I'm optimistic the same will be true for GGML. I wrote a bit about this here: https://simonwillison.net/2026/Feb/20/ggmlai-joins-hugging-face/

2026-02-20 · 25 条回复 · 出处 · 帖子:Ggml.ai joins Hugging Face to ensure the long-term progress of Local AI
T tkp-415 Hacker News
有人能指点一下吗:在算力不太强的系统上(比如 8GB 内存的 Macbook M1),怎么在类似 Docker 容器里高效地在本地跑一个模型?我唯一的选择是不是只能花钱买算力更强的系统?这些本地模型看起来很棒,尤其是像 https://huggingface.co/AlicanKiraz0/Cybersecurity-BaronLLM_Offensive_Security_LLM_Q6_K_GGUF 这种可以辅助渗透测试的。我在本地系统上试过各种配置,但最后它就变成了一台临时暖风机。
看原文

Can anyone point me in the direction of getting a model to run locally and efficiently inside something like a Docker container on a system with not so strong computing power (aka a Macbook M1 with 8gb of memory)? Is my only option to invest in a system with more computing power? These local models look great, especially something like https://huggingface.co/AlicanKiraz0/Cybersecurity-BaronLLM_Offensive_Security_LLM_Q6_K_GGUF for assisting in penetration testing. I've experimented with a variety of configurations on my local system, but in the end it turns into a make shift heater.

2026-02-20 · 17 条回复 · 出处 · 帖子:Ggml.ai joins Hugging Face to ensure the long-term progress of Local AI
N nico Hacker News
这和通过 ollama 使用 gemma3 这类多模态模型相比怎么样?在 Apple 芯片的 Mac 上有优势吗?有人能分享一下经验吗?
看原文

How does this compare to using a multimodal model like gemma3 via ollama? Any benefit on a Mac with apple silicon? Any experiences someone could share?

2025-05-10 · 12 条回复 · 出处 · 帖子:Vision Now Available in Llama.cpp
D danielhanchen Hacker News
效果非常好!你需要从源码编译 llama.cpp,然后应该会得到一个 llama-mtmd-cli 程序。我做了一些支持视觉的量化版本——直接运行: ./llama.cpp/llama-mtmd-cli -hf unsloth/gemma-3-4b-it-GGUF:Q4_K_XL -ngl -1 ./llama.cpp/llama-mtmd-cli -hf unsloth/gemma-3-12b-it-GGUF:Q4_K_XL -ngl -1 ./llama.cpp/llama-mtmd-cli -hf unsloth/gemma-3-27b-it-GGUF:Q4_K_XL -ngl -1 ./llama.cpp/llama-mtmd-cli -hf unsloth/unsloth/Mistral-Small-3.1-24B-Instruct-2503-GGUF:Q4_K_XL -ngl -1 然后在对话里用 /image image.png 加载图片,就可以聊了! 补充:Metal 后端已经不再需要 -ngl -1 了(CUDA 仍需要)(llama.cpp 现在默认会自动卸载到 GPU!)。-1 的意思是把所有 GPU 层都卸载到 GPU 上。
看原文

It works super well! You'll have to compile llama.cpp from source, and you should get a llama-mtmd-cli program. I made some quants with vision support - literally run: ./llama.cpp/llama-mtmd-cli -hf unsloth/gemma-3-4b-it-GGUF:Q4_K_XL -ngl -1 ./llama.cpp/llama-mtmd-cli -hf unsloth/gemma-3-12b-it-GGUF:Q4_K_XL -ngl -1 ./llama.cpp/llama-mtmd-cli -hf unsloth/gemma-3-27b-it-GGUF:Q4_K_XL -ngl -1 ./llama.cpp/llama-mtmd-cli -hf unsloth/unsloth/Mistral-Small-3.1-24B-Instruct-2503-GGUF:Q4_K_XL -ngl -1 Then load the image with /image image.png inside the chat, and chat away! EDIT: -ngl -1 is not needed anymore for Metal backends (CUDA still yes) (llama.cpp will auto offload to the GPU by default!). -1 means all GPU layers offloaded to the GPU.

2025-05-10 · 12 条回复 · 出处 · 帖子:Vision Now Available in Llama.cpp
H hodgehog11 Hacker News
我很感激 Mistral(以及其他公司)免费发布他们的权重。但考虑到 llama.cpp 是很多让用户运行开放权重模型的程序的基础,那些吹嘘向社区发布模型的公司却把社区晾在一边,让社区自己慢慢琢磨怎么真正实现他们的模型,这有点令人沮丧。我听说原因是 llama.cpp 老是弄坏基础功能,所以他们成了不可靠的合作伙伴。看来这正是 Ollama 试图解决的问题——他们淡化与 llama.cpp 的联系,直接联系训练这些模型的公司,以实现同步发布(比如 GPT-OSS)。
看原文

I appreciate Mistral (and others) releasing their weights for free. But given how llama.cpp underpins a lot of the programs which allow users to run open weight models, it is a little frustrating to have companies which brag about releasing models to the community, leave the community to their own devices to slowly try and actually implement their models. I hear the reason for this is that llama.cpp keeps breaking basic things, so they have become an unreliable partner. Seems this is what Ollama is trying to address by diluting their connections to llama.cpp and directly contacting companies training these models to have simultaneous releases (e.g. GPT-OSS).

2025-08-11 · 10 条回复 · 出处 · 帖子:Mistral Integration Improved in Llama.cpp
不用注册 · 只需算术验证 · 审核后展示
11

llama.cpp 项目数据

13.6 万星标(收藏数)
+914近 7 天新增星标
+1,453本周新增星标
2.6 万被复制改造(fork)
2,641待处理的问题和建议
2023-03-10项目建立
2026-11-22最近一次改代码

数据来自 GitHub,本站每周核对一次,最近核对于 2026-11-22。

介绍、功能、案例、优缺点和常见问题由 AI 根据项目官方说明改写成中文;星数、版本、安装包来自 GitHub;评论来自 Hacker News 原帖(附出处)和本站用户(审核后展示)。核对于 2026-11-22。功能和用法以 官方仓库 为准。
← 回 GitHub 热门 · 最新冒头 · 安装最多