Same GGUF, two jackets — ollama vs llama.cpp, measured
One byte-identical 2,497,280,480-byte GGUF ran 7.8 tok/s through ollama 0.40.15 and 10.5 tok/s through stock llama.cpp on the same 4-core box — a 35% jacket tax.
Same GGUF, ollama vs llama.cpp is one file wearing two jackets. The sha256 keys matched, the hardware didn't, the window stayed 4096. What changed was the doorway: 7.8 tokens/s through ollama 0.40.15, 10.5 through stock llama.cpp on the same 4-core, 8 GB CPU box — a 35% jacket tax.
Not brain against brain. The same llama-server, asked to run twice.
Is ollama a different engine than llama.cpp?
No. The process tree:
46212 /usr/local/bin/ollama serve3154608 /usr/local/lib/ollama/llama-server --model /usr/share/ollama/.ollama/models/blobs/sha256-3e4cb141…
Generating tokens under ollama is llama-server, llama.cpp's own binary, pointed at the blob ollama pull downloaded. ollama supervises one engine; it is not a rival one.
How do you prove both engines got the same file?
Copy the blob, hash both copies — one hash, twice, 2,497,280,480 bytes:
sha256sum /usr/share/ollama/.ollama/models/blobs/sha256-3e4cb14174460404e7a233e531675303b2fbf7749c02f91864fe311ab6344e4f /tmp/model.gguf → 3e4cb14174460404e7a233e531675303b2fbf7749c02f91864fe311ab6344e4f
Identical bytes. Every number below is about the doorway, not a "different model".
What did the same box measure?
Three one-sentence asks, greedy decoding, a 128-token budget:
| engine | ask | prompt tokens | prompt tok/s | gen tokens | gen tok/s |
|---|---|---|---|---|---|
| llama.cpp | q1 · GGUF quantization? | 12 | 28.9 | 128 | 10.41 |
| llama.cpp | q2 · RAM for 7B Q4_K_M? | 23 | 37.5 | 128 | 10.48 |
| llama.cpp | q3 · keep_alive? | 14 | 30.5 | 42 | 10.57 |
| ollama | q1 · GGUF quantization? | 22 | 19.8 | 128 | 7.75 |
| ollama | q2 · RAM for 7B Q4_K_M? | 33 | 21.7 | 128 | 7.79 |
| ollama | q3 · keep_alive? | 24 | 22.3 | 128 | 7.83 |
Generation per ask: llama.cpp 10.41 / 10.48 / 10.57 vs ollama 7.75 / 7.79 / 7.83. The identical question cost 12 prompt tokens on llama.cpp and 22 on ollama — the template adds about ten tokens of overhead per ask. ollama's first ask carried a 5.80 s cold load (load_duration) that warm asks skipped.
ollama's cold load — the residency convenience you are paying for, timed on the same box.
Where does the jacket tax come from?
llama.cpp: current build 11429, tuned -t 4, no supervisor — worth ~+2.7 tok/s generation and ~+11 tok/s prompt reading here. ollama bundles an older fork behind default knobs, buying pulls, switching and residency. Version-and-defaults gap; versions move.
- pull once:
ollama pull qwen3:4b, then find the largest file under/usr/share/ollama/.ollama/models/blobs/ - hash, copy, hash the copy — both sha256 lines must match before any lap counts
- lap one, ollama:
/api/generatewithstream:false; readeval_durationandeval_count, divide by hand - lap two, llama.cpp:
llama-server -m /tmp/model.gguf -c 4096 -t 4, same prompts; readtimings.predicted_per_second - compare only same-box numbers, versions in the receipt, no cross-machine folklore
- last tested 2026-11-09 · kernel 7.2.11-arch1-1 · 4-core / 8 GB VM, CPU-only
- ollama 0.40.15 (CPU-only mode, auto threads) · llama.cpp 0.6.0-dev build 11429
-t 4· ctx 4096 both · num_predict 128 / -n 128, temperature 0 - qwen3:4b GGUF · 2,497,280,480 B · sha256 3e4cb141…e4f · byte-identical both sides
- honesty ledger: llama.cpp cold load unrecorded; RSS accounting differs (4.87 GiB vs 3.05 GiB); no GPU in this race