SysArt
Book a briefing
SysArt

On-premises AI

llama.cpp: What It Is, How llama-server Works and How to Run It Securely

llama.cpp explained: what it is, GGUF, llama-server, Docker, Windows and Python, MTP and TurboQuant status, security advisories and running it for a team.

Last reviewed by SysArt AI Architecture Team9 min readHow we review

In short

llama.cpp is an MIT-licensed C/C++ engine for running large language models on your own hardware, from laptops to GPU servers. It loads models in the GGUF file format, supports quantised weights and many CPU and GPU backends, and includes llama-server, an HTTP server with OpenAI- and Anthropic-compatible APIs and a built-in chat app.

Key takeaways

  • llama.cpp is an MIT-licensed C/C++ inference engine built on the ggml tensor library; v1.0.0, published on 13 November 2026, introduced semantic versioning for its library API.
  • llama-server offers OpenAI-compatible chat, completions, responses and embeddings routes, an Anthropic-compatible Messages route, reranking, JSON-schema output, parallel slots and an optional Prometheus metrics endpoint.
  • Multi-token prediction (MTP) is supported as a speculative decoding method since May 2026; TurboQuant KV cache compression is not in the main project as of 19 November 2026 and lives in community forks.
  • As of 19 November 2026, the project lists 13 published security advisories, mostly memory-safety bugs in GGUF parsing and the RPC backend, and its private disclosure programme is paused.
  • For a team server: keep the loopback default or bind to a private interface, set API keys, put TLS and access control in a reverse proxy, never expose the RPC server and verify every GGUF file you load.
A computer processor held up by black tweezers against a soft grey background

What is llama.cpp?

llama.cpp is an open-source engine, written in C and C++, that runs large language models (LLMs) on your own hardware. Its stated goal is LLM inference with minimal setup on a wide range of hardware, locally and in the cloud.

The project sits on top of ggml, a tensor library from the same organisation, ggml-org. Inference means running a trained model to produce output, as opposed to training it. llama.cpp is released under the MIT licence.

Three ideas explain most of its popularity:

  • GGUF. llama.cpp loads models in GGUF, a binary file format built for fast loading and saving. Unlike tensor-only formats such as safetensors, a GGUF file holds both the model weights and standard metadata, such as the architecture, tokenizer and chat template. Models trained in PyTorch are converted to GGUF with the project’s conversion script, and Hugging Face hosts many GGUF models.
  • Quantisation. Quantisation stores weights at lower precision, such as 8 or 4 bits instead of 16, so a model needs less memory and runs on smaller hardware, at some cost in quality. The right level depends on the model and the task, so test quality before you standardise on one.
  • Backends. ggml backends target CPUs (with optional BLAS libraries), Apple Metal, NVIDIA CUDA, AMD HIP, Vulkan, Intel SYCL, Moore Threads MUSA, OpenCL, OpenVINO, IBM Z and others listed in the build guide.

As of 19 November 2026, the latest stable release is v1.0.0, published on 13 November 2026. The announcement says the libraries now follow semantic versioning, so breaking API changes bring a new major version, and that llama.cpp supports more than 150 model architecture variants. Numbered nightly builds, such as b12534, continue alongside.

How do you download and install llama.cpp on Windows, Linux or macOS?

Use the official install script, a package manager, a pre-built binary from the GitHub releases page, a Docker image or a source build. All of them come from github.com/ggml-org/llama.cpp or llama.app, which the README links.

  • Install script. The README gives a one-line installer for Linux and macOS (curl) and Windows (PowerShell), both served from llama.app.
  • Package managers. The v1.0.0 announcement lists Homebrew, Winget, conda-forge, MacPorts and Debian among its distribution channels.
  • Pre-built binaries. Each release carries archives for Windows (CPU, CUDA 12.4 and 13.5, Vulkan, SYCL, ROCm and OpenVINO builds, on x64 and Arm64), Linux and macOS.
  • Build from source. CMake builds every tool; options switch on backends such as CUDA or Vulkan.

After installation, the README’s quick start runs a model with llama cli and starts the server with llama serve; both accept -hf to download a GGUF model from Hugging Face. The standalone llama-server binary is still built and documented.

In an enterprise, do not pipe install scripts from the internet into a shell on production hosts. Download a specific release, verify it, mirror it internally and install from there. For air-gapped AI environments, load models from local paths with -m instead of -hf.

What does the llama.cpp server (llama-server) offer?

llama-server is a lightweight HTTP server that turns llama.cpp into an API service. It offers OpenAI-compatible routes, an Anthropic-compatible Messages route and a built-in chat app called Llama Chat.

