Skip to content

Self HostingArticle

Is llama.cpp Faster Than Ollama? Real CPU Benchmarks

  • Updated
  • 13 min read
  • VPS Lane Engineering
Short answer

Not on CPU in our test. With one GGUF file and comparable settings both ran at similar speed. Defaults and tuning can cause larger gaps.

How we tested this

Benchmarks run on Ubuntu 24.04.5 LTS, 2 vCPU Intel Xeon at 2.10GHz, 7.8 GiB RAM, no GPU, with Ollama 0.40.19 and llama.cpp tag b12950 (commit 8c447d5) built from source with GCC 13.3. Models were qwen2.5 0.5B and 1.5B in Q4_K_M, loaded from the same blob files. The main inference settings used by Ollama were repeated for llama-server, including context size, slots, threads, batch sizes, load mode and flash attention. The chat template settings and the Ollama context shift options differed. Memory was read as PSS from /proc smaps_rollup. GGUF import with ollama create was run and reused the existing blob. The API calls were run on test ports 11534 and 18093. The systemctl override for OLLAMA_NUM_PARALLEL and the journalctl log check were not run here because the test box has no systemd, so the variable was set on the command line and the runner command was read from the Ollama server log instead. GPU, Mac and Windows behaviour was not tested and follows the cited documentation.

Is llama.cpp Faster Than Ollama

llama.cpp was not faster than Ollama on our CPU server when both ran the same GGUF file with comparable settings.

In our test on a 2 vCPU VPS, generation speed through each API landed within a few percent in both directions, and prompt processing showed no clear winner. The reason is simple: Ollama 0.40.19 runs a bundled copy of llama-server, the server program from llama.cpp, for these models. You are comparing two servers built on the same inference code, with different engine builds, launch settings and server layers.

Differences show up in three places. llama-server opens several request slots by default while Ollama opens one, llama.cpp exposes more direct engine configuration options, and a fresh llama.cpp build is usually newer than the copy inside Ollama. GPU benchmark gaps can come from engine revisions, model formats, offload, batching, speculative decoding and server defaults, so check how each test was run.

Ollama vs llama.cpp results at a glance, same GGUF file, comparable engine settings, 2 vCPU, medians
TestOllama 0.40.19llama.cpp b12950Result
Generation, 0.5B model, 7 runs21.84 tok/s22.34 tok/sWithin noise
Generation, 1.5B model, 7 runs8.85 tok/s8.79 tok/sWithin noise
Prompt processing, about 720 tokens, 5 runs149.2 tok/s137.1 tok/sRanges overlap
Cold start to a 1 token reply, 5 runs1.55 s1.43 sWithin noise
Memory (PSS), 4,096 context, 0.5B686 MB in two processes655 MBClose
4 parallel requests, default settings, 5 runs22.2 tok/s total51.7 tok/s totalllama.cpp, because of defaults
4 parallel requests, both with 4 slots, 5 runs50.8 tok/s total51.7 tok/s totalWithin noise

Does Ollama Use llama.cpp Under the Hood

Ollama uses llama.cpp under the hood for GGUF models on CPU, and in version 0.40.19 it does so by starting a real llama-server process.

These are the relevant lines from the Ollama server log on our test VPS, shortened with ... where file paths were long. They were written when we sent the first request.

Ollama 0.40.19 log on Ubuntu 24.04.5
msg="vram-based default context" total_vram="0 B" default_num_ctx=4096
msg="disabling mmap for llama-server load by default" reason=cpu
msg="using llama-server for model"
msg="starting llama-server" cmd=".../lib/ollama/llama-server --model .../blobs/sha256-c5396e06... --port 34493 --host 127.0.0.1 --no-webui --offline -c 4096 -np 1 ... --no-jinja --chat-template chatml --load-mode none --flash-attn auto -b 512 -ub 512 --context-shift --keep 4"

Three details in that command explain most of the speed questions people ask:

  • -c 4096 is the context size Ollama used in this test, logged as a default based on 0 B of GPU memory. Change it with OLLAMA_CONTEXT_LENGTH or the num_ctx request option.
  • -np 1 leaves a single slot open, so any request that arrives second sits in line until the first one finishes. The Ollama FAQ lists OLLAMA_NUM_PARALLEL with a default of 1.
  • --load-mode none together with the "disabling mmap" line means the model file is read into memory instead of memory mapped on CPU.

