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

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.
#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
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.
- llama-server: setting up a local OpenAI API
- Ollama vs llama.cpp: the complete comparison
- Official llama.cpp 1.0.0 release notes
- llama.cpp 1.0 announcement on Hugging Face
#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).
- llama-server: setting up a local OpenAI API, step by step
- GGUF and safetensors: understanding model formats
- Official documentation for the GGUF format — Hugging Face
#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.
| Setting | llama.cpp nu | Ollama | LM Studio | KoboldCpp |
|---|---|---|---|---|
| Context length | -c option, free | Conservative default value, configurable through a variable or Modelfile | Per-model slider | Launch option |
| Quantization selection | Any GGUF file | Catalog tag, Q4 by default | Proposed download list | Any GGUF file |
| Layers offloaded to the GPU | -ngl option: a number, auto (default), or all | Automatic | Slider | Launch option |
| KV cache quantization | -ctk and -ctv options (f16 by default) | Global environment variable | Advanced setting | Launch option |
| API | llama-server, OpenAI-compatible (port 9931 by default) | Clean API + OpenAI compatibility | OpenAI-compatible server | Clean API + OpenAI compatibility |
| Engine updates | The same day, with every commit | With a delay | With a delay | With 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.
- Flash Attention: enable it in llama.cpp, Ollama, and vLLM
- Quantize the KV cache to save VRAM
- Split a model across multiple GPUs with tensor-split
- Official llama-server documentation (complete list of options)
#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.
#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.
| Your hardware | Recommended backend | Note |
|---|---|---|
| NVIDIA GTX 10 to RTX 50, desktop and laptop | CUDA | The backend to choose on a NVIDIA card. |
| AMD Radeon RX 7000 and RX 9000 | ROCm (HIP) or Vulkan | ROCm is faster when it works. Vulkan installs without friction, including on Windows. |
| AMD Radeon RX 6000 and older | Vulkan | Partial or no ROCm support depending on the GPU. |
| Apple M1 to M5 | Metal | Enabled by default in macOS binaries. All unified memory is usable. |
| Integrated Intel or AMD GPU, Intel Arc | Vulkan or SYCL | Real-world gain over CPU-only operation on small models. |
| No GPU | CPU (AVX2, AVX-512, NEON) | Works everywhere. Target models with at most 8 billion parameters. |
- Compile llama.cpp with CUDA
- Compile llama.cpp with Metal on Mac
- llama.cpp with Vulkan, the universal backend
#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.
| Machine | Memory | Llama 3.1 8B Q4 |
|---|---|---|
| RTX 5090 | 32 GB | 172 tok/s |
| RTX 4090 | 24 GB | 128 tok/s |
| RTX 4070 | 12 GB | 76 tok/s |
| Mac M3 Max | 64 GB unified | 64 tok/s |
| RTX 3060 | 12 GB | 44 tok/s |
| Ryzen 7 7700, CPU only | System RAM | 7.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.
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.
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.
| Message or symptom | Likely cause | Try it |
|---|---|---|
| cudaMalloc failed: out of memory | The model, with the requested context, exceeds the available VRAM | Reduce -c, let --fit adjust -ngl, or choose a lighter quantization |
| unknown model architecture | The GGUF file uses a newer architecture than the installed binary | Update to the latest published version; new architectures arrive in llama.cpp first |
| Very slow generation despite a recent GPU | Not 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 argument | An option renamed or misspelled in the command | Compare with llama-server --help, which lists the current short and long aliases |
| A script crashes on --defrag-thold | The option was removed in version 1.0.0 | Remove the option from the command |
| Connection refused on port 8080 | The documented default port is now 9931 | Use 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?+
Do you need to know how to compile to use llama.cpp?+
Can you use llama.cpp without a graphics card?+
What’s the difference between llama.cpp and vLLM?+
And on Mac, llama.cpp or MLX?+
llamacpp, llama cpp, llama.cpp: are they the same thing?+
What does llama.cpp 1.0 bring?+
Should you switch from Ollama to llama.cpp?+
#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.
- llama.cpp v1.0.0 release notes (November 13, 2026)
- llama.cpp 1.0 announcement — Hugging Face
- Official llama.cpp repository README
- llama-server documentation (options and API)
- Install a prebuilt version of llama.cpp
- Building llama.cpp: official guide
- Official documentation for the GGUF format — Hugging Face
Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.