According to its README, as of 19 November 2026:

  • APIs. OpenAI-compatible chat completions, completions, responses and embeddings APIs, plus an Anthropic-compatible Messages API and native endpoints for tokenising and infill. The v1.0.0 release notes add an OpenAI-compatible speech endpoint.
  • Retrieval features. Embeddings and a reranking endpoint, so one server can support a retrieval pipeline.
  • Structured output. Grammar-based sampling with GBNF grammars or a JSON schema, and function calling for most models.
  • Concurrency. Parallel decoding across slots (--parallel) with continuous batching, which groups requests from several users into each step.
  • Speculative decoding. A small draft model or another method proposes tokens that the main model checks, which can cut response time.
  • Operations. A public /health check, a Prometheus-compatible /metrics endpoint that is off by default, and a /slots monitoring endpoint that is on by default.
  • Router mode. Started without a model, the server loads and unloads several models on demand.
  • Agent features. Built-in file and shell tools and stdio MCP servers, marked experimental and not for untrusted environments.

Any chat front end or SDK that accepts an OpenAI-compatible base URL can use llama-server; our article on running Open WebUI in an enterprise covers one such interface.

How do you run llama.cpp in Docker?

Use the official images on the GitHub Container Registry. The server image contains only llama-server; variants add GPU support.

The documented images are ghcr.io/ggml-org/llama.cpp:server for CPU, plus server-cuda (CUDA 12), server-cuda13, server-rocm, server-musa, server-intel (SYCL), server-vulkan and server-openvino. full and light images carry the command-line tools. The documentation notes that CI builds the GPU images but does not otherwise test them.

A typical command mounts a model directory (read-only is safer), passes --host 0.0.0.0 so the container accepts traffic, and maps the port. For production:

  • Pin images by digest, not by a moving tag, and scan them in your registry.
  • Publish the port only to a private network or a reverse proxy, never directly to the internet.
  • Run one model per container for clear resource limits, or router mode when memory planning allows. Our GPU sizing calculator estimates memory for a model, quantisation and context length.

Can you use llama.cpp from Python?

Yes, in two ways that the project documents. Most teams call llama-server over HTTP with an OpenAI-compatible client, and the gguf Python package reads and writes GGUF files.

The server README shows the openai Python library pointed at a llama-server base URL. This keeps Python code portable between llama.cpp and other OpenAI-compatible engines. The gguf package, installed with pip, powers the project’s conversion scripts and can inspect metadata before you approve a file. Third-party bindings that embed the C library in Python also exist; review them as separate dependencies with their own release cycles.

Does llama.cpp support MTP and TurboQuant?

Multi-token prediction (MTP) is supported; TurboQuant is not in the main project as of 19 November 2026.

MTP. Some models ship extra prediction heads that guess several upcoming tokens at once. llama.cpp uses them for speculative decoding: the heads draft tokens and the main model verifies them, so no separate draft model is needed. Pull request #22673, merged on 16 May 2026, added MTP support and loads the heads from the same GGUF file. The current flag is --spec-type draft-mtp. Speed-ups depend on the model, the hardware and how often drafts are accepted, so measure them on your own workload.

TurboQuant. Google Research announced TurboQuant on 24 March 2026 as a vector quantisation method that reduces memory overhead, with uses in vector search and in compressing the key-value (KV) cache, the memory a model keeps for the conversation so far. A llama.cpp feature request opened the next day was closed as not planned on 20 August 2026, and community pull requests adding TurboQuant cache types were closed without merging. As of 19 November 2026, the documented KV cache types are f32, f16, bf16, f8_e4m3, q8_0, q4_0, q4_1, iq4_nl, q5_0 and q5_1; FP8 arrived in v1.0.0. TurboQuant builds come from community forks, which sit outside the project’s security policy and release process.

Is llama.cpp secure enough to run as a team server?

It can be, with the right deployment. The defaults suit a single user on one machine, and the project’s own security policy recommends sandboxing and warns against exposing the server or the RPC backend to untrusted networks.

Published advisories. As of 19 November 2026, the GitHub security page lists 13 published advisories, from April 2024 to March 2026. Most are memory-safety bugs triggered by crafted GGUF files or by the RPC backend, which spreads work across machines. CVE-2026-34159, rated critical, allowed unauthenticated remote code execution through the RPC server. The v1.0.0 release notes also list fixes for CORS, DNS rebinding and server-side request forgery. SECURITY.md states that private disclosure is disabled until further notice, so fixes arrive as public pull requests: follow releases closely.

Scope. The policy excludes Llama Chat, experimental features, router mode, MCP and most denial-of-service bugs from what it treats as vulnerabilities. Treat those parts as unsupported for exposed deployments.

SettingDocumented default (19 Nov 2026)Team deployment
--host127.0.0.1Private interface or a socket behind a reverse proxy
--api-key / --api-key-fileNoneOne key per client application, rotated
TLSOff unless built with OpenSSL and given a certificateTerminate TLS at a reverse proxy
--cors-originsAny origin reflected, with credentialsYour front end’s origin only
/slotsEnabled--no-slots unless monitoring needs it
--metricsDisabledEnable on an internal-only path
--tools, MCP, --agentOffKeep off on shared servers
RPC server (separate tool)Not part of llama-serverDo not run it on untrusted networks

