← All open source projects

llama.cpp

ggml-org/llama.cpp

llama.cpp runs large language models locally, from command-line inference to an OpenAI-compatible API server.

Forks 19,283
Author ggml-org
Language C++
License MIT
Synced 2026-06-07

What it is

llama.cpp is a low-level inference runtime for language models written in C and C++. It became important in places where people do not want another hosted service, but a clear executable path: download a GGUF model, run it on their own machine, and get answers without sending data away.

The project’s central idea is broad hardware reach. It supports CPU execution, Apple Silicon through Metal, CUDA for NVIDIA, Vulkan, SYCL, and hybrid modes where part of the work is moved to the GPU while the rest stays on the processor.

How it appeared and why it stuck

The project grew out of a practical need: after open LLaMA weights appeared, developers needed a fast way to run this class of models locally. llama.cpp quickly became an experimental home for ggml, GGUF, quantization, new model families, and acceleration work.

Its popularity is not only about speed. llama.cpp is useful as a shared layer between models, hardware, and applications: it can be used as a command-line utility, a library, and an OpenAI-compatible server. That is why it often sits under local assistants, editor extensions, and internal prototypes.

What is inside

The repository includes executable tools, a server, examples, build documentation, hardware backends, and materials for obtaining and quantizing models. In practice the path is straightforward: get a model, reduce it if needed, pick a command or server mode, and wire the result into an application.

Basic model run

This example shows two roles of llama.cpp: running a local model interactively and exposing a compatible API server for applications.

Language: Bash
llama-cli -m ./models/model.gguf -p "Explain quantization briefly"

llama-server -m ./models/model.gguf --host 127.0.0.1 --port 8080
curl http://127.0.0.1:8080/v1/models

Where it helps

llama.cpp is especially useful for local scenarios: prototypes without an external API, document tools, editor assistants, private model experiments, and servers where every request cost needs to be controlled.

The project does not hide model complexity. Users still need to understand weights, memory, context size, acceleration, and quantization quality. In return they get direct control: the model runs where they start it, not inside someone else’s service.

Strengths and limits

The main strength is breadth: many platforms, many hardware backends, command-line tools, and server mode in one project. That makes llama.cpp both an end-user tool and infrastructure for other tools.

The limit is pace. Commands, parameters, and APIs move quickly, so serious use should pin a known release and test performance on the actual model and hardware.