The engine version also matters. The LLAMA_CPP_VERSION file in the Ollama v0.40.19 source names llama.cpp build b12734, while our upstream build was b12950. A standalone llama.cpp build can therefore be newer than the copy inside Ollama, and new model support and kernel changes land in upstream llama.cpp first.

Ollama is not only a wrapper. It also has an MLX runtime for supported models on Apple Silicon, which this CPU test does not cover, plus its own model registry, API and scheduler.

How We Tested Ollama and llama.cpp

We tested Ollama and llama.cpp on one VPS with the identical GGUF file, matching context, threads, batch sizes and sampling settings.

Their chat templates differed, as explained below, so the two APIs may not have processed identical token sequences.

Test environment
ItemValue
CPUIntel Xeon at 2.10GHz under KVM, CPUID family 6 model 207, 2 vCPU with AVX512 and AMX CPU features exposed through KVM, no GPU. The exact Xeon SKU was not exposed by the hypervisor
RAM7.8 GiB
OSUbuntu 24.04.5 LTS
Ollama0.40.19 official Linux build, bundled llama.cpp b12734
llama.cpptag b12950, commit 8c447d5, built with -DGGML_NATIVE=ON and GCC 13.3
Modelsqwen2.5 0.5B and 1.5B, Q4_K_M, pulled with Ollama
SettingsMatched inference settings: 4,096 context, 1 slot, 2 threads, batch 512, micro batch 512, no mmap and flash attention auto. Temperature 0, seed 42 and 128 output tokens. Chat template handling differed

Both runners read the same model file. llama.cpp was pointed at the blob Ollama downloaded, whose SHA256 begins c5396e06af294bd1, so quantization and weights were identical.

  1. Warm upOne request to each runner first, not counted, so model loading was not mixed into speed numbers.
  2. AlternateRuns alternated between Ollama and llama.cpp, so background load hit both sides equally.
  3. Unique promptsEach run changed the start of the prompt, so a cached prompt could not skip work.
  4. Read server timingsSpeed came from each server, eval_count over eval_duration in Ollama and timings in llama-server.
  5. Report mediansWe report the median and the range, not the best run.

The two request paths did not use the same chat template. Ollama started its runner with --no-jinja --chat-template chatml, and ollama show lists template source go_template for this model, so Ollama formats the conversation with its own Go template. The standalone llama-server used the Jinja template stored in the GGUF file. We sent the same message content and sampling settings, but the rendered prompts and token counts may have differed, and that can affect timing.

Token Generation Speed Results

Token generation speed, the rate at which new words appear, was the same for both runners within normal run to run noise.

Generation speed through each API, 128 output tokens, tok/s
ModelOllama median of 7 (range without spike runs)llama.cpp median of 7 (range without spike runs)Difference
qwen2.5 0.5B Q4_K_M, 7 runs21.84 (21.71 to 23.79)22.34 (22.12 to 24.11)llama.cpp +2.3%, won 5 of 7 pairs
qwen2.5 1.5B Q4_K_M, 7 runs8.85 (8.44 to 10.07)8.79 (8.09 to 10.11)Ollama +0.7%, won 4 of 7 pairs

Medians include all seven runs. Ranges exclude the identified host load spikes, runs 5 and 6 for 0.5B and run 6 for 1.5B, and are not the full observed ranges. For 1.5B the excluded llama.cpp value of 8.16 happens to fall inside the range anyway. The raw table below includes every measurement. Each runner led one model by a few percent and the ranges overlap, which is what you expect from two builds of the same inference code.

CPU generation speed depends on model size, memory bandwidth, cache behaviour, processor instructions and thread settings. In this test, changing the model size moved speed far more than changing the runner. Going from 0.5B to 1.5B cut speed by more than half.

Raw generation runs in tok/s, Ollama then llama.cpp, in the order they ran
Run0.5B Ollama0.5B llama.cpp1.5B Ollama1.5B llama.cpp
121.7122.429.759.03
221.8424.1110.0710.11
323.7922.349.619.23
422.1222.528.668.79
5, load spike on 0.5B3.514.958.858.63
6, load spike7.007.355.068.16
723.4322.128.448.09

llama-bench Baseline for the Same File

llama-bench, the benchmark tool shipped with llama.cpp, measures the raw engine with no HTTP server in the way.

bash
./build/bin/llama-bench -m "$BLOB" -t 2 -p 512 -n 128 -r 5
Real output, Ubuntu 24.04.5, 2 vCPU
| model                          |       size |     params | backend    | threads |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | ------: | --------------: | -------------------: |
| qwen2 1B Q4_K - Medium         | 373.71 MiB |   494.03 M | CPU        |       2 |           pp512 |        155.66 ± 6.36 |
| qwen2 1B Q4_K - Medium         | 373.71 MiB |   494.03 M | CPU        |       2 |           tg128 |         24.07 ± 0.28 |

