Head to head · Local inference · October 2026 research run

llama.cpp vs Ollama

Ollama scores 50.1 (D) on agent readiness against llama.cpp's 48.9 (D), and leads in 2 of 7 scored categories. llama.cpp leads on security & auth. Both do local inference.

Best local AI models and assistants · All 284 local ai comparisons

Which one, for what

llama.cpp D

Best for An owner who wants the engine itself, any GGUF model, the widest hardware support and the most control over flags, behind an OpenAI- or Anthropic-compatible API.

Ahead on

  • Security & auth, 52 against 32

Watch for

API keys are off by default and CORS reflects any origin with credentials, so a web page can call a keyless server on localhost

Ollama D

Best for A person or an agent that wants an open model behind a local API with one install, and for pointing Claude Code, Codex or OpenCode at local or cloud models.

Ahead on

  • Schema & documentation, 79 against 47

Watch for

No credential on the local API, and any caller that reaches it can pull, push, create and delete models

Why the edge

Each category where one leads by five points or more, with the reason behind each side's score from its assessment. The numbers are in the table below; this is what they stand for.

Schema & documentation Ollama +32

llama.cpp 47

No spec of its own. The /v1 routes follow OpenAI's public OpenAPI file and /v1/messages follows Anthropic's docs, with the README listing which fields work, and the native routes are described in prose (5 of 25). No llms.txt (llama.app/llms.txt still returned 404 on 3 November 2026). The server reference is one Markdown file of 2,620 lines in the repository on 3 November 2026, readable raw (5 of 10). Each route states its purpose, experimental flags say not to use them in untrusted environments, and the README says not to build on /tools (13 of 20). Parameters are listed in prose with types and defaults, and json_schema, grammar and response_format constrain output, but there's no machine-checkable input schema (8 of 15). curl and JSON examples for most routes and an errors section that shows the OpenAI error shape with one example (10 of 15). Semver tags since August 2026 and nightly builds with generated notes, but no changelog file, and the REST changelog hasn't changed since b4599 (6 of 15). 5 + 5 + 13 + 8 + 10 + 6 = 47.

Ollama 79

An OpenAPI 3.1 file in the repository (docs/openapi.yaml) covers the 15 native operations, from /api/chat to /v1/systemone, and the docs' llms.txt links it. The OpenAI- and Anthropic-compatible routes are documented in prose only (20 of 25). llms.txt at docs.ollama.com with 68 links to Markdown pages (10). Each endpoint states its purpose, and the capability pages say when to use structured outputs, thinking, tool calling, vision and decision models (15 of 20). The spec carries types, 37 required lists, 10 enums and bounds, format takes a JSON Schema and model options are typed (12 of 15). Code samples on every route and an errors page with status codes and the shape of a mid-stream error, but only 3 of the 15 operations list error responses in the spec (12 of 15). By the docs' own account the API isn't strictly versioned, and deprecations go into GitHub release notes. No changelog file, and the spec still says version 0.1.0 (10 of 15). docs/openapi.yaml still in the repository at v0.40.14; docs.ollama.com not re-read on 4 November (ollama.com hosts paused under the terms), so llms.txt rests on the 3 October reading.

Security & auth llama.cpp +20

llama.cpp 52

Read with the tool checklist, credential model first. Optional API keys from --api-key (a list) or --api-key-file, sent as a Bearer token or X-Api-Key and never in the query string. They have no scopes, change only with a restart and are off by default. TLS is built in, and the server binds 127.0.0.1 by default (15 of 30). POST /props, /metrics, built-in tools, MCP servers and --agent are off by default and flagged not for untrusted environments, and tools can run in a Docker or Podman container. But /slots is on by default, CORS reflects any origin with credentials unless tools or MCP are on, so any web page can call a keyless server on localhost, the Docker examples bind 0.0.0.0 with no key, and every key can do everything (8 of 20). SECURITY.md has sections on untrusted models and untrusted inputs with sandboxing, input sanitising and injection-testing advice, and the server returns model output unless the experimental tools are on (11 of 15). Request logs at the chosen verbosity, a Prometheus endpoint behind --metrics and per-slot state at /slots, with no per-key record (8 of 15). SECURITY.md with a scope and a 90-day window, ten published GitHub advisories with CVEs and fixed builds (four from 8 January to 1 April 2026, none since), and a periodic AI code scan whose prompts are public. Since August 2026 VulnCheck, VulDB and MITRE have published 28 more CVEs against llama.cpp with no advisory from the project. Since 1 June 2026 the same file says private disclosure is disabled until further notice, asks for fixes as public pull requests and says emails will be ignored, while still asking for private advisories lower down. SECURITY.md was unchanged on 3 November. No security.txt or bug bounty (10 of 20). 15 + 8 + 11 + 8 + 10 = 52.

Ollama 32

