EXPLAINER

llama.cpp

runtimefreshness: volatilesources not yet verified

llama.cpp is a C/C++ inference engine for running LLMs efficiently on CPUs and consumer GPUs, using the GGUF format and aggressive quantisation.

Short answer: llama.cpp runs quantised GGUF models on almost any hardware (CPU, Apple Silicon, consumer GPUs) via a CLI and a built-in server with an OpenAI-style API, and supports grammar-constrained output. It underlies several desktop tools.

What is it?

llama.cpp is a lightweight program for running language models on ordinary computers — laptops, desktops, even phones — without needing a data-centre GPU. It uses compressed model files so big models fit in modest memory.

Also known as: llama cpp, llamacpp, ggml, gguf, llama-server, run LLM on CPU, llama.cpp server, run llama on laptop.

Technical definition

Created by Georgi Gerganov and built on the GGML tensor library; model files use the GGUF container with multiple quantisation types. Features include CPU SIMD kernels, Metal/CUDA/Vulkan and other backends, partial GPU offload, a server, grammar-based sampling (GBNF Grammars (llama.cpp)) and multimodal model support in recent builds. Repository ownership and organisation have changed; verify the canonical location. Wrappers such as Ollama and various GUIs build on it or similar engines.

Entity type: runtime · Freshness class: volatile.

When should I use it?

Best for local, personal and edge use.

Implementation patterns

  • Choose quantisation by memory budget (test quality).
  • Offload as many layers to GPU as fits.
  • Bind the server to localhost unless secured.
  • Use grammars for structured output.

Technologies and frameworks

Commonly associated: llama.cpp, GGUF, Metal / CUDA / Vulkan backends. Names are examples of what exists, not recommendations, and projects change quickly.

Practical guide

  1. Estimate memory needs.
  2. Download a trusted GGUF.
  3. Run with a small context first.
  4. Tune GPU layers and threads.
  5. Secure the server.

Common failure modes

  • Model too large for RAM causing swapping.
  • Build flags missing GPU backend.
  • Exposing the server to the network without auth.
  • Outdated GGUF files for newer builds.

Troubleshooting

  • Very slow generation — Check that GPU offload is active; use a smaller quantisation or model.
  • Model fails to load — Match GGUF version/format to the llama.cpp build.

Contrasted with

  • Ollama — Ollama adds model management and a friendlier CLI/API; llama.cpp is the lower-level engine with more knobs.
  • vLLM — vLLM targets GPU server throughput.

Questions this page answers

  • What is llama.cpp?
  • How do I run a model with llama.cpp?
  • What is GGUF?
  • llama.cpp vs Ollama?
  • Can I run an LLM on CPU only?

Typical goals: run models locally on modest hardware; serve a small local API.

Sources and verification

Status: not independently verified. This entry was authored on 2026-10-06 from general technical knowledge, without live checking of the sources below. Treat every source as a lead to confirm (identifier, title, authorship, current version) before publication or citation.

Freshness class: volatile — Products, versions, protocols, benchmarks, leaderboards, regulations and dates. Verify against the primary source before relying on specifics; re-review every 3 months.

Time-sensitive claims to verify before relying on them:

  • Repository location and governance.
  • Supported models, backends, formats and flags.

Canonical sources (unverified leads):

  • llama.cpp repository and documentation — github.com/ggml-org/llama.cpp (verify current location)
Learning path: Running and serving models (step 3 of 8)