Model files are part of the attack surface. Verify each GGUF file against a known checksum, download only from publishers you have approved, and run untrusted models in an isolated container or virtual machine. Our article on supply chain security for on-premises AI models sets out the controls.

llama.cpp vs Ollama: which should you use?

They are layers of one stack more than rivals. Ollama’s README lists llama.cpp as its supported backend; Ollama adds its own installer, model library, CLI and API, and offers models locally or in the cloud.

llama.cpp exposes every build option, flag and endpoint, and runs any GGUF file you supply. That suits platform teams that want to pin versions, choose backends and control the model supply chain. Ollama trades some of that control for convenience. Both serve modest numbers of concurrent users well; for many users on shared GPUs, teams usually also evaluate engines designed for large-scale batching, such as vLLM and SGLang. Our comparison of vLLM, Ollama, llama.cpp and SGLang sets out the trade-offs by workload.

What should governance teams record about a llama.cpp deployment?

Treat llama.cpp as one component in a private LLM deployment and record what it runs, who uses it and which duties apply. This is general information, not legal advice.

  • Inventory. Record the llama.cpp version or build number, image digest, build options, each model’s source, checksum and quantisation, and the server flags.
  • Licences. The MIT licence covers the engine only. Each model carries its own terms; see our guide to open-weight model licences.
  • EU AI Act roles. Obligations for providers of general-purpose AI (GPAI) models have applied since 2 August 2025 and fall mainly on whoever develops the model and places it on the market. An organisation that runs such a model for its own purposes is usually a deployer of the AI systems it builds, but the answer depends on the use case and role. AI literacy measures under Article 4 have applied since 2 February 2025, and Annex III high-risk rules apply from 2 December 2027.
  • GDPR. Prompts and outputs may contain personal data. Keep debugging options such as --log-prompts-dir and saved slot caches off in production, or cover them in retention rules.

How SysArt helps

SysArt designs, hardens and can operate inference platforms on the client’s infrastructure or in a dedicated SysArt-hosted EU environment, choosing the engine that fits the workload and building in model inventories, access control and audit evidence. See our approach to on-premises AI.

Featured image by Brian Kostiuk on Unsplash.

Frequently asked questions

What is llama.cpp used for?

llama.cpp runs large language models locally or on your own servers without a Python stack or a cloud API. Teams use it to run quantised open-weight models on laptops, workstations and CPU or GPU servers, to serve them over an OpenAI-compatible API with llama-server, and to embed inference in desktop, mobile and edge applications through its C library. It is MIT-licensed and free to use.

Is llama.cpp free for commercial use?

Yes. llama.cpp is released under the MIT licence, which permits commercial use, modification and redistribution if you keep the copyright and licence notice. The licence covers the engine only. Each model you run in it carries its own licence, which may restrict commercial use, user numbers or field of use, so review the model licence separately before deployment.

What is the default port of llama-server?

As of 19 November 2026, the llama-server documentation gives 127.0.0.1 as the default listening address and 9931 as the default port. Older guides and the Docker examples use port 8080, which you set explicitly with --port. Because the default address is loopback, the server is reachable only from the same machine until you change --host, which is a sensible starting point for production hardening.

Does llama.cpp support an OpenAI-compatible API?

Yes. llama-server exposes OpenAI-compatible routes for chat completions, completions, responses, embeddings, model listing and speech, plus an Anthropic-compatible Messages route. Most clients and SDKs that accept a custom base URL, including the openai Python library, can point at the server. Compatibility covers the documented parameters, so test the features your application relies on, such as tool calling and structured output.

Is llama.cpp better than Ollama?

Neither is better in general. llama.cpp is the lower-level engine with every tuning and serving option exposed; Ollama is a separate product that lists llama.cpp as its supported backend and adds its own installer, model library, CLI and API. Choose llama.cpp when you want direct control over builds, flags and model files, and Ollama when packaged convenience matters more. Test both on your own models and hardware.

Does llama.cpp support TurboQuant?

Not in the main project as of 19 November 2026. Google Research announced TurboQuant, a vector quantisation method that also compresses the key-value cache, on 24 March 2026. The llama.cpp feature request was closed as not planned in August 2026, and community pull requests were closed without merging. Supported KV cache types include q8_0, q4_0 and, since v1.0.0, FP8. TurboQuant builds exist only in community forks.

Can llama.cpp run without internet access?

Yes. Once you have the binaries and GGUF model files, llama.cpp runs fully offline. Load models from local paths with -m rather than downloading with -hf, mirror release binaries or container images into an internal registry, and record a checksum for each file.

Related insights

Plan your private AI with people who build it

Book a briefing. We look at your use case, data and constraints, and you leave with the deployment options and governance steps that fit.