Intermediate 11 minllama.cpp

llama.cpp: what is it, and should you leave Ollama ?

llama.cpp: what is it, and should you leave Ollama?
Direct response

llama.cpp (also written llamacpp or llama cpp) is the C and C++ engine that runs GGUF models on CPU and GPU; Ollama, LM Studio, and KoboldCpp are built on it. Version 1.0.0, released November 13, 2026, mainly stabilizes the API for developers. Sticking with Ollama is still reasonable; llama.cpp makes sense when you want to tune memory, context, and the KV cache yourself.

llama.cpp (also written llamacpp or llama cpp) is the C and C++ engine that runs GGUF models on CPU and GPU; Ollama, LM Studio, and KoboldCpp are built on it. Version 1.0.0, released November 13, 2026, mainly stabilizes the API for developers. Sticking with Ollama is still reasonable; llama.cpp makes sense when you want to tune memory, context, and the KV cache yourself.

By Mohamed Meguedmi·Update 2026-11-19·Tested on macOS 14+

#llama.cpp in brief

The project was launched in March 2023 by Georgi Gerganov with a simple goal: run Meta's LLaMA model on a MacBook, without Python or heavy dependencies. It's released under the MIT license. The repository, now under the ggml-org organization, released version 1.0.0 on November 13, 2026. The official announcement cites more than 150 supported architecture variants, and the file format defined in August 2023, GGUF, has become the de facto standard for distributing a quantized model.

Two technical choices explain this success. The first is quantization: llama.cpp can run weights compressed to 2 to 8 bits, allowing an 8-billion-parameter model to fit in 5 GB instead of 16. The second is splitting work between the CPU and GPU: when a model does not fit entirely in VRAM, some layers remain in RAM and the rest go to the GPU. It is slower than loading everything at once, but it works, and few engines offer it.

You'll see it written as llama.cpp, llama cpp, llamacpp, or even “lama.cpp”: it's the same project. If you were searching for “ollama cpp” or “llm.cpp”, llama.cpp is what you're looking for; Ollama is a separate piece of software that builds on it, among other things.

#llama.cpp 1.0.0: what changes for you

The complete kit for building your own AI assistant.

Benefit from our experience and a guided path to build your local assistant and use your AI every day.

  • Lifetime online access
  • PDF + files
  • Refunded within 30 days

On November 13, 2026, the project released version 1.0.0 of llama.cpp and the ggml library. The stated goal is to give developers a stable API: breaking changes to the C API will now be signaled by a major version bump, following semantic versioning. For a user who simply runs llama-server, the visible change is therefore less a new interface than a clearer framework.

An official installer
The README provides a one-line script (macOS, Linux, Windows) that installs the llama command, with llama cli for chatting in the terminal and llama serve for launching the OpenAI-compatible server. It picks the Metal, CUDA, ROCm, Vulkan, or CPU variant on its own. Homebrew, winget, conda-forge, MacPorts, and Nix are still available.
FP8 KV cache
The -ctk and -ctv options now accept f8_e4m3, in addition to f16, bf16, q8_0, and the 4- and 5-bit formats. The benefit: lower cache memory usage with long contexts.
Expert caching for MoE models
An expert cache in host memory is added for mixture-of-experts (MoE) models, with part of the compute left to the CPU when the requested expert isn't in the cache.
Hardened server
Unauthenticated tools and private addresses for media are now opt-in options you must enable explicitly (--allow-unauthenticated-tools, --media-allow-private-urls). CORS access, DNS rebinding protection, and the Hugging Face token have also been tightened.
Voice and audio
The server adds an OpenAI-compatible /v1/audio/speech endpoint for speech-capable models, plus support for streaming audio input from Gemma 4.
Redesigned web interface
Reorganized sidebar, grouped chats, input editor with Markdown preview, phone-friendly layout.
What was removed
The deprecated public API, including the --defrag-thold option. If any of your scripts still passes it, remove it.
i
What still holds true
llama-server keeps its OpenAI-compatible API, and the -ngl, -c, -fa, -ctk, -ctv, and --n-cpu-moe options are still in the documentation. Only the deprecated public C API and the --defrag-thold option were removed. You don't have to migrate right away.

