Comparison

Ollama vs llama.cpp: Convenience or Full Control

Published
Reading time
7 min read

Ollama vs llama.cpp compared: setup, ports 11434 vs 9931, GGUF handling, APIs, GPU backends, and how each connects to Atomic Agent.

Pick Ollama if you want models by name (ollama pull qwen3:8b), a server that starts with the app, and sensible defaults you rarely touch. Pick llama.cpp if you want to choose the exact GGUF file, every runtime flag, the newest model support as soon as it lands, and a single binary with nothing on top. Ollama lists llama.cpp as its backend, so the choice is mostly about how much control you want. Atomic Agent works with both, and can also run llama.cpp for you.

Checked on 22 Oct 2026 against the official docs linked below and Atomic Agent v0.6.10 (terminal) and Desktop v0.0.4.

Ollama vs llama.cpp at a glance

Ollamallama.cpp (llama-server)
What it isModel runner with a library, service and appC/C++ inference library with a server binary
Default address127.0.0.1:11434127.0.0.1:9931 (builds from 9 Oct 2026), 8080 before
StartDesktop app or ollama servellama-server -m model.gguf or -hf user/repo
Health checkcurl localhost:11434/api/tagscurl localhost:<port>/health
ModelsOllama library by name:tag; GGUF or Safetensors importAny GGUF file or Hugging Face GGUF repo
SettingsEnvironment variables, ModelfileCommand-line flags (or LLAMA_ARG_* variables)
APIsNative REST API and an OpenAI-compatible subsetOpenAI-compatible chat, responses, embeddings; Anthropic Messages; native endpoints
GPU backendsNVIDIA, AMD (ROCm, Vulkan), Apple MetalCUDA, HIP, Metal, Vulkan, SYCL and more
LicenseMITMIT
In Atomic AgentOllama (local) presetManaged mode, or External / Custom server

Sources: Ollama docs, Ollama README, llama.cpp README, llama-server README.

Setup

Ollama installs as an app (macOS, Windows) or a service (Linux). The server runs in the background on port 11434, and you work with short commands: ollama pull, ollama run, ollama ps, ollama ls (Ollama CLI).

llama.cpp offers an install script, prebuilt binaries, Docker images and source builds (llama.cpp quick start). You start the server yourself and say what to load:

Terminal window
llama-server -hf ggml-org/gemma-3-4b-it-GGUF --port 8080 -c 32768

-hf downloads from Hugging Face and picks Q4_K_M unless you name another quantization. Recent builds also ship a llama serve command.

