Mozilla.ai Benchmarks Local AI Servers, Finds Setup Drives Bigger Gains

Across three machines, matching model files narrowed most prompt-speed gaps. Build options, graphics toolchains and platform-specific decoding settings delivered the larger swings.

By 3 min read
Mozilla.ai Benchmarks Local AI Servers, Finds Setup Drives Bigger Gains
Mozilla.ai Benchmarks Local AI Servers, Finds Setup Drives Bigger Gains

Listen to this story

The audio brief

About 1:58
0:001:58
Read transcript
A newer build improved Steam Deck prompt processing by as much as sixty-three point three percent—without changing the inference engine. That is the clearest signal from Mozilla.ai’s comparison of llama.cpp, llamafile, LM Studio, and Ollama: local AI speed often depends more on the build, graphics toolchain, and decoding settings than on the server brand. The study tested those four tools on an Apple M4 Max, an NVIDIA L40S system, and a Steam Deck, using matching GGUF model files from the Qwen family. When the weights and environment matched, prompt-processing results were generally within a few percent. That makes sense because all four use a llama.cpp-based core for GGUF workloads, though each kept its own batching defaults. The important distinction is between reading the prompt and generating the answer. On the L40S, CUDA graphs increased llamafile’s generation speed by sixteen point eight percent for the zero-point-eight-billion model, but only four point three percent for the twenty-seven-billion model. On the Steam Deck, a newer shader toolchain lifted prompt processing by twenty-five point nine percent for the smaller model and sixty-three point three percent for the nine-billion model; generation also rose eighteen point two percent. There was no universal decoding winner. Four-token speculative drafts helped on CUDA, while two-token drafts led on Metal. Apple-focused MLX artifacts improved twenty-seven-billion prompt processing by about ten percent, but differing artifacts and defaults prevent an engine-level conclusion. The practical takeaway is simple: benchmark the exact hardware, build, model files, and settings you plan to deploy. Compatibility still comes first—and the remaining question is how much of the gap future toolchains can erase.

Story brief

3 key points

Mozilla.ai’s controlled comparison suggests local inference performance depends more on compilation, GPU tooling and decoding settings than on choosing among llama.cpp, llamafile, LM Studio and Ollama. On an L40S, CUDA graphs lifted llamafile generation by 16.8% for a small model; a newer build improved Steam Deck prompt processing by up to 63.3%. Results varied by hardware, model size and defaults, while MLX...

  1. 01

    CUDA graphs improved llamafile generation 16.8% on the L40S for 0.8B, but only 4.3% for 27B.

  2. 02

    A newer shader/toolchain build raised Steam Deck prompt processing 25.9% for 0.8B and 63.3% for 9B.

  3. 03

    Speculative decoding was hardware-specific: four-token drafts helped CUDA, while two-token drafts led on Metal.

The fastest local AI setup may not come from switching server brands. Mozilla.ai’s new benchmark found that four popular tools were generally close on prompt processing when they used the same model files and environment, while build and configuration choices produced the much larger gains.

The study compared llama.cpp, llamafile, LM Studio and Ollama on an Apple M4 Max, an NVIDIA L40S Linux system and a Steam Deck. It used matching GGUF model weights across Qwen models at roughly 0.8 billion, 9 billion and, where memory allowed, 27 billion parameters.

That control matters. Mozilla.ai says all four servers use a llama.cpp-based core for GGUF workloads, which helps explain why their prompt-processing results usually landed within a few percent once the weights and test environment were held constant. The study is a practical snapshot rather than a final ranking, and each runtime kept its own batching defaults.

The benchmark separates two jobs often collapsed into one speed claim. Prompt processing is the work of reading an input before an answer begins; token generation is the rate at which the answer appears. The first can dominate long-document or large-codebase work, while the second is more visible in chat and code completion.

On the L40S, enabling CUDA graphs in llamafile improved generation throughput by 16.8% on the 0.8B model. The gain fell to 6.5% for 9B and 4.3% for 27B.

The Steam Deck produced the widest spread, but Mozilla.ai traced most of it to the Vulkan shader compiler rather than a different inference engine. Rebuilding the same llamafile/llama.cpp code with a newer toolchain raised prompt processing by 25.9% on the 0.8B model and 63.3% on the 9B model. Decode speed for the 9B model rose 18.2%.

Speculative-decoding settings also resisted a universal recommendation. For the tested 27B configuration, draft length 2 worked best on Metal, while draft length 4 beat it on CUDA by up to 16%. On the M4 Max, a four-token draft was slower than no speculation in the reported comparison.

Some apparent generation gaps may also be less about GPU compute than the software around it. The researchers measured an approximately fixed host-side cost per generated token: 0.4 milliseconds on the Mac, 1.8 on the L40S and 5.4 on the Deck. A near-constant delay becomes a larger percentage penalty when the underlying model is faster.

Mozilla.ai also tested the Apple-focused MLX model artifacts that Ollama and LM Studio offer. Each improved 27B prompt processing by roughly 10% over the shared GGUF setup, but the comparison did not establish one engine’s superiority: the artifacts differed, and Ollama enabled speculative decoding while LM Studio did not.

Compatibility can matter before throughput. On an approximately decade-old Intel MacBook Pro, llama.cpp and llamafile ran on the installed macOS, while the current Ollama distribution did not support that system version and LM Studio’s current release supported Apple Silicon rather than Intel Macs. That check was not a comparable performance test.

Sources

  1. blog.mozilla.aiBenchmarking llama.cpp vs llamafile vs LM Studio vs Ollama: What Moved Throughput

Loading discussion...

Mozilla.ai Benchmarks Local AI Servers, Finds Setup Drives Bigger Gains | Superpower Daily