#What's in the box

llama
The single command installed by the official script: llama cli for chatting in the terminal, and llama serve for the OpenAI-compatible server. The llama-cli and llama-server binaries are still available when you build from source or download the archives.
llama-cli
The command-line chat. Useful for testing a model or setting in a few seconds.
llama-server
An HTTP server with an OpenAI-compatible API and a built-in web interface, on 127.0.0.1 and port 9931 by default according to the current documentation. It's the component most advanced users keep running all the time.
llama-bench
The measurement tool. It reports prompt-reading speed and generation speed separately, allowing you to compare two configurations without fooling yourself.
llama-quantize
Converts a full-precision GGUF into a lighter quantization (Q4_K_M, Q5_K_M, Q8_0).

#What the overlays add—and hide

Ollama, LM Studio and KoboldCpp provide what llama.cpp does not: a model catalog, one-command downloads, an interface, and automatic loading and unloading. In exchange, they set default values. The table below does not compare performance; it shows who decides what.

Comparison of control, not speed · as of 16/11/2026
Settingllama.cpp nuOllamaLM StudioKoboldCpp
Context length-c option, freeConservative default value, configurable through a variable or ModelfilePer-model sliderLaunch option
Quantization selectionAny GGUF fileCatalog tag, Q4 by defaultProposed download listAny GGUF file
Layers offloaded to the GPU-ngl option: a number, auto (default), or allAutomaticSliderLaunch option
KV cache quantization-ctk and -ctv options (f16 by default)Global environment variableAdvanced settingLaunch option
APIllama-server, OpenAI-compatible (port 9931 by default)Clean API + OpenAI compatibilityOpenAI-compatible serverClean API + OpenAI compatibility
Engine updatesThe same day, with every commitWith a delayWith a delayWith a delay

That last line matters more than it may seem. When a new model architecture is released, it is first supported in llama.cpp, then in higher-level wrappers a few days or weeks later. If you want to test a model during the week it is published, this is often the only path.

#The four settings that change everything

-ngl (n-gpu-layers)
The number of model layers placed in VRAM: a number, auto, or all. The default is auto. If you force a value and the model exceeds your VRAM, lower it until loading succeeds: each layer left on the CPU slows generation, but a model that runs slowly beats a model that won't start.
-c (ctx-size)
The allocated context window. By default, the value is read from the model (0), and --fit can reduce it to fit in memory. The KV cache grows with it: allocate what you need, not the maximum the model advertises.
-fa (flash-attn)
Flash Attention reduces memory use and speeds up processing of long prompts. The values are on, off, or auto; auto is the default, so you usually don't need to add anything.
--n-cpu-moe
For MoE models, keeps the experts of the first N layers in RAM and leaves the rest on the GPU (-cmoe keeps all experts on the CPU). This is what lets you fit an MoE larger than your VRAM.

#What changed: --fit sets -ngl for you

For a long time, manually tuning -ngl was the first step in every llama.cpp guide: set it to 99 to offload everything to the GPU, then lower it by trial and error if loading failed. That step is no longer required. The --fit option, enabled by default, automatically adjusts unspecified parameters (including -ngl and the context size) so the model fits in available memory. It keeps a 1,024 MB margin per device (-fitt) and won't go below 4,096 tokens of context (-fitc); both values are configurable. On a modest card, this saves you the usual back-and-forth between a failed launch and manually reducing -ngl.

→
-ngl 99 remains valid
If you'd rather force a specific placement, -ngl 99 (or -ngl all) still works; --fit only applies to parameters you haven't set yourself. The behavior change affects the default value, not the command.

#Which backend for your card

llama.cpp is built, or downloaded, for a specific compute backend. The right choice depends solely on your hardware. The table covers the families in our database of 90 configurations. With the official install script, this choice is made for you; the binaries and build options only matter if you want to force a backend.

