LLM inference in C/C++
open sourceMITself-hostablefree
llama.cpp runs large language models (and multimodal ones) locally or in the cloud with minimal setup, built on the ggml tensor library. It loads GGUF models, downloads them straight from Hugging Face, quantizes them, and runs on CPUs and on Metal, CUDA, HIP, Vulkan, SYCL and other GPU backends. llama-server is an OpenAI- and Anthropic-compatible HTTP server with continuous batching, tool calling, embeddings, reranking and a built-in chat app, and engines such as Ollama use it as a backend. Georgi Gerganov started it in 2023; it's MIT-licensed, and ggml.ai, the company behind it, was acquired by Hugging Face in 2026.
Ways to install
Package managers
Problems it solves
- run an open language model on my laptop without a Python stack
- serve a local model behind an OpenAI-compatible API for my app
- run LLM inference on a machine with only a CPU
- use my AMD or Intel GPU for local models, not just NVIDIA
- quantize a model so it fits in my GPU's memory
- embed LLM inference in a C or C++ application
- constrain a local model's output to valid JSON or a grammar
- run a vision model locally on images
- self-host an embeddings and reranking endpoint on our own hardware
Features
- GGUF models, downloaded directly from Hugging Face
- CPU, Metal, CUDA, HIP, Vulkan, SYCL, MUSA and BLAS backends
- quantization
- llama-server with OpenAI- and Anthropic-compatible APIs
- continuous batching and parallel decoding
- function calling and grammar-constrained output
- multimodal models
- embeddings and reranking endpoints
- built-in chat app
- speculative decoding
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
Alternatives
The same job
These do what llama.cpp does.
- LocalAI Your own AI, on your own hardware
- Ollama Start building with open models, locally or in the cloud
- Lemonade Server Refreshingly fast local AI: a local AI server for text, images and speech on your own GPU and NPU
- KoboldCpp Run GGUF AI models locally with a KoboldAI UI. One file, zero install.
- vLLM A high-throughput and memory-efficient inference and serving engine for LLMs
- SGLang Fast inference for LLMs and multimodal models