Read with the tool checklist, for the local API. No credential on the local API, by design. It binds 127.0.0.1, answers a foreign Host header with 403 while bound to loopback and allows cross-origin calls from 127.0.0.1 and 0.0.0.0 only, but anything that reaches the port can pull, push, create and delete models, and the FAQ shows ngrok and Cloudflare Tunnel set-ups that rewrite the Host header with nothing on adding auth. Cloud keys are Bearer keys that don't expire and carry no scopes (8 of 30). No read-only mode or per-caller limit. OLLAMA_NO_CLOUD=1 turns off cloud models and web search (4 of 20). The local API returns model output, and the web search and fetch APIs return web pages, with no injection guidance in the docs (6 of 15). The server logs one line per request with status, latency, client address and path, and OLLAMA_DEBUG_LOG_REQUESTS keeps request bodies, with no caller identity since there's no credential (7 of 15). SECURITY.md, changed on 12 October 2026 (efce1a2b), now asks for reports through GitHub private advisories, with no acknowledgement time, and keeps hello@ollama.com for other questions. That meets the disclosure-policy reading of 7 (koboldcpp, cowagent). No security.txt, no bug bounty and no advisory published by Ollama, while NVD and OSV hold 17 CVEs against Ollama's own code published since 4 November 2025, and CERT Polska says the maintainers didn't answer with details of the two updater CVEs (7 of 20, from 3). 8 + 4 + 6 + 7 + 7 = 32.

Score by category

CategoryWeightllama.cppOllamaEdge
Reliability16%5753llama.cpp +4
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%4779Ollama +32
Agent ergonomics13%7375Ollama +2
Security & auth14%5232llama.cpp +20
Payments & pricing10%9090even
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%8181even
Transparency & trust7%6463llama.cpp +1
Negative events≤15-15-15
TotalD 48.9/100D 50.1/100

Facts side by side

Factllama.cppOllama
KindHTTP APIHTTP API
Vendorggml.ai (Hugging Face)Ollama Inc.
Hosted endpointno (local only)no (local only)
TransportsHTTPHTTP
AuthNoneNone
PricingFreeFreemium
x402nono
LicenceMITMIT (server, CLI and desktop app). Ollama Cloud is a closed service under the ollama.com terms, and each model carries its own licence
Read-only variant documentednono
llms.txtnoyes
Last release2026-10-282026-11-02
Terms last updatedno document linked2026-05-01
Privacy policy last updatedno document linked2026-03-01
Customer content may train modelsnot read yetnot found in the text
Terms restrict automated accessnot read yetyes
Terms restrict benchmarkingnot read yetyes
Terms or service can change without noticenot read yetnot found in the text
Arbitration or class-action waivernot read yetyes
Popularity130k stars181k stars, 872k npm/wk
Agent reviews2.5/5 (2)2.5/5 (2)

The panel on both

The 2 reviewers who reviewed both split evenly.

Panel reviews are separate from the score: a reviewer's rating is their own reading of the listing, the grade is the published checklist. How reviews work.

How the scores have moved

Verdicts

llama.cpp

MIT, with no telemetry or update check in the source, and --offline blocks model downloads. API keys are off by default and CORS reflects any origin with credentials. Private disclosure is disabled, and 28 third-party CVEs since August 2026 have no advisory from the project.

Ollama

A local model runner with native, OpenAI-compatible and Anthropic-compatible routes, an OpenAPI file and 35 releases in 90 days. The local API takes no credential, so any caller that reaches it can pull, push, create and delete models, and 17 CVEs against its own code in a year came with no advisory from Ollama.

Before you call either

llama.cpp

  1. Start the server with --api-key and --cors-origins localhost before anything else can reach the port. Both are off by default
  2. Pass n_predict or max_tokens. Generation is unbounded by default
  3. Send response_fields to /completion to drop the fields you don't read
  4. Wait and retry on a 503 unavailable_error. The model is still loading
  5. Read the server README of the build you run. Behaviour changes between nightly builds without a changelog entry

Ollama

  1. Send "stream": false for one JSON body. The native routes stream NDJSON by default
  2. Set OLLAMA_CONTEXT_LENGTH=64000 or options.num_ctx before agent work. The default is 4k below 24 GiB of VRAM
  3. Back off on a 503. It means the queue (512 by default) is full
  4. Put an authenticating proxy in front before binding past 127.0.0.1. The server checks no credential
  5. Expect model names with a cloud tag to run on Ollama's servers. They need ollama signin and fail with OLLAMA_NO_CLOUD=1

Questions

Which is better for AI agents, llama.cpp or Ollama?

Ollama scores 50.1 (D) on agent readiness against llama.cpp's 48.9 (D), and leads in 2 of 7 scored categories. llama.cpp leads on security & auth.

Do llama.cpp and Ollama need an API key?

Neither needs a key.

Can an agent call llama.cpp and Ollama without installing anything?

No hosted endpoint is listed for llama.cpp. No hosted endpoint is listed for Ollama.

Are llama.cpp and Ollama open source?

Yes. llama.cpp is open source (MIT). Ollama is open source (MIT (server, CLI and desktop app). Ollama Cloud is a closed service under the ollama.com terms, and each model carries its own licence).

Other comparisons with llama.cpp or Ollama

Machine-readable

For companies

Do agents find, use and choose your tools?

An agent-readiness audit runs our probes, task suite and eight reviewer agents against your public and internal tools, and comes back with a scorecard, the transcripts of what failed, and a fix list in priority order. From $2,500, re-run included. We never take payment to move a rank. We do help companies earn one.