One recent change catches people out: llama.cpp switched the server’s default port from 8080 to 9931 on 9 October 2026 (PR #30159). Tutorials and tools that assume 8080 stop connecting unless you pass --port 8080.

Model formats and choice

Both run GGUF. The difference is how you get it.

  • Ollama: you pull from the Ollama library by name and tag. To use your own file, create a Modelfile with FROM /path/to/file.gguf (split files with a wildcard) and run ollama create. Safetensors weights can be imported the same way (Ollama: import).
  • llama.cpp: you point at any GGUF directly, local (-m) or on Hugging Face (-hf user/repo:quant). There is no separate registry or naming layer.

Ollama also keeps the chat template in its own model manifest; with llama.cpp the template comes from the GGUF and you can override it with flags.

API compatibility

llama-server serves OpenAI-compatible chat completions, responses and embeddings, Anthropic Messages-compatible chat, and its own endpoints such as /health, /props and /slots (server README). --api-key turns on key checks; /health stays public.

Ollama serves its native API (/api/tags, /api/generate, /api/chat) plus an OpenAI-compatible subset under /v1 (OpenAI compatibility). It does not check keys locally.

GPU support

llama.cpp lists backends for CUDA (NVIDIA), HIP (AMD), Metal (Apple Silicon), Vulkan, SYCL (Intel), CANN, MUSA, OpenCL and others, with CPU paths for all (supported backends). You choose the build that matches your hardware and control offload with -ngl.

Ollama documents NVIDIA GPUs from compute capability 5.0, AMD Radeon through ROCm with extra AMD support through Vulkan, and Metal on Apple GPUs (Ollama hardware support). It decides the GPU/CPU split for you; ollama ps shows the result.

Speed

We did not benchmark Ollama against llama.cpp for this page, so there are no numbers here. What we can say from the docs: llama.cpp exposes the knobs that change speed and memory (GPU layers, context size, batch sizes, KV cache type, flash attention), while Ollama chooses defaults, including a context length based on your VRAM (Ollama: context length).

How each works inside Atomic Agent

The two connect through different routes, and that changes how tool calls are made.

Ollama is an OpenAI-compatible provider. The Ollama (local) preset saves http://localhost:11434, needs no key, lists models from /v1/models and chats through /v1/chat/completions. Tools go out in the OpenAI tools field, so the model has to support tool calling. Setup: Use with Ollama.

llama.cpp is Atomic Agent’s native backend, in two forms:

  • Managed mode (turned on by choosing Local models on first run or with atomic-agent models use; a fresh config points at an external server on port 8080): the agent installs a llama.cpp backend, downloads GGUF models (atomic-agent models pull, or Local models in the desktop app) and runs the server on 127.0.0.1:19091.
  • External / Custom server: you run llama-server and give the agent its URL (/model http://127.0.0.1:8080 in the terminal, Settings › Models › Custom server in the desktop app). The agent’s default URL is http://127.0.0.1:8080, so on new llama.cpp builds either pass --port 8080 or enter 9931.

On both llama.cpp forms the agent constrains tool calls with a GBNF grammar while the model generates, and it uses llama.cpp’s own endpoints (/props, /slots, /apply-template). If you enter an Ollama address (port 11434) in the llama.cpp field, the agent recognises it and offers the Ollama provider instead. Setup: Use with llama.cpp.

FAQ

Ollama vs llama.cpp.

  • Is Ollama built on llama.cpp?

    Ollama lists llama.cpp as its supported backend in its README. It adds its own model library, a background service, a Modelfile format and a native REST API on top. llama.cpp is the lower-level project: a C/C++ inference library with its own llama-server binary.

  • What port does llama-server use?

    Builds from 9 October 2026 on listen on port 9931 by default, after llama.cpp pull request 30159; older builds used 8080. Pass --port to pick one explicitly. Ollama uses 11434.

  • Which is faster, Ollama or llama.cpp?

    We have not measured it, so we give no numbers. llama.cpp exposes every runtime flag, such as GPU layers, context size, batch sizes and KV cache type, which gives you more to tune. Ollama picks defaults for you. Compare the same model and quantization on your own machine.

  • Can I use any GGUF file with both?

    With llama-server you pass the file with -m or a Hugging Face repo with -hf. With Ollama you write a Modelfile whose FROM line points at the GGUF and run ollama create. Ollama does not quantize GGUF on import.

  • Which one should I use with Atomic Agent?

    Either works. Atomic Agent connects to Ollama through its Ollama (local) preset and to llama-server through the External route or its own managed llama.cpp. On the llama.cpp route the agent constrains tool calls with a GBNF grammar; on Ollama tools go through the OpenAI tools field.

  • Do I need to install llama.cpp to use Atomic Agent locally?

    No. In managed mode Atomic Agent installs a llama.cpp backend, downloads GGUF models from Hugging Face and starts the server itself. You only run your own llama-server when you want to control its flags.

Which one should you pick?

Choose Ollama if you want the shortest path from “nothing installed” to a running model, and you are fine with its defaults and library names. Choose llama.cpp if you want to pick exact GGUF files, tune every flag, or run builds with the newest model support. For an agent on your own machine, Atomic Agent’s managed llama.cpp gives you the llama.cpp route without running the server by hand.


Get new posts
by email

One email when we post something new.

Share
Written by
Nadya Dudka Product, Atomic Agent
Andrew Dyuzhov SEO and growth

Run your local agent
in one click