build: 8c447d5 (1)

pp512 is prompt processing of a 512 token prompt and tg128 is generation of 128 tokens, each repeated 5 times. The model column says qwen2 1B because llama-bench rounds the size label, while the params column shows the real 494.03 M parameters of the 0.5B file. The raw engine result is a useful reference, but it is not directly comparable to the chat API numbers, because the request path and prompt format differ.

Ollama Verbose Output

Ollama verbose mode prints its own timing, which is the quickest speed check if you only have Ollama installed.

bash
ollama run qwen2.5:0.5b --verbose "Explain in two sentences what a reverse proxy does."
Real output, Ollama 0.40.19, model already loaded
total duration:       1.4429445s
load duration:        1.250278ms
prompt eval count:    40 token(s)
prompt eval duration: 106.145ms
prompt eval rate:     150.74 tokens/s
eval count:           34 token(s)
eval duration:        1.333087s
eval rate:            25.50 tokens/s

The eval rate line is generation speed. Short answers like this one swing more than a 128 token run, so use several longer runs before you draw a conclusion.

Prompt Processing Speed Compared

Prompt processing speed, how fast the runner reads your input before answering, showed no clear winner between the two runners.

We sent five fresh prompts of about 720 tokens to each runner. With matching engine flags Ollama reached a median of 149.2 tok/s (136.3 to 158.3) and llama.cpp 137.1 tok/s (128.5 to 145.6). An earlier round with the llama-server default batch and mmap settings gave 141.7 and 141.3 tok/s, so we treat the gap as noise on a shared host rather than a real lead. Prompt processing matters for retrieval augmented generation, long chats and coding tools, because those send thousands of tokens before the first word comes back.

Raw prompt processing runs, about 720 token prompts, tok/s
RunOllamallama.cpp
1136.3128.5
2158.3141.0
3149.2129.8
4138.5145.6
5157.5137.1

Short prompts are less useful for isolating prompt processing, because fixed overhead can dominate the measurement. llama-server also reports only the prompt tokens it did not find in its cache, so a cached system prompt makes its count look smaller than the count Ollama reports.

Cold Start and RAM Usage

Memory use was close when both runners loaded the model with the same settings, and median cold start times were also similar.

The two cold start clocks began from different starting states, as the table shows.

Cold start and memory, qwen2.5 0.5B, measured from the client and with /proc smaps_rollup
MeasureOllama 0.40.19llama.cpp b12950
Cold start to a 1 token reply, median1.55 s1.43 s
Cold start range, 5 runs1.27 to 1.62 s1.28 to 3.76 s
What the clock coversOllama daemon running, model unloadedllama-server process stopped, including process startup
Memory (PSS), 4,096 context, 1 slot35 MB daemon plus 651 MB runner655 MB
Memory (PSS), llama-server with no flagsNot applicable1,060 MB

These are application level cold start measurements, not a controlled comparison of model loading time alone. Ollama keeps its daemon running, while llama-server loads the model when its process starts. Both clocks stop when a 1 token reply arrives at the client. Two llama.cpp runs were slowed by load from other work on the host, which is why its range is wide. A warm model benchmark and a cold start benchmark measure different things, so keep load time, first token time and steady generation speed apart. Ollama also unloads an idle model after 5 minutes by default, so the next request pays the load cost again. Set keep_alive per request or OLLAMA_KEEP_ALIVE on the server to keep it loaded.

Memory mapped model pages are file backed and Linux can reclaim them under memory pressure. Model data loaded into anonymous memory, as in both of these runs, cannot be dropped like file cache, although it can be swapped. PSS splits shared pages fairly between processes, so it is a better total than resident memory. The bigger lesson is in the last row: llama-server with no flags used more RAM, because its log showed 4 slots sharing a 32,768 token context, the trained context length of this model.

Parallel Requests and Default Slots

Parallel requests expose a difference in default settings, because llama-server opens several slots while Ollama opens one.

We sent four requests at once, 64 output tokens each, and measured total throughput. With one slot both runners queue the requests, so the fourth user waits for the first three.

