llama.cpp

ggml-org / llama.cpp

llama.cpp 是一个用 C/C++ 实现的 LLM 推理引擎,专注于在本地设备上高效运行大语言模型,支持量化和多平台部署。

C++ AI 基础设施 LLM 应用 开发工具 LLM 推理 C/C++ 量化和加速 本地部署 GGUF

为什么值得看

编辑点评

它是本地部署 LLM 的事实标准,性能优化出色,支持从树莓派到服务器的各类硬件,尤其是 CPU 和 Apple Silicon。社区活跃,模型格式 GGUF 生态完善。适合想要离线运行模型、学习推理加速或做边缘部署的开发者。注意版本迭代快,接口变化频繁,需关注更新。

Star 趋势

近 7 日
  • Star 总数128,457
  • 今日新增+68
  • 7 日增速+36%
  • Fork23,271

同类项目

同场景 · AI 基础设施 / LLM 应用 / 开发工具

项目文档

来自 GitHub README · master 分支

llama.cpp

llama

LLM inference in C/C++

ggml / ops / maintainer PRs / dev stats / lib llama API / llama-server REST API

Quick start

A few options to get llama.cpp installed on your machine:

Once installed:

# Download and run a model directly from Hugging Face
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF

# Launch OpenAI-compatible API server
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF
VLM session with llama cli Built-in web UI against llama serve
## Description The main goal of `llama.cpp` is to enable LLM (and VLM) inference with minimal setup and state-of-the-art performance on a wide range of hardware - locally and in the cloud. - Plain C/C++ implementation without any dependencies - Apple silicon is a first-class citizen - optimized via ARM NEON, Accelerate and Metal frameworks - AVX, AVX2, AVX512 and AMX support for x86 architectures - RVV, ZVFH, ZFH, ZICBOP and ZIHINTPAUSE support for RISC-V architectures - 1.5-bit, 2-bit, 3-bit, 4-bit, 5-bit, 6-bit, and 8-bit integer quantization for faster inference and reduced memory use - Custom CUDA kernels for running LLMs on NVIDIA GPUs (support for AMD GPUs via HIP and Moore Threads GPUs via MUSA) - Vulkan and SYCL backend support - CPU+GPU hybrid inference to partially accelerate models larger than the total VRAM capacity The `llama.cpp` project is build on top of the [ggml](https://github.com/ggml-org/ggml) library. ## Supported backends | Backend | Target devices | | --- | --- | | [BLAS](docs/build.md#blas-build) | All | | [BLIS](docs/backend/BLIS.md) | All | | [CANN](docs/build.md#cann) | Ascend NPU | | [CUDA](docs/build.md#cuda) | Nvidia GPU | | [HIP](docs/build.md#hip) | AMD GPU | | [Hexagon](docs/backend/snapdragon/README.md) | Snapdragon | | [IBM zDNN](docs/backend/zDNN.md) | IBM Z & LinuxONE | | [MUSA](docs/build.md#musa) | Moore Threads GPU | | [Metal](docs/build.md#metal-build) | Apple Silicon | | [OpenCL](docs/backend/OPENCL.md) | Adreno GPU | | [OpenVINO [In Progress]](docs/backend/OPENVINO.md) | Intel CPUs, GPUs, and NPUs | | [RPC](https://github.com/ggml-org/llama.cpp/tree/master/tools/rpc) | All | | [SYCL](docs/backend/SYCL.md) | Intel GPU | | [VirtGPU](docs/backend/VirtGPU.md) | VirtGPU APIR | | [Vulkan](docs/build.md#vulkan) | GPU | | [WebGPU](docs/build.md#webgpu) | All | | [ZenDNN](docs/build.md#zendnn) | AMD CPU | ## Documentation #### Tools - [cli](tools/cli/README.md) - [completion](tools/completion/README.md) - [server](tools/server/README.md) - [GBNF grammars](grammars/README.md) #### Development - [How to build](docs/build.md) - [Running on Docker](docs/docker.md) - [Build on Android](docs/android.md) - [Multi-GPU usage](docs/multi-gpu.md) - [Performance troubleshooting](docs/development/token_generation_performance_tips.md) - [GGML tips & tricks](https://github.com/ggml-org/llama.cpp/wiki/GGML-Tips-&-Tricks) - [XCFramework](docs/xcframework.md) - [Completions](docs/completions.md) - [Models](docs/models.md) - [Release process](docs/release.md) ## Contributing - Contributors can open PRs - Collaborators will be invited based on contributions - Maintainers can push to branches in the `llama.cpp` repo and merge PRs into the `master` branch - Any help with managing issues, PRs and projects is very appreciated! - Read the [CONTRIBUTING.md](CONTRIBUTING.md) for more information ## Acknowledgements - [yhirose/cpp-httplib](https://github.com/yhirose/cpp-httplib) - Single-header HTTP server, used by `llama-server` - MIT license - [nothings/stb](https://github.com/nothings/stb) - Single-header image format decoder, used by multimodal subsystem - Public domain - [nlohmann/json](https://github.com/nlohmann/json) - Single-header JSON library, used by various tools/examples - MIT License - [mackron/miniaudio](https://github.com/mackron/miniaudio) - Single-header audio format decoder, used by multimodal subsystem - Public domain - [sheredom/subprocess.h](https://github.com/sheredom/subprocess.h) - Single-header process launching solution for C and C++ - Public domain

文档抓取自 GitHub 仓库 README,版权归原作者所有;已过滤徽章等噪音并经安全消毒后展示。