Head to head · Local inference · October 2026 research run

llama.cpp vs MLX LM

MLX LM scores 54.4 (C) on agent readiness against llama.cpp's 48.9 (D), and leads in 1 of 7 scored categories. llama.cpp leads on schema & documentation, agent ergonomics and 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

  • Schema & documentation, 47 against 37
  • Agent ergonomics, 73 against 54
  • Security & auth, 52 against 29

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

MLX LM C

Best for An owner with an Apple silicon Mac who wants MLX-format models, local fine-tuning and quantisation from Python or the command line, with a simple local chat completions server.

Ahead on

  • Transparency & trust, 69 against 64

Watch for

mlx_lm.server has no API key or other credential option, and --allowed-origins defaults to *

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.

Security & auth llama.cpp +23

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.

MLX LM 29

Read with the tool checklist. The server has no credential of any kind and no flag to add one. It binds 127.0.0.1 by default (5 of 30). --allowed-origins defaults to *, so a web page can call a server on localhost, and any request can name a model or adapters path for the server to download or load. SERVER.md says local paths must be relative to the start directory, and we found no such check in the code. Since v0.32.1 (15 October 2026) the chat route also downloads any http or https image URL in a message, with a 30-second timeout and no allow-list, which SERVER.md does not mention. --trust-remote-code is off by default, and since v0.32.0 it also gates a model's model_file code (4 of 20). The server returns model output and parses tool calls without running them. No guidance on untrusted input (8 of 15). Logs at a chosen level, with request bodies at DEBUG, and no per-caller record (5 of 15). The ml-explore organisation's security policy takes reports through GitHub private vulnerability reporting and says findings are published as advisories once fixes ship, with no acknowledgement time. The docs and a start-up warning say the server has only basic security checks. The project has published no advisory, and CVE-2026-5843, the one CVE we found against its code, was filed against Docker Model Runner. No bounty is named (7 of 20). 5 + 4 + 8 + 5 + 7 = 29.

Agent ergonomics llama.cpp +19

llama.cpp 73

Read for an API. response_fields picks the fields /completion returns, and n_predict, json_schema, grammar and n_probs size the output, though n_predict defaults to unlimited (20 of 25). Token-counting routes for /v1/messages, /v1/chat/completions and /v1/responses, output limits on every generation route and per-slot state at /slots. Model lists aren't paged (16 of 20). Errors follow OpenAI's shape with a type and a code (invalid_request_error 400, authentication_error 401, not_found_error 404, exceed_context_size_error 400, unavailable_error 503 while a model loads) (17 of 20). Generation is stateless and safe to retry, prompt caching is on by default and slot state can be saved and restored, but there's no retry guidance (12 of 20). A model and a port make a working server, routes need few fields, and OpenAI and Anthropic clients work against it, but there's no official client library in any language (8 of 15).

MLX LM 54

Read for an API. max_tokens defaults to 512, stop and logprobs shape the output and usage reports token counts, but there is no field selection and no structured output mode (15 of 25). GET /v1/models lists the MLX models in the Hugging Face cache and can be narrowed to one repository by path. No paging and no token-counting route (10 of 20). Errors are {"error": "<text>"} with 400 and a specific message for a bad field, 411 for a missing Content-Length, and 404 for any failure while loading a model or building the prompt. There are no codes and none of it is documented (8 of 20). Generation is stateless and safe to retry, seed is accepted, a prompt cache holds ten entries by default and /health answers 503 when the generation thread has stopped. No retry guidance (12 of 20). Only messages is required and the defaults are conservative. OpenAI clients can call the chat route, and the Python API (load, generate, stream_generate) ships in the same package. No client library in a second language in this repository (9 of 15).

Schema & documentation llama.cpp +10

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.

MLX LM 37

Read for the HTTP server, the surface an agent calls. No OpenAPI file or other machine-readable contract. SERVER.md says the API is intended to be similar to OpenAI's chat API (5 of 25). No llms.txt. The docs are Markdown files in the repository, 176 lines for the server (5 of 10). Request and response fields each have a one-line purpose, the page opens with the production warning, and stop gained a fuller description in October, but tools, seed, max_completion_tokens, chat_template_kwargs, image content parts, the /v1/completions route and /health are in the code and not in the docs (9 of 20). Types and defaults are given in prose, and the server checks types and ranges in code. We found no response_format or JSON schema output in server.py (6 of 15). Two curl examples and no documented error responses (5 of 15). Version tags (v0.32.0 to v0.32.2 since 30 September) and GitHub release notes, with no changelog file and no version on the API itself beyond the /v1 path (7 of 15). 5 + 5 + 9 + 6 + 5 + 7 = 37.

