← Blog

Ollama vs llama.cpp: Same Engine, Different Job

September 30, 2026

AI CodingTool Comparisons

Most Ollama vs llama.cpp comparisons treat them as rivals. They aren't, quite. Ollama is built on llama.cpp, so for most models you're choosing between the engine on its own and the engine with a manager wrapped around it.

Here's the short version:

  • llama.cpp is the engine. A C/C++ inference library plus tools, including llama-server, which gives you an OpenAI-compatible API and a built-in web UI. You pick the model file, the context size, the GPU layers and everything else.
  • Ollama is the manager. It pulls models from its own library, loads and unloads them for you, picks sensible defaults, and serves a REST API that a long list of apps already know how to talk to.
  • Both are MIT-licensed, and both run locally. Ollama also has an optional cloud path, which llama.cpp doesn't.

So the real question isn't which is faster. It's who you want making the decisions: Ollama's defaults, or your own flags.

Quick comparison

Ollamallama.cpp
What it isModel manager and server built on llama.cppInference library and tools
Getting a modelollama pull from the Ollama library, or import your ownPoint it at a GGUF file, or download from Hugging Face with -hf
Model formatsGGUF, plus Safetensors importGGUF
Customising a modelModelfileCommand-line flags and presets
APINative REST API on port 11434, plus OpenAI- and Anthropic-compatible routesllama-server: OpenAI- and Anthropic-compatible routes on port 8080
Memory handlingLoads on demand, unloads after idleYou decide, per server or per preset
Hosted optionOptional cloud models, account requiredNone, it only runs where you run it
LicenceMITMIT

How Ollama actually uses llama.cpp

This is the part most comparisons get vague about, so here's what Ollama's own repository says as of September 2026.

Ollama's README lists llama.cpp as its supported backend. Its repo pins a specific llama.cpp release in a file called LLAMA_CPP_VERSION, applies its own compatibility patches on top, and builds llama.cpp's server as part of its build. The maintainer notes spell out why updates need care: a new llama.cpp version can change model loading, GPU discovery and streaming.

Two things follow from that.

First, Ollama runs a llama.cpp that is slightly behind and slightly different. It's pinned to a tested version and patched. When llama.cpp ships support for a brand-new model architecture, llama.cpp users usually get it first, and Ollama users get it when Ollama updates its pin.

Second, llama.cpp isn't Ollama's only engine any more. Ollama's developer guide also describes an MLX engine for Safetensors-based models, which it says is enabled by default on Apple silicon Macs. So on a Mac, "Ollama is just llama.cpp" is no longer the whole story.

Where llama.cpp is stronger

You get new models and features first. Since Ollama pins and patches llama.cpp, the upstream project is where new architectures, quantisation types and server features land. If you want to run something released last week, llama.cpp is often the shorter path.

Every setting is yours. The llama-server docs list flags for context size, batch size, threads, flash attention, GPU placement and much more. By default the context size comes from the model itself. Ollama makes more of those choices for you, which is great until you need a different one.

It runs on more hardware. The llama.cpp README lists backends for Metal, CUDA, HIP (AMD), Vulkan, SYCL (Intel), and others, including Snapdragon and Ascend NPUs. It also supports CPU and GPU hybrid inference, so a model larger than your VRAM can still be partly accelerated.

The server is a real server now. llama-server offers OpenAI-compatible chat completions, responses and embeddings routes, an Anthropic Messages-compatible route, parallel decoding, continuous batching, function calling and a web UI. Its router mode, started without a model, loads and unloads models on demand, which used to be one of Ollama's main advantages.

Installing it got easier. There's an official home at llama.app with a script installer, and the README's quick start downloads a model from Hugging Face and serves it in one command.

If you need…Why llama.cpp fits
A model released this weekUpstream support lands here first
Exact control of context, batching or GPU layersEvery setting is a flag
An unusual GPU or NPUWider backend list
No account, no cloud path at allThere isn't one to switch on

Where Ollama is stronger

Getting started takes one command. ollama run pulls a model from the Ollama library and drops you into a chat. You don't need to know what a GGUF file is or which quantisation to pick. The library has made that choice.

Memory is managed for you. According to the Ollama FAQ, models stay in memory for five minutes after use and then unload. If there's room, several models can be loaded at once, and requests queue when there isn't. You switch models just by naming a different one in the request.

A Modelfile is a recipe you can share. A Modelfile sets the base model with FROM, then adds a system prompt, a template and parameters. You can hand it to a teammate and they get the same model setup. FROM can point to a library model, a local GGUF file or a Safetensors directory.

