Ollama or llama.cpp for a local service?

Choose based on who will operate the service. Ollama provides model management and a local API. llama.cpp is useful when you want direct control over a compatible model file and runtime settings.

Choose Ollama when your team wants model management and a local API with a short operating procedure. Choose llama.cpp when the service needs direct control over a GGUF and runtime arguments; in either case, require a colleague to reproduce one successful request and one restart from your notes.

Choose the operating model you want to own

Ollama's CLI provides commands to pull, list, run, inspect and stop models. Its Modelfile describes a model source and settings. llama.cpp's server accepts a model file and explicit server arguments, including context size, device placement and parallel slots. Both can expose an OpenAI-compatible chat-completions endpoint.

Decision Ollama llama.cpp
Model identity Manage a named model; preserve its import source and configuration Point directly at a GGUF; preserve its checksum
Reproducible settings Save the Modelfile and relevant server settings Save the executable build and full launch command
Serving interface Native API plus supported OpenAI-compatible endpoints Server API with OpenAI-compatible chat completions
Best first test Can a teammate recreate and serve the named model? Can a teammate recreate the backend and launch configuration?

Check the configuration behind a speed comparison before selecting a runtime. A different quantization, context or prompt template can change the result. Start with one compatible instruction-tuned GGUF supported by both installations. The artifact guide explains what to record before comparing runners.

Set a modest operating goal: another person should be able to start the service, send a request, locate the configuration and recover after stopping it. Add complexity only when the application requires it.

Make a repeatable Ollama service

With Ollama installed and running, create a file named Modelfile containing the following. Substitute the absolute path to your downloaded single-file GGUF:

FROM /absolute/path/model.gguf
PARAMETER num_ctx 4096
PARAMETER temperature 0

Import and inspect the named model:

ollama create local-service -f Modelfile
ollama show --modelfile local-service
ollama run local-service

If no Ollama server is running, start ollama serve in a separate terminal. Use the existing server when the desktop application or system service already provides it. Keep the Modelfile and the original artifact record together; use local-service as a convenient handle and the artifact record as provenance.

Ollama preserves the GGUF's existing quantization during import. That makes importing the same prepared artifact a useful starting point for this comparison. Verify the generated model configuration before timing requests, especially the context and template.

Make a repeatable llama.cpp service

Use a compatible llama.cpp build. Its source-build documentation enables Metal by default on macOS; CUDA builds on NVIDIA Linux use -DGGML_CUDA=ON. Save the backend choice with the build version. An executable built for a different accelerator is a different test setup.

From a checkout with the server built, launch the same GGUF with an explicit local address, port, context and one slot:

./build/bin/llama-server -m /absolute/path/model.gguf \
  --alias local-service --host 127.0.0.1 --port 8080 \
  -c 4096 -np 1 -ngl auto

The explicit port avoids depending on a changing default. One slot also makes the initial comparison easier to interpret. Save the startup log and confirm that the intended model and placement loaded successfully before sending traffic.

Keep a copy of the full command as the service recipe. If an experiment changes context, parallelism or offload, update the recipe and label its results separately. A terminal history entry is an unreliable substitute for the configuration your teammate will use next week.

Compare the same request through both services

Send this request to llama.cpp on port 8080:

curl http://127.0.0.1:8080/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "local-service",
    "messages": [{"role": "user", "content": "Extract owner and deadline: Jules will send the report. No deadline was agreed."}],
    "temperature": 0,
    "max_tokens": 128,
    "stream": false
  }'

Repeat with port 11434 for Ollama, keeping the body unchanged. These commands work from macOS and Linux terminals. Both answers should identify Jules and leave the deadline unknown. Use the compatible HTTP shape for these requests and check support for each additional API feature your application requires.

Measure two phases separately. Time the first request after starting the service, then three requests with the model already loaded. For example, if setup takes 30 minutes and you expect ten teammates to repeat it, the team invests 30 × 10 = 300 minutes, or five hours. That illustrative operating cost can matter more than a small timing difference on one prompt.

Try it on your workload

Give a colleague a clean machine, the exact artifact identifier and your setup notes. Ask them to install the chosen runner, start the model, send the request above, stop the service and reproduce it after restarting. Record every undocumented step and every assumption about paths or running background processes.

Then use five real task shapes with fictional data. Keep the checkpoint, quantization, context, template and decoding settings as close as the runners permit, and record any differences. Score correctness, cold-start time, warm response time and time spent troubleshooting.

Finish by testing the intended number of simultaneous requests. Keep this as a separate service-capacity experiment. The setup that is easiest for one interactive user may require a different operating plan for a team of agents.

How to decide

  • Use Ollama when its named models and management commands make the handoff shorter and the required API behavior works.
  • Use llama.cpp when direct artifact and runtime control solves a concrete service requirement.
  • Prefer the configuration your team can reproduce, recover and evaluate with the least recurring manual work.

Serve ten agents without adding local runners

Ten service-evaluation agents working at once on qwen/qwen3.6-35b-a3b cost about 7 cents in tokens on TrustedRouter for this trial. Its OpenAI-compatible API at https://api.trustedrouter.com/v1 uses one API key and per-token billing, giving your application another deployment to evaluate.

On 2026-11-22, the live catalog listed $0.0422 per million input tokens and approximately $0.317 per million output tokens. Suppose each agent's request fixtures use 100,000 input and 10,000 output tokens in total. Input = 10 × 100,000 = 1,000,000; output = 10 × 10,000 = 100,000. Cost = 1 × $0.0422 + 0.1 × $0.317 = $0.0739, about 7 cents.

On one local GPU, those agents share throughput, and requests beyond its parallel capacity wait in line; through a per-token API, they can run together for the same token bill as sequential requests. Keep the request fixtures when comparing deployments. Prices change; check current prices, the integration quickstart and agent setup. For approved work, encrypted inference and zero data retention depend on model and provider. Local remains preferable when exact artifact control or offline availability is required.

Sources

Related local LLM decisions