char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Georgi Gerganovdocs : update maintainer PRs link and regenerate AUTHORS (#28365)a529af96e

char/aliceai-t5-moe
7.2 KiB126 linesraw

llama.cpp

llama

<div align="center">

<b>LLM inference in C/C++</b>

License: MIT Release Nightly Server Docker Winget

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

</div>

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
<table align="center"> <tr> <td align="center" width=50%> <img width="1310" height="888" alt="VLM session with `llama cli`" src="https://github.com/user-attachments/assets/88726b48-1713-48aa-a525-95a02e78afc4" /> <i>VLM session with <b>llama cli</b></i> </td> <td align="center"> <img width="1392" height="958" alt="Built-in web UI against `llama serve` running Qwen 3.6" src="https://github.com/user-attachments/assets/b402f972-2e32-4def-8771-8d849f08cf2e" /> <i>Built-in web UI against <b>llama serve</b></i> </td> </tr> <table>

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 library.

Supported backends

BackendTarget devices
BLASAll
BLISAll
CANNAscend NPU
CUDANvidia GPU
HIPAMD GPU
HexagonSnapdragon
IBM zDNNIBM Z & LinuxONE
MUSAMoore Threads GPU
MetalApple Silicon
OpenCLAdreno GPU
OpenVINO [In Progress]Intel CPUs, GPUs, and NPUs
RPCAll
SYCLIntel GPU
VirtGPUVirtGPU APIR
VulkanGPU
WebGPUAll
ZenDNNAMD CPU

Documentation

Tools

Development

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 for more information

Acknowledgements

  • yhirose/cpp-httplib - Single-header HTTP server, used by llama-server - MIT license
  • nothings/stb - Single-header image format decoder, used by multimodal subsystem - Public domain
  • nlohmann/json - Single-header JSON library, used by various tools/examples - MIT License
  • mackron/miniaudio - Single-header audio format decoder, used by multimodal subsystem - Public domain
  • sheredom/subprocess.h - Single-header process launching solution for C and C++ - Public domain
1# llama.cpp
2
3![llama](https://raw.githubusercontent.com/ggml-org/llama.brand/refs/heads/master/cover/llama-cpp/cover-llama-cpp-dark.svg)
4
5<div align="center">
6
7<b>LLM inference in C/C++</b>
8
9[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
10[![Release](https://img.shields.io/github/v/release/ggml-org/llama.cpp?filter=v*&color=brightgreen)](https://github.com/ggml-org/llama.cpp/releases?q=tag:v0)
11[![Nightly](https://img.shields.io/github/v/release/ggml-org/llama.cpp?label=nightly&filter=b*&color=orange)](https://github.com/ggml-org/llama.cpp/releases?q=b)
12[![Server](https://img.shields.io/github/actions/workflow/status/ggml-org/llama.cpp/server.yml?label=Server)](https://github.com/ggml-org/llama.cpp/actions/workflows/server.yml)
13[![Docker](https://img.shields.io/github/actions/workflow/status/ggml-org/llama.cpp/docker.yml?label=Docker)](https://github.com/ggml-org/llama.cpp/actions/workflows/docker.yml)
14[![Winget](https://img.shields.io/github/actions/workflow/status/ggml-org/llama.cpp/winget.yml?label=Winget)](https://github.com/ggml-org/llama.cpp/actions/workflows/winget.yml)
15
16[ggml](https://github.com/ggml-org/ggml) / [ops](https://github.com/ggml-org/llama.cpp/blob/master/docs/ops.md) / [maintainer PRs](https://github.com/ggml-org/llama.cpp/issues?q=is%3Apr%20is%3Aopen%20draft%3AFalse%20(author%3Argerganov%20OR%20author%3AKitaitiMakoto%20OR%20author%3Adanbev%20OR%20author%3Aaldehir%20OR%20author%3Amax-krasnyansky%20OR%20author%3ACISC%20OR%20author%3Aggerganov%20OR%20author%3Aam17an%20OR%20author%3Ajhen0409%20OR%20author%3Abartowski1182%20OR%20author%3Anikwen%20OR%20author%3Ahipudding%20OR%20author%3Aravi9%20OR%20author%3AServeurpersoCom%20OR%20author%3Apwilkin%20OR%20author%3Areeselevine%20OR%20author%3Angxson%20OR%20author%3Ajeffbolznv%20OR%20author%3Amarty1885%20OR%20author%3A0cc4m%20OR%20author%3ATitaniumtown%20OR%20author%3Aangt%20OR%20author%3AIMbackK%20OR%20author%3Aarthw%20OR%20author%3AJohannesGaessler%20OR%20author%3AORippler%20OR%20author%3Aruixiang63%20OR%20author%3Axctan%20OR%20author%3Aallozaur%20OR%20author%3Ayomaytk%20OR%20author%3Aaendk%20OR%20author%3Awine99%20OR%20author%3Agaugarg-nv%20OR%20author%3Ataronaeo%20OR%20author%3Aforforever73%20OR%20author%3Alhez%20OR%20author%3Anetrunnereve%20OR%20author%3Afairydreaming)%20sort%3Aupdated-desc) / [dev stats](https://github.com/ggml-org/llama.cpp-dev) / [lib llama API](https://github.com/ggml-org/llama.cpp/issues/9289) / [llama-server REST API](https://github.com/ggml-org/llama.cpp/issues/9291)
17
18</div>
19
20## Quick start
21
22A few options to get `llama.cpp` installed on your machine:
23
24- Visit https://llama.app and follow the instructions
25- Run with Docker - see our [Docker documentation](docs/docker.md)
26- Download pre-built binaries from the [releases page](https://github.com/ggml-org/llama.cpp/releases)
27- Build from source by cloning this repository - check out [our build guide](docs/build.md)
28
29Once installed:
30
31```sh
32# Download and run a model directly from Hugging Face
33llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF
34
35# Launch OpenAI-compatible API server
36llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF
37```
38
39<table align="center">
40    <tr>
41        <td align="center" width=50%>
42            <img width="1310" height="888" alt="VLM session with `llama cli`" src="https://github.com/user-attachments/assets/88726b48-1713-48aa-a525-95a02e78afc4" />
43            <i>VLM session with <b>llama cli</b></i>
44        </td>
45        <td align="center">
46            <img width="1392" height="958" alt="Built-in web UI against `llama serve` running Qwen 3.6" src="https://github.com/user-attachments/assets/b402f972-2e32-4def-8771-8d849f08cf2e" />
47            <i>Built-in web UI against <b>llama serve</b></i>
48        </td>
49    </tr>
50<table>
51
52## Description
53
54The main goal of `llama.cpp` is to enable LLM (and VLM) inference with minimal setup and state-of-the-art performance on
55a wide range of hardware - locally and in the cloud.
56
57- Plain C/C++ implementation without any dependencies
58- Apple silicon is a first-class citizen - optimized via ARM NEON, Accelerate and Metal frameworks
59- AVX, AVX2, AVX512 and AMX support for x86 architectures
60- RVV, ZVFH, ZFH, ZICBOP and ZIHINTPAUSE support for RISC-V architectures
61- 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
62- Custom CUDA kernels for running LLMs on NVIDIA GPUs (support for AMD GPUs via HIP and Moore Threads GPUs via MUSA)
63- Vulkan and SYCL backend support
64- CPU+GPU hybrid inference to partially accelerate models larger than the total VRAM capacity
65
66The `llama.cpp` project is build on top of the [ggml](https://github.com/ggml-org/ggml) library.
67
68## Supported backends
69
70| Backend | Target devices |
71| --- | --- |
72| [BLAS](docs/build.md#blas-build) | All |
73| [BLIS](docs/backend/BLIS.md) | All |
74| [CANN](docs/build.md#cann) | Ascend NPU |
75| [CUDA](docs/build.md#cuda) | Nvidia GPU |
76| [HIP](docs/build.md#hip) | AMD GPU |
77| [Hexagon](docs/backend/snapdragon/README.md) | Snapdragon |
78| [IBM zDNN](docs/backend/zDNN.md) | IBM Z & LinuxONE |
79| [MUSA](docs/build.md#musa) | Moore Threads GPU |
80| [Metal](docs/build.md#metal-build) | Apple Silicon |
81| [OpenCL](docs/backend/OPENCL.md) | Adreno GPU |
82| [OpenVINO [In Progress]](docs/backend/OPENVINO.md) | Intel CPUs, GPUs, and NPUs |
83| [RPC](https://github.com/ggml-org/llama.cpp/tree/master/tools/rpc) | All |
84| [SYCL](docs/backend/SYCL.md) | Intel GPU |
85| [VirtGPU](docs/backend/VirtGPU.md) | VirtGPU APIR |
86| [Vulkan](docs/build.md#vulkan) | GPU |
87| [WebGPU](docs/build.md#webgpu) | All |
88| [ZenDNN](docs/build.md#zendnn) | AMD CPU |
89
90## Documentation
91
92#### Tools
93
94- [cli](tools/cli/README.md)
95- [completion](tools/completion/README.md)
96- [server](tools/server/README.md)
97- [GBNF grammars](grammars/README.md)
98
99#### Development
100
101- [How to build](docs/build.md)
102- [Running on Docker](docs/docker.md)
103- [Build on Android](docs/android.md)
104- [Multi-GPU usage](docs/multi-gpu.md)
105- [Performance troubleshooting](docs/development/token_generation_performance_tips.md)
106- [GGML tips & tricks](https://github.com/ggml-org/llama.cpp/wiki/GGML-Tips-&-Tricks)
107- [XCFramework](docs/xcframework.md)
108- [Completions](docs/completions.md)
109- [Models](docs/models.md)
110- [Release process](docs/release.md)
111
112## Contributing
113
114- Contributors can open PRs
115- Collaborators will be invited based on contributions
116- Maintainers can push to branches in the `llama.cpp` repo and merge PRs into the `master` branch
117- Any help with managing issues, PRs and projects is very appreciated!
118- Read the [CONTRIBUTING.md](CONTRIBUTING.md) for more information
119
120## Acknowledgements
121
122- [yhirose/cpp-httplib](https://github.com/yhirose/cpp-httplib) - Single-header HTTP server, used by `llama-server` - MIT license
123- [nothings/stb](https://github.com/nothings/stb) - Single-header image format decoder, used by multimodal subsystem - Public domain
124- [nlohmann/json](https://github.com/nlohmann/json) - Single-header JSON library, used by various tools/examples - MIT License
125- [mackron/miniaudio](https://github.com/mackron/miniaudio) - Single-header audio format decoder, used by multimodal subsystem - Public domain
126- [sheredom/subprocess.h](https://github.com/sheredom/subprocess.h) - Single-header process launching solution for C and C++ - Public domain