Keep Ollama when its model library, named configurations and client connections already do the job. I’d choose llama.cpp directly when you can name a specific requirement: a particular build or hardware backend, explicit GPU allocation, cache settings or a model architecture your installed runner doesn’t support yet. Switching solely because “the engine must be faster” skips the settings that determine the result.
Both now offer convenient ways to download models and chat. The useful distinction is which controls you need to own and maintain.
Name the setting that blocks your current workflow
Ollama handles named models, downloads, serving and model loading through its app, commands and API. You can also customize the model’s behavior: the Modelfile reference includes PARAMETER, SYSTEM and TEMPLATE. A custom system message, context setting or sampling configuration doesn’t automatically require leaving Ollama. The existing Modelfile creation guide covers that complete procedure.
Direct llama.cpp exposes the engine’s controls in its server options. These include separate generation and prompt-processing CPU thread counts, logical and physical batch sizes, GPU layer allocation, multi-GPU split modes and tensor splits, and the K and V cache data types. The cache holds information used while processing the conversation; its representation is a separate choice from the model weights’ quantization.
That control is useful when it resolves a measured limitation. For example, an experiment that needs a fixed tensor split across two GPUs needs a recorded split configuration. A normal chat that merely needs a shorter context can start with the managed runner’s documented setting.
Don’t choose from an outdated setup comparison
The current llama.cpp quick start offers installers, prebuilt binaries, Docker and source builds. It documents llama cli for a conversation and llama serve for a server, including direct Hugging Face downloads. Compiling C++ is an option, rather than a requirement for every user.
The Llama app for Mac and Windows provides a native menu or tray entry, model selection and a browser chat. The server also has a built-in router with model-directory and INI preset options, so a third-party router isn’t a universal prerequisite for serving multiple available models.

Convenience overlaps, but configuration ownership still differs. With direct llama.cpp, record the build, model file and settings you select, then review them when updating. With Ollama, record the installed version, exact model tag and relevant configuration; its bundled backend isn’t necessarily identical to a separate llama.cpp build downloaded that day.
Keep the model and template comparable
A family name doesn’t identify a reproducible comparison. Match the exact model variant and quantization, prompt template, system message, context, output allowance and thinking behavior. Also confirm that both runs use the intended hardware backend and GPU allocation.
You can import an existing GGUF into Ollama through a Modelfile. Importing a GGUF doesn’t quantize it: prepare the intended quantized file first. For a split GGUF, preserve the original shard filenames and use a pattern that matches all shards. “Both say 4-bit” still doesn’t establish identical files or arithmetic.
Context deserves its own check. Ollama’s context guide uses VRAM-based defaults and explains that larger contexts require more memory. Set the context deliberately for the task and inspect the allocated context and processor split with ollama ps. Don’t copy one old default into a performance comparison and assume both runners allocated the same work.
Read measured cases before choosing a speed winner
Two published comparisons answer different performance questions. Their results should stay separate.
Atomic Chat’s matched RTX 5090 comparison reports medians from ten measured runs after five warmups, on Ubuntu 24.04 with CUDA 12.8. It used Ollama 0.33.2 and a source-built llama.cpp at commit 3466812, with the same Llama 3.1 8B Instruct Q4_K_M GGUF, a 4,096-token context, batch 512 and all 33 layers on GPU. Each request had a 445-token prompt with a unique prefix and generated exactly 256 tokens.
In that configuration, the publisher reports generation at 249 tokens per second for llama.cpp versus 108 for Ollama, and time to first token of 83 versus 221 milliseconds. Peak VRAM was 5.6 GB for both. The result supports trying that build and configuration on a matching workload; it doesn’t isolate an unavoidable percentage cost imposed by every Ollama release. Atomic Chat also develops its own local AI application, so the result remains an attributed vendor comparison.
The LCT project’s caption-workflow report uses an M2 Pro with 16 GB memory, Ollama 0.40.14 and llama.cpp build 12110. It runs 60 cases twice, with context 4,096, temperature 0.3 and thinking off. Its primary Ollama MLX column reports median first-token latency of 160 milliseconds and full-response latency of 534 milliseconds; the llama.cpp Metal column reports 146 and 542 milliseconds.
That report compares NVFP4 weights on Ollama’s MLX runner with a Q4_K_M GGUF on Metal, so it describes configured systems, not an isolated runner overhead. Its second Ollama column repeats the same backend and weights; it isn’t another independent engine. The close full-response medians also show why the first-token result alone can give the wrong impression of a short task.
I’d use these cases to choose what to investigate, then measure the task that matters on the intended configuration. They don’t form a valid pooled average: different hardware, builds, numerical formats and workloads prevent a single general speed percentage.
Separate loading, prompt processing and generation
A cold request can include loading the model into memory. A warm request can reuse an already loaded model, and repeated prompts can benefit from a cache. Keep those conditions explicit before deciding a runner is slow.
Ollama’s response fields separate total duration, loading, prompt evaluation and generation. Its duration fields use nanoseconds. Generation tokens per second can be calculated as eval_count / eval_duration × 1,000,000,000; don’t divide by a total duration that includes a different stage and call the figures equivalent.
llama-bench separates prompt processing, token generation and combined tests, with repeated measurements, averages and standard deviations. Those engine measurements exclude tokenization and sampling time. A generation benchmark therefore doesn’t replace the end-to-end wait in your chat or application.
Keep a task-quality check beside the timing. For a rewrite, compare retained names, amounts and conditions; for structured output, validate the required fields. A faster wrong answer doesn’t finish the task.
Reconnect the client without widening access
Ollama’s local OpenAI-compatible base is http://localhost:11434/v1. The current llama.cpp server documentation lists loopback 127.0.0.1 and port 9931 by default; the Llama app documents http://localhost:9931/v1. Older examples using --port 8080 explicitly select another port. Match the server you started and its actual model identifier.
Ollama’s compatibility covers a subset of the OpenAI API. Check the needed route, tool behavior and model capability when switching servers. Local Ollama ignores a placeholder client API key; llama.cpp’s API-key authentication is also absent unless configured. Keep the first connection on the same computer rather than exposing a server to fix a mismatched address.
Ollama can also route a selected cloud model through its local server. Verify the selected model and execution destination before assuming that a localhost address keeps the task on-device.
Stay with the managed workflow if an explicit Ollama model tag and its settings meet the requirement. Move to direct llama.cpp when you have a specific control to reproduce, keep the previous setup recoverable, and compare one defined task before migrating the rest. The model management guides cover the routine inventory and download work that follows.