Everything already talks to it. Ollama's native REST API on port 11434 is supported by a long list of chat apps, editors and frameworks, which its README catalogues. It also offers OpenAI-compatible routes (chat completions, completions, models, embeddings and responses) and an Anthropic-compatible /v1/messages route. On top of that, ollama launch connects coding agents such as Claude Code and Codex to your local models.

There's a cloud path when your hardware runs out. Ollama's cloud models run on Ollama's servers, need an account, and aren't downloaded. They're opt-in, and the FAQ explains how to switch cloud features off completely if you want Ollama to stay local.

If you need…Why Ollama fits
A working local model in minutesOne command, library picks the file
Several models, switched by nameLoads and unloads for you
A setup you can hand to someone elseModelfile
Something your other apps already supportPort 11434 is the common default

Ollama defaults that catch people out

Ollama's convenience comes from defaults, and a few of them matter.

Context length. Ollama's context length docs say it picks a default based on your VRAM: 4k tokens under 24 GiB, more on bigger cards. The same page recommends at least 64,000 tokens for agents, coding tools and web search. If a coding agent on Ollama seems to forget your files halfway through, check this first. You can raise it in the app's settings or with the OLLAMA_CONTEXT_LENGTH environment variable.

Quantisation on import. The import docs say Ollama doesn't quantise GGUF models during import. You prepare them first with llama.cpp's llama-quantize. So if you bring your own GGUF models, you'll end up running llama.cpp tools anyway.

Parallel requests cost memory. Per the FAQ, each parallel request slot enlarges the context allocation. Four parallel requests on a 2k context take the memory of 8k.

None of these are bugs. They're choices someone made for you. llama.cpp just makes you make them yourself.

Ollama vs llama.cpp: how to decide

Pick Ollama if something else will talk to it. An editor, a chat front end, a script, a coding agent. Ollama's API is what most of those tools expect, and model management is handled. That's still the right answer for most people running models on a laptop.

Pick llama.cpp if you want control or the newest models. Researchers testing fresh releases, people tuning for one specific GPU, and anyone who wants a server process they start and stop themselves, with no cloud option to manage, should start here. llama-server in router mode covers much of what used to require Ollama.

Use both. This is common. Run Ollama as the everyday backend, and keep llama.cpp for converting and quantising models, or for trying a model Ollama doesn't support yet.

Your situationStart with
First local model, just want it workingOllama
Connecting an editor or agent to a local modelOllama
Running a model released this weekllama.cpp
Tuning context, batching or GPU layersllama.cpp
Strict "nothing leaves this machine" policyllama.cpp, or Ollama with cloud features disabled
Serving a team or a production appCompare a dedicated serving engine too

That last row matters. Both tools are at their best on one machine with a small number of users, even though llama-server handles parallel requests. If you're serving a team or an app, read our vLLM vs Ollama comparison before you commit. If you want a graphical app instead, LM Studio vs Ollama covers that choice, and our Ollama alternatives guide sorts the wider field by what you're replacing.

Where Taku fits

Ollama and llama.cpp answer "how do I run this model?" Neither answers "what should I run, and what should it do once it's running?" That's usually where people stall: a working model and no working setup around it.

Taku takes the other end. It's an AI-native desktop workspace where you mirror an AI setup someone already got working, run it, remix it for your own files and keep it. It doesn't replace your runtime, and if you want full control of a local model, llama.cpp or Ollama is still the right tool. Browse the free apps to see the shape of it. Taku is in Beta, and the Mac app is available now.

FAQ

Does Ollama use llama.cpp?

Yes. Ollama's README lists llama.cpp as its supported backend, and its repo pins a specific llama.cpp version with its own patches. Its developer guide also describes a separate MLX engine for Safetensors models on Apple silicon.

Is llama.cpp faster than Ollama?

For GGUF models on the same quantisation and settings, they share an engine, so large gaps usually come from different defaults like context size or GPU offload rather than the engine itself. Any benchmark you read is specific to one machine, one build and one configuration.

What is llama-server?

It's llama.cpp's HTTP server. It exposes OpenAI-compatible and Anthropic-compatible routes, includes a web UI, and listens on port 8080 by default. Started without a model, it runs in router mode and loads models on demand.

Can Ollama use GGUF files from Hugging Face?

Yes. Point a Modelfile's FROM line at a local GGUF file, including split files, and create the model. Ollama won't quantise it for you, so download the quantisation you want or make one with llama.cpp first.

Can I use llama.cpp and Ollama on the same machine?

Yes. They run on different default ports (8080 and 11434) and keep separate model stores, so they don't conflict. You'll store some weights twice.

Which is better on a Mac?

Both treat Apple silicon well. llama.cpp calls it a first-class citizen with Metal support, and Ollama adds an MLX engine there.