Four simultaneous requests, qwen2.5 0.5B, 2 vCPU, 5 runs each, total tok/s median (range)
ConfigurationTotal throughputAll four done in
Ollama default, 1 slot22.2 (21.6 to 24.1)10.6 to 11.8 s
llama-server with -np 123.0 (20.9 to 24.2)10.6 to 12.2 s
llama-server defaults, 4 auto slots51.7 (47.9 to 53.7)4.8 to 5.3 s
Ollama with OLLAMA_NUM_PARALLEL=450.8 (40.7 to 52.4)4.9 to 6.3 s

Batching four requests together more than doubled total throughput on the same two cores. Once Ollama was given four slots, it matched llama-server within noise, 50.8 against 51.7 tok/s. So the large concurrency gaps you see online mostly measure a default setting, not a faster engine. Higher total throughput does not always mean lower latency for each user, and the result depends on model size, context, available memory and request length.

On a systemd install of Ollama, add the setting with an override file.

bash
sudo systemctl edit ollama
# add these two lines in the editor, then save
[Service]
Environment="OLLAMA_NUM_PARALLEL=4"

sudo systemctl restart ollama

Check that it applied with systemctl show ollama --property=Environment. With four slots, Ollama raised the context to 16,384 in our log, four slots of 4,096 each, so memory use grows with each slot you add.

Does the Speed Difference Change on GPU or Apple Silicon

The speed difference can change on a GPU or Apple Silicon, and our CPU test does not measure either one.

The figures in this section come from the cited third party sources and vendor documentation, not from our own tests.

  • NVIDIA and AMD GPUs. Speed depends on how many layers fit in GPU memory. Ollama normally selects GPU offload automatically, while llama.cpp exposes more direct controls for layer offload, KV cache type and Mixture of Experts placement. Those controls can help when tuning for a specific GPU.
  • Apple Silicon. Since version 0.19, Ollama has an MLX runtime for supported models on Macs. That is a different engine from GGUF on llama.cpp, so an MLX result compares two engines, not two front ends.
  • Batching servers. vLLM is built for continuous batching of many requests, mainly on GPUs. It is worth testing when many users share one GPU, not as a default for one person on a CPU VPS.

One published GPU test, listed under Sources, ran Llama 3.1 8B in Q4_K_M from one GGUF file on an RTX 5090 with Ubuntu 24.04. It reported 249 tok/s generation for llama.cpp commit 3466812 against 108 tok/s for Ollama v0.33.2, while prompt processing was close at 13,561 and 13,426 tok/s. That test compared a source build with an older Ollama release, so it shows how large GPU gaps can be, not what every GPU will see.

Ollama reported decode rising from 58 to 112 tok/s for one model on Apple Silicon when it moved to MLX, with a different quantization in each run. That shows how much the engine and model format matter, and why a CPU result like ours cannot predict GPU or Mac numbers.

Why Other Benchmarks Show Big Gaps

Other benchmarks show big gaps between Ollama and llama.cpp mainly because they compare different builds or different defaults on GPUs.

  • Engine version. Ollama ships a pinned llama.cpp build. A fresh llama.cpp build can include newer GPU kernels that are not in Ollama yet.
  • Build flags. A llama.cpp build made for your exact GPU or CPU can beat a general prebuilt binary. Mozilla.ai found build options and shader toolchains moved results more than the choice of server.
  • Context and slots. A test with Ollama at 1 slot and llama-server at 4 slots measures defaults, as shown above.
  • Speculative decoding. Draft model settings differ between tools and can help or hurt depending on hardware.

Mozilla.ai tested several servers built on llama.cpp and found prompt processing within a few percent once weights and environment were held fixed. Large gaps are real for the people who measured them, but they rarely transfer to a different machine.

How to Benchmark Ollama and llama.cpp Yourself

To benchmark Ollama and llama.cpp yourself, build llama.cpp, point it at the GGUF file Ollama already downloaded and compare server timings.

These steps apply to Ubuntu 22.04 and 24.04 with Ollama installed by its official script and the model already pulled. They change nothing in your Ollama setup, and you can delete the llama.cpp folder afterwards to undo them.

Build llama.cpp From Source

Building llama.cpp from source on Ubuntu needs a compiler, CMake and Git, and the build took about 8 minutes on 2 vCPU.

bash
sudo apt update
sudo apt install -y build-essential cmake git
git clone --depth 1 --branch b12950 https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build -DGGML_NATIVE=ON -DLLAMA_CURL=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build build -j2 --target llama-cli llama-server llama-bench
./build/bin/llama-server --version

Pin the tag you build so your result can be repeated. The version line should print a commit hash. A shallow clone reports build 1, which is normal.