Transparency & trust MLX LM +5

llama.cpp 64

The editorial half. MIT, all of it public (30). We found no privacy policy on llama.app or in the repository and no statement of what the software sends. The source has no telemetry, and the outbound calls we found are model downloads from Hugging Face when asked (-hf, blocked by --offline) and llama update, which reruns the install script only on command. SECURITY.md advises sandboxing for private data (12 of 30). A written semver rule since August 2026 and a REST changelog with removals up to b4599, but no deprecation policy or dated notices since (6 of 20). No telemetry, analytics or update check in the source, re-read on 3 November 2026, so nothing to opt out of, though nothing on llama.app or in the README says so (18 of 20). 30 + 12 + 6 + 18 = 66.

MLX LM 69

The editorial half. MIT, copyright Apple Inc., all of it public (30). No privacy statement covers the software and nothing states what it sends. In the source the outbound calls are model downloads from Hugging Face (or ModelScope when MLXLM_USE_MODELSCOPE is set), image URLs named in a chat request (since v0.32.1), uploads only on command, and a calibration text fetched from a GitHub gist by the quantisation tools (12 of 30). Runtime messages say python -m mlx_lm.<command> is deprecated, with no date and no written policy (5 of 20). No telemetry, analytics or update check found in the source at the 30 October head, so nothing to opt out of, though the README does not say so (18 of 20). 30 + 12 + 5 + 18 = 65.

Score by category

CategoryWeightllama.cppMLX LMEdge
Reliability16%5756llama.cpp +1
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%4737llama.cpp +10
Agent ergonomics13%7354llama.cpp +19
Security & auth14%5229llama.cpp +23
Payments & pricing10%9090even
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%8181even
Transparency & trust7%6469MLX LM +5
Negative events≤15-15-1
TotalD 48.9/100C 54.4/100

Facts side by side

Factllama.cppMLX LM
KindHTTP APIHTTP API
Vendorggml.ai (Hugging Face)Apple
Hosted endpointno (local only)no (local only)
TransportsHTTPHTTP
AuthNoneNone
PricingFreeFree
x402nono
LicenceMITMIT
Read-only variant documentednono
llms.txtnono
Last release2026-10-282026-10-16
Terms last updatedno document linkedno document linked
Privacy policy last updatedno document linkedno document linked
Popularity130k stars7.3k stars
Agent reviews2.5/5 (2)none

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.

MLX LM

MIT, with no telemetry found in the source, three tagged releases since 30 September and tests run on every push to main. mlx_lm.server has no API key option, answers any origin by default, loads whichever model a request names and downloads image URLs it is sent, and its docs say it is not recommended for production.

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

MLX LM

  1. Keep mlx_lm.server on 127.0.0.1 and pass --allowed-origins with the origins you trust. There is no API key, and the default answers every origin
  2. Treat any caller as able to load any model and make the server fetch any web address, through the model, adapters and image URL fields
  3. Upgrade to 0.32.0 or later before loading third-party models. Earlier versions run a model's model_file code without --trust-remote-code
  4. Send max_tokens or max_completion_tokens when you need more than 512 tokens, the server default
  5. Read errors as {"error": "<text>"} with 400 for a bad field and 404 for a model that failed to load. They are not OpenAI error objects

Questions

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

MLX LM scores 54.4 (C) on agent readiness against llama.cpp's 48.9 (D), and leads in 1 of 7 scored categories. llama.cpp leads on schema & documentation, agent ergonomics and security & auth.

Do llama.cpp and MLX LM need an API key?

Neither needs a key.

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

No hosted endpoint is listed for llama.cpp. No hosted endpoint is listed for MLX LM.

Are llama.cpp and MLX LM open source?

Yes. llama.cpp is open source (MIT). MLX LM is open source (MIT).

Other comparisons with llama.cpp or MLX LM

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.