Families from the QuelLLM hardware database (90 GPUs and chips) · 16/11/2026
Your hardwareRecommended backendNote
NVIDIA GTX 10 to RTX 50, desktop and laptopCUDAThe backend to choose on a NVIDIA card.
AMD Radeon RX 7000 and RX 9000ROCm (HIP) or VulkanROCm is faster when it works. Vulkan installs without friction, including on Windows.
AMD Radeon RX 6000 and olderVulkanPartial or no ROCm support depending on the GPU.
Apple M1 to M5MetalEnabled by default in macOS binaries. All unified memory is usable.
Integrated Intel or AMD GPU, Intel ArcVulkan or SYCLReal-world gain over CPU-only operation on small models.
No GPUCPU (AVX2, AVX-512, NEON)Works everywhere. Target models with at most 8 billion parameters.

#Our measurements with llama.cpp

llama.cpp is our benchmark’s reference engine precisely because it runs identically on every platform. Here are the generation speeds measured on Llama 3.1 8B in Q4, with a 2,048-token context, a single request, and Flash Attention enabled.

Measured · QuelLLM benchmark, llama.cpp b4280, readings from 18/04/2026 · full table on the Benchmarks page
MachineMemoryLlama 3.1 8B Q4
RTX 509032 GB172 tok/s
RTX 409024 GB128 tok/s
RTX 407012 GB76 tok/s
Mac M3 Max64 GB unified64 tok/s
RTX 306012 GB44 tok/s
Ryzen 7 7700, CPU onlySystem RAM7.8 tok/s

Two takeaways. First, a RTX 3060 is five to six times faster than a CPU alone, so even an entry-level card changes the experience. Second, these numbers would be practically the same in Ollama or LM Studio on the same machines, since they use the same compute engine. These measurements date from April 2026, before version 1.0.0. Treat them as a ballpark, not a promise for the latest version.

#Stay with Ollama or switch to llama.cpp

Should you leave Ollama because of llama.cpp 1.0? No. Version 1.0.0 is an API stability milestone, not a breaking change. Ollama still relies on llama.cpp, among other components (its release notes mention the llama.cpp update), and it offers things llama.cpp doesn't, such as the model catalog, the desktop app, and cloud models. Switch to llama.cpp if one of the cases in the right-hand column applies to you. Otherwise, the two can run side by side with no port conflict by default (11434 for Ollama, 9931 for llama-server).

Stay on Ollama or LM Studio if…Switch to llama.cpp if…
You want to chat with a model without reading documentation.Your model exceeds VRAM capacity and you want to fine-tune the GPU/CPU split.
You frequently switch models and appreciate the built-in catalog.You want to test an architecture released this week.
Your tools (Open WebUI, editor extensions) expect the Ollama API.You’re building a durable server and want to control every option, from context to KV cache.
You use the Ollama app, its cloud models, or its integrations.You want a specific engine version, or the latest fixes released in a nightly build.

#Get started in ten minutes

You don't need to compile anything to try it. The official README offers a one-line install script, and prebuilt binaries are published for Windows, macOS, and Linux. Package managers also do the job. The commands below install llama.cpp, then download a small model from Hugging Face and start the server, whose web interface opens at http://localhost:9931.

Install, then start the server
# Script officiel (macOS et Linux) : installe la commande llama dans ~/.local/bin
curl -LsSf https://llama.app/install.sh | sh

# Windows (PowerShell)
irm https://llama.app/install.ps1 | iex

# Ou via un gestionnaire de paquets
brew install llama.cpp        # macOS et Linux
winget install llama.cpp      # Windows

# Télécharger un petit modèle depuis Hugging Face et lancer le serveur
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF

For a more capable model, the same mechanism works with llama-server and the GGUF repository of your choice. Without the -ngl option, --fit places the layers for you; add -c to set the context size.

llama-server with a Gemma 4 model
llama-server -hf ggml-org/gemma-4-E4B-it-GGUF -c 8192

# Tester l'API compatible OpenAI (port par défaut : 9931)
curl http://localhost:9931/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Bonjour"}]}'
!
Don't expose the server to the network without a key
By default, llama-server listens only on 127.0.0.1. If you change --host to expose it to your network, also set --api-key and restrict CORS access with --cors-origins.

For a GGUF file you've already downloaded, point to it with the -m option. Building from source is only useful to enable a specific backend or to track development day to day.

#Most common loading errors

Most issues with llama.cpp boil down to three causes: running out of memory, a GGUF file incompatible with the installed build, or a misspelled option. The command-line error message almost always indicates which one, provided you read it to the end instead of closing it and rerunning the command.