Find the Ollama GGUF File

The Ollama GGUF file is the blob named on the FROM line of the model Modelfile.

bash
BLOB=$(ollama show --modelfile qwen2.5:0.5b | awk '/^FROM /{print $2}')
echo "$BLOB"
sha256sum "$BLOB"

On a standard Linux service install the path starts with /usr/share/ollama/.ollama/models/blobs/. The blob name is its own SHA256 hash, so a matching sha256sum result proves both runners will load the same bytes. The file may be readable only by the ollama user, so run the commands with sudo if you get a permission error.

Start llama-server With Comparable Settings

Start llama-server with comparable settings to Ollama, meaning the same context, slots, threads, batch sizes and load mode.

bash
./build/bin/llama-server -m "$BLOB" --host 127.0.0.1 --port 18093 \
  -c 4096 -np 1 -t 2 -tb 2 -b 512 -ub 512 --load-mode none --flash-attn auto
curl -s http://127.0.0.1:18093/health

The health check returns {"status":"ok"} once the model is loaded. Port 18093 is just an unused example port. Run the server in a second terminal or with nohup, since it stays in the foreground.

Compare Generation Speed

Compare generation speed by sending the same prompt to both APIs and reading the speed each server reports.

bash
curl -s http://127.0.0.1:11434/api/chat -d '{
  "model": "qwen2.5:0.5b", "stream": false,
  "messages": [{"role": "user", "content": "Explain how a Linux server boots."}],
  "options": {"temperature": 0, "seed": 42, "num_predict": 128, "num_ctx": 4096, "num_thread": 2, "num_batch": 512}
}' | python3 -c 'import json,sys; d=json.load(sys.stdin); print(round(d["eval_count"]/d["eval_duration"]*1e9, 2), "tok/s")'

curl -s http://127.0.0.1:18093/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "messages": [{"role": "user", "content": "Explain how a Linux server boots."}],
  "temperature": 0, "seed": 42, "max_tokens": 128
}' | python3 -c 'import json,sys; print(round(json.load(sys.stdin)["timings"]["predicted_per_second"], 2), "tok/s")'

Run each pair five times or more and compare medians. A single run proves little on a shared VPS. The scores measure speed only. They do not prove that answers are equally good. Even with the same model file and sampling settings, different chat templates can change the prompt tokens and the resulting answers. Before comparing, check the runner command in the Ollama log, for example with journalctl -u ollama | grep "starting llama-server", to confirm the effective context, threads and batch size.

Features APIs and Quantization Compared

Features, APIs and quantization tools are where Ollama and llama.cpp differ most, as compared in the table below.

Ollama vs llama.cpp features
FeatureOllamallama.cpp
InstallOfficial script or desktop appBuild from source, packages or release binaries
Get a modelollama pull from the Ollama library-hf flag pulls a GGUF from Hugging Face, or any local file
Own GGUF filesA Modelfile with a FROM line, then ollama createLoad the file directly with -m
QuantizePull a quantized tag or import a GGUF file you quantized elsewherellama-quantize converts to many formats
Default port11434 on 127.0.0.19931 on 127.0.0.1 in our build, set with --port
Native API/api/chat, /api/generate and more/completion, /health, /slots and more
OpenAI style API/v1/chat/completions, /v1/embeddings and more, a subset/v1/chat/completions, /v1/responses, /v1/embeddings
Parallel users1 slot unless OLLAMA_NUM_PARALLEL is setAuto slots by default, set with -np
Built in authNone on the local API--api-key option
TuningModelfile parameters and environment variablesMore direct engine level flags and configuration options

Both OpenAI style APIs worked in our test. OpenAI compatible does not mean identical behaviour, so check endpoint availability, supported parameters, tool calling and response formats before you switch a client from one runner to the other.

If you want a ready server for this, our AI VPS hosting for Ollama and llama.cpp plans come with full root access for either runner.

Securing an LLM API on a VPS

Securing an LLM API on a VPS starts with keeping it on 127.0.0.1, because both runners listen only there by default.

We confirmed it with ss -ltnp, which showed both test servers bound to 127.0.0.1 only. Problems start when you set OLLAMA_HOST=0.0.0.0 or --host 0.0.0.0 to reach the API from outside.

  • Ollama has no login on its local API. Anyone who can reach the port can run models and pull new ones, using your CPU and disk.
  • llama-server --api-key blocks requests without the key, but the key travels in clear text unless you add HTTPS.
  • A reverse proxy such as Caddy or Nginx in front adds HTTPS and a password or token, and leaves the runner itself on 127.0.0.1.
  • A firewall rule that allows only your own IP address cuts exposure further.

