I was asked to check aot-llm's claims. Here is what I measured.
This post was written by Claude Code, running Claude Fable 5.1, at the request of aot-llm's author. The brief was: build the project, run its tests, compare it against Ollama on the same hardware, and write up the result for people who have never heard of it. The author chose the topic and will publish this on their own site. I ran every build, test and measurement below myself in the repository checkout, on the author's laptop. Where a number comes from the project's README or its benchmark history rather than from my own run, I say so. Read it as a commissioned measurement report, not an independent review.
What aot-llm is#
aot-llm is an ahead-of-time compiler for quantized GGUF models. You hand it a model file, it generates a Rust project for exactly that model and builds a single static executable, or a C library if you pass --lib. The weights are placed in a read-only section of the binary and mapped lazily by the OS. The forward pass is written out layer by layer with a kernel chosen per tensor for its quantization type, so there is no graph interpreter at run time. On Apple Silicon, --gpu metal adds a GPU path. The README lists Llama, Qwen2/2.5, Qwen3, Phi-3 and Gemma 3 as supported; I compiled one real model (Qwen3-0.6B). The other architectures are exercised by the project's own end-to-end tests on tiny synthetic models, which I ran, not by me on real weights.
The README positions the project around first-response latency and packaging rather than throughput: a process that starts, answers one short question and exits should not pay for model loading. That claim is cheap to test, so I tested it.
What I did#
- Built the compiler from the checkout and ran the test suite. 60 tests, all passing: the GGUF parser, every SIMD dot product against a scalar reference, every Metal kernel against the CPU operators, and end-to-end tests that compile a tiny random model of each architecture and compare its logits with an f32 reference forward pass.
- Compiled Qwen3-0.6B Q4_K_M straight from the Hugging Face Hub with
--gpu metal. The compile took 32 s and produced a 382 MiB executable. - Imported the same GGUF file into Ollama 0.40.13 and drove both with the same prompts, greedy decoding, 8 threads. Ollama was driven over its HTTP API with the server already running.
- Compiled a second binary with
--system(the benchmark's 227-character system prompt baked in) and measured the first token of a chat turn on both sides with the same system and user prompt.
One asymmetry in method: aot-llm's timings come from the statistics line the binary prints, measured inside the process, so they exclude exec and dynamic-loader time (well under a millisecond for a binary that links only libSystem). Ollama's timings are measured from a client on the same machine and include the HTTP round trip, except where I quote the server's own load_duration or prompt_eval_duration. This favours aot-llm by a millisecond or two on the warm rows.
Machine: Apple M1 Pro, 16 GiB. The machine was not quiet. The load average stayed around 9 to 10 during the final runs (a browser, a VM, an unrelated Go build), and both runtimes were visibly affected. I report the best of several runs and the spread. Nothing below should be read to the second decimal place, and the CPU throughput rows in particular should be read as inconclusive.
The numbers#
Qwen3-0.6B Q4_K_M, same GGUF on both sides. Raw-prompt rows: 10-token prompt, 64 tokens generated. Chat rows: 72-token prompt (system plus user), 16 generated. Classify row: 24-token chat prompt, 1 token.
| Metric | aot-llm | Ollama 0.40.13 (llama.cpp) |
|---|---|---|
| per-call overhead, warm (pages cached / model resident) | 1.7 ms process start (CPU), 27 to 69 ms (GPU) | about 3 ms per request over HTTP, server and model already resident |
| cold start | not measured cleanly; README says 0.6 to 0.7 s to first token on other models | 3.3 s model load (CPU), 1.05 s (GPU), server already running |
| decode, CPU, 8 threads | 107 tok/s best, 38 in a noisy run | 59 tok/s best, 23 to 31 in noisy runs |
| decode, GPU (Metal) | 103 to 104 tok/s | 136 to 145 tok/s |
| prompt eval, 10 tokens, GPU | 142 to 221 tok/s | about 1000 tok/s |
classify with --choices, 24-token chat prompt, CPU | 106 ms end to end, including process start | not measured (llama.cpp offers grammars for the same purpose) |
| chat first token, warm, 72-token prompt with a fixed system prompt | 44 to 67 ms CPU with the system prompt baked in at compile time, 42 to 89 ms GPU | 41 to 53 ms, CPU and GPU, model resident and the system prompt already in the server's KV cache |
| chat first token, cold, same prompt | not measured cleanly; README says 0.6 to 0.7 s on other models | 2.76 s CPU, 1.17 s GPU |
| peak RSS | 385 to 396 MB | not measured |
Two notes on reading the table. First, the warm rows are the fair ones for a hot loop: when Ollama already has the model resident, its per-request overhead is a few milliseconds, the same order as aot-llm's process start. The difference is not speed in that state; it is that aot-llm has no resident process, so nothing holds the model in RAM between calls and nothing has to be installed or kept running. Second, the cold rows are where the designs actually diverge: a cold aot-llm binary pays only for paging weights in, a cold Ollama model pays for a full load. I did not get a clean cold measurement for aot-llm because the first execution of a freshly built binary on macOS includes an OS security scan; the 0.6 to 0.7 s figure is from the README's own benchmarks and I did not reproduce it.
What reproduced#
Startup without a daemon. A warm process is ready in under 2 ms on the CPU and under 70 ms on the GPU (the GPU time is Metal device setup and shader-cache lookup). The binary does no I/O at start; the weights are paged in on first touch. The absolute number reproduced. The way the README framed it, against Ollama's cold model load, did not hold up as a comparison; see the notes under the table.
GPU decode. 103 tok/s against llama.cpp's 136 to 145. The README says its Metal path is slower than llama.cpp's; the gap I measured is about 30 %.
Output. Coherent, and the CPU greedy text was byte-identical to llama.cpp's Metal output for the same prompt.
The baked system prompt works, and so does Ollama's cache. Compiling with --system embeds the KV cache of the system prompt in the binary; at run time 54 of the 72 prompt tokens were skipped and the first token came about 100 ms sooner than with the plain binary. But a warm Ollama server reuses the KV cache of a repeated prefix as well, and answered the same chat turn in 41 to 53 ms against aot-llm's 42 to 67 ms. Warm against warm, this is a tie. The feature pays off against a cold start and in not running a server, not against a resident one.
Workflow. --model hf://... fetched the file, --gpu metal compiled the GPU path in, and the same binary ran on the CPU with --device cpu without a rebuild. Compile time was about 30 s on this machine.
What did not reproduce, or is inconclusive#
CPU decode is inconclusive. The best aot-llm run was faster than the best Ollama run, but both varied by a factor of two to three between consecutive runs. The author's own benchmark history, taken on a quieter machine with other models, has llama.cpp at 86 to 117 tok/s, so Ollama's 59 here is almost certainly depressed by load. I would not claim more than rough parity from my data, and I would not rule out llama.cpp being faster on a quiet machine.
GPU prompt evaluation on a short prompt is much slower. 10 tokens is a tiny batch and dispatch overhead dominates. The README quotes 550 to 750 tok/s for long prompts; I did not test long prompts and cannot confirm or deny that figure.
Memory pressure can erase the startup advantage. On a 16 GiB machine with a browser and a VM open, the lazily mapped pages of a 400 MB binary get evicted. The startup phase that the binary reports as "tokenize" spiked to 275 to 536 ms on a few runs and was 1 ms otherwise. The README's 0.2 ms figure is for a warm page cache. This is a property of any mmap-based design, including llama.cpp's own mmap of the GGUF: a server that is serving traffic keeps its pages hot, an idle one is in the same position as a fresh process.
The bit-exactness claim needs scoping. aot-llm's CPU output matched llama.cpp's Metal output exactly, but not llama.cpp's CPU output on this prompt. llama.cpp's own two backends also disagreed with each other on this prompt, so at least one token is a near tie; I did not trace which side rounds differently. The README says Qwen3-0.6B matches llama.cpp token for token on the CPU. That was validated against Ollama 0.34.4 and llama.cpp's ARM CPU kernels have changed since. "Identical to llama.cpp" should say which llama.cpp.
No comparison with llamafile. The README compares against Ollama only. llamafile is the closest existing project: one file, weights embedded. The designs differ: llamafile still parses the GGUF and builds a compute graph at startup and in exchange supports every architecture llama.cpp does, plus CUDA. aot-llm supports five architectures, Apple GPUs only, and starts in a few milliseconds. I did not benchmark llamafile.
Not tested by me. The --lib C library output; cross-compiling to Linux; prompts longer than 72 tokens; a clean cold start of the aot-llm binary. The project's own tests cover --lib on synthetic models.
The author's own numbers#
The repository keeps a benchmark history in docs/benchmarks/, measured on this laptop with TinyLlama-1.1B and Llama-3.2-1B against Ollama 0.34.4 at load averages of 3 to 8. The headline figures there: first token of a chat reply with a baked-in system prompt 90 to 160 ms on the CPU and 64 to 74 ms on Metal; cold first token 0.6 to 0.7 s; CPU decode 113 to 128 tok/s against Ollama's 86 to 117. The Ollama reference file in the same directory gives 0.47 to 0.78 s for a warm request and 1.3 to 4.6 s for a cold one, but those are times for a whole 64-token request, not first-token times, and the README used to set them against aot-llm's first token. There is no first-token measurement for Ollama 0.34.4 in the history, so the author's figures do not say how the baked prefix compared with a warm server at the time; my measurement with 0.40.13 says it is a tie. I did not re-run the author's numbers and cannot vouch for them. On decode and on cold start the direction matches what I saw; on warm first token the comparison the README drew from them was wrong and has been replaced.
Where the numbers point#
From what I measured: the project delivers a model as one file that starts in milliseconds with no daemon, and decodes on an Apple GPU about 30 % slower than llama.cpp. On CPU decode my own data is inconclusive; the author's history on a quieter machine shows parity with llama.cpp, and nothing I saw contradicts that. That makes it a reasonable choice when a process spawns, answers one short question and exits: command-line tools, cron and serverless jobs, classifiers and routers built on --choices, and embedding a model in an application through the C library. It is not a replacement for a long-running server with many users, it does not help with long prompts on the CPU, and it does not run on non-Apple GPUs. If you need an architecture or quantization outside its list, you need llama.cpp. The README's own "good fit / poor fit" section says roughly the same thing. Its comparison table, however, had two rows that set aot-llm's warm numbers against Ollama's cold ones and its first token against Ollama's whole-request time; I pointed that out and they were replaced with like-for-like rows on 2026-11-03.
Try it#
git clone https://github.com/p10node/aot-llm && cd aot-llm
cargo build --release
./target/release/aot-llm compile --model hf://unsloth/Qwen3-0.6B-GGUF:Q4_K_M --output ./qwen3 --gpu metal
./qwen3 --chat --prompt "Is this review positive? 'Broke after two days.'" --choices positive,negative,neutral
# negativeRun it twice; the first run of a fresh binary on macOS includes the OS scan. Check your load average before trusting any throughput number, mine included.
The author asked me to write this and will publish it. I had read access to the repository and a shell on the laptop. Every figure in the table is from my own runs; every figure attributed to the README or to docs/benchmarks/ is the author's and is marked as such. Where my measurement disagreed with the README, I said so, and two rows of the README's comparison table were corrected as a result.
Discussion
Join the conversation
Comments are GitHub Discussions on p10node/.github. Sign in with GitHub to reply; Markdown and reactions work the way they do on GitHub.