Read the message before changing a setting
Message or symptomLikely causeTry it
cudaMalloc failed: out of memoryThe model, with the requested context, exceeds the available VRAMReduce -c, let --fit adjust -ngl, or choose a lighter quantization
unknown model architectureThe GGUF file uses a newer architecture than the installed binaryUpdate to the latest published version; new architectures arrive in llama.cpp first
Very slow generation despite a recent GPUNot all layers are offloaded to the GPU, often because there is not enough free VRAM.Check the load output (the “offloaded” line) and close other applications using the card
error: invalid argumentAn option renamed or misspelled in the commandCompare with llama-server --help, which lists the current short and long aliases
A script crashes on --defrag-tholdThe option was removed in version 1.0.0Remove the option from the command
Connection refused on port 8080The documented default port is now 9931Use http://localhost:9931, or set --port 8080

The loading line printed when the server starts is worth reading in full once: it shows how many layers were actually offloaded to the GPU, the effective context size, and the KV cache type in use. That's often faster than adding options at random until something works. Also keep an eye on the installed version: llama.cpp publishes nightly builds (numbered bNNNN) very frequently, in addition to the v1.x releases, and a fix for your card or model is sometimes already out but hasn't yet reached the Homebrew or winget package you installed the week before.

#FAQ

Is llama.cpp faster than Ollama?+
With identical settings, the gap is small: Ollama relies on llama.cpp, among other things, and updates its engine from release to release. The difference comes from the settings. llama.cpp lets you precisely choose the number of layers on the GPU, the context size, and the cache quantization, which sometimes lets you fit a model in VRAM that Ollama would have partially left on the CPU.
Do you need to know how to compile to use llama.cpp?+
No. Prebuilt binaries are published with every release for Windows, macOS, and Linux, the README provides a one-line install script, and the package is available in Homebrew, winget, conda-forge, MacPorts, and Nix: one command is enough, no compiler needed. Building from source is only useful to enable a specific backend missing from the official binary, apply a local patch, or track the development branch.
Can you use llama.cpp without a graphics card?+
Yes, that is actually its original use case: the project was designed to run a model on a simple processor, without a GPU or Python. On a recent processor, an 8B model in Q4 runs at around 8 tokens per second in our benchmark, which is still slow but readable for chatting or summarizing. Above 14 billion parameters, the wait becomes painful without hardware acceleration.
What’s the difference between llama.cpp and vLLM?+
llama.cpp targets a personal machine, regardless of hardware, with models quantized in GGUF. vLLM targets a GPU server handling many requests in parallel, with Hugging Face weights. The former maximizes what runs on your machine; the latter maximizes the throughput of a shared GPU.
And on Mac, llama.cpp or MLX?+
Both use the Apple GPU through unified memory. MLX is the library Apple designed for its own chips; llama.cpp has the advantage of the huge catalog of already-quantized GGUF files and fine-grained control over context and the KV cache. Many Mac users keep both and choose based on the format available for the model they want. The MLX vs. llama.cpp on Mac guide covers the choice in detail.
llamacpp, llama cpp, llama.cpp: are they the same thing?+
Yes. These are four spellings of the same project, the inference engine from the ggml-org organization. Don't confuse it with Ollama, a separate piece of software that uses it.
What does llama.cpp 1.0 bring?+
Version 1.0.0, released on November 13, 2026, stabilizes the public API and removes the deprecated API. It also adds an FP8 KV cache, an expert cache for MoE models, a hardened server, a /v1/audio/speech endpoint, and a redesigned web interface. You'll find the details in the dedicated section of this guide.
Should you switch from Ollama to llama.cpp?+
Not necessarily. Stick with Ollama if its catalog, app, and cloud models meet your needs; switch to llama.cpp if you want control over every engine option, need to test a very recent architecture, or want to set up a long-running server. The two can coexist on the same machine.

#Sources and verification as of November 16, 2026

The commands, default values, and new features in version 1.0.0 were reviewed on November 16, 2026 against the official release notes, the repository README, the llama-server documentation, and the announcement published by the project team.


Did this guide help you?

Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.