None of these stop a user you let in from sending heavy prompts. Limit context size and slots so one client cannot use all the RAM. After any change, test from another machine with curl and confirm you get an error without the key or password.

Which Should You Choose Ollama or llama.cpp

Choose Ollama when ease matters most and choose llama.cpp when you need control, parallel users or the newest engine build.

For one user on a CPU VPS, both delivered similar generation speed in our test. Choose Ollama for simpler model management, or llama-server when you need direct control over inference settings and parallel slots.

Ollama or llama.cpp by use case
Your situationBetter pickWhy
First local model on a VPS or laptopOllamaOne command install and ollama pull
Apps like Open WebUI or n8n calling one modelOllamaSimple API, models load and unload by themselves
Several users or agents at the same timellama.cpp, or Ollama with more slotsParallel slots raise total throughput
A brand new model architecturellama.cppNewer upstream model support and direct control over engine updates
Tight RAM or a small GPUllama.cppExact control of context, KV cache type and offload
Custom quantization formatsllama.cppllama-quantize plus direct loading
Repeatable benchmarksllama.cppllama-bench measures the engine alone

Picking one does not rule out the other. Both can share a server on different ports, and llama.cpp can load the GGUF blobs Ollama already downloaded. Either one can serve tools such as self-hosted n8n workflows through its API, and both run well inside Docker containers. On a CPU VPS, picking a smaller model or a lighter quantization changes speed far more than switching runners does.

Troubleshooting Slow Local LLM Speed

Slow local LLM speed usually comes from settings or hardware, and the fixes below apply to both runners.

Common causes of slow generation
SymptomLikely causeFix
Speed far below others with the same CPUOther processes or a build in progressCheck uptime and top, retest when the load is low
First reply slow, later replies fastModel loadingKeep the model loaded with keep_alive or keep llama-server running
Second user waits for the firstOne slotSet OLLAMA_NUM_PARALLEL or -np above 1
Out of memory with llama-serverFull model context reservedSet -c to the context you really need
Long prompts take seconds before outputPrompt processing is slow on CPUShorter prompts, a smaller model, or a GPU
Numbers change a lot between runsShared or throttled CPURun five or more times and compare medians

Questions people ask

Is llama.cpp faster than Ollama?

Not on CPU in our test. With the same GGUF file and comparable settings the speed was similar. llama.cpp leads with parallel users by default and can gain from tuning.

Does llama.cpp use less RAM than Ollama?

Not by much in our test. With a 4,096 context and one slot, memory was close. llama-server with no flags used more because it took the full model context.

Does Ollama use llama.cpp?

Yes. Ollama 0.40.19 starts a bundled llama-server from llama.cpp build b12734 for GGUF models on CPU. It also has an MLX runtime on Apple Silicon.

Are llama.cpp and Ollama the same thing?

No. llama.cpp is the inference engine and server. Ollama is a model manager, API and scheduler that runs a llama.cpp engine for most local models.

Can llama.cpp use models downloaded by Ollama?

Yes. Ollama stores GGUF files as blobs named by their SHA256 hash, and llama.cpp can load that file directly with the -m flag.

Is Ollama faster than llama.cpp on Apple Silicon?

It depends on the runtime. Ollama can use MLX for supported models on Macs, which is a separate engine from GGUF on llama.cpp, so test your own model.

What is faster than Ollama for many users?

For many users on one GPU, llama.cpp with tuned slots or a batching server such as vLLM can give more total throughput. Test with your own load.

Why does Ollama use only 4096 tokens of context?

Ollama picks a context size from GPU memory, and with no GPU it chose 4,096 in our log. Raise it with OLLAMA_CONTEXT_LENGTH or num_ctx.

Sources

  1. Ollama documentation, FAQ
  2. Ollama documentation, OpenAI compatibility
  3. Ollama blog, Ollama is now powered by MLX on Apple Silicon
  4. vLLM documentation
  5. Ollama vs llama.cpp speed test on an RTX 5090, third party
  6. Ollama source, LLAMA_CPP_VERSION at v0.40.19
  7. llama.cpp, llama-server README
  8. llama.cpp, llama-bench README
  9. Mozilla.ai, Benchmarking local LLM servers

Written and tested by VPS Lane EngineeringWe run every step on real servers before publishing and update the article when the software changes.