Javier Rodeiro

vllm-metal vs oMLX on a Mac: long prompts and concurrency

In this article

On a Mac Studio M4 Max with 64 GB, vllm-metal 0.33.0 does not beat oMLX 0.7.2 on the workload I care about: three requests at once, each with a prompt of about 62,000 tokens. Measured on 16 and 17 November 2026 with LFM2.5-24B-A2B at 5 bits, p99 latency was 206 seconds on vllm-metal and 136 on oMLX. vllm-metal gets the first token out sooner, then generates at 3 tokens per second.

Why I tried a different engine

All my local text, vision and speech models run inside one oMLX process. oMLX is an inference server for Apple Silicon that serves MLX models behind an OpenAI-compatible API. In front of it sits LiteLLM, a proxy that routes requests to local and remote models. oMLX works, but every model shares one limit of 3 concurrent requests, and its memory guard rejects prompts depending on what other apps have open. It also returns no logprobs, the per-token probabilities I need for a local judge.

vllm-metal is the plugin that runs vLLM, the most common inference engine on GPU servers, on Apple Silicon. It offers one process per model, real logprobs and vLLM’s scheduler, which is built for serving many requests at once. On paper it fixed almost everything.

The case it had to survive is specific. Hermes, an agent I run on a server, fires bursts of 3 subagents at the same local model, and each subagent sends a prompt of about 62,000 tokens. Over 30 days that came to about 12,000 requests, with p95 latency of up to 141 seconds on oMLX. I set that number as the gate: the new engine had to match it or it stayed out. Below I hold the stricter p99 of each run against that p95 gate, so a bar under the line passes with margin.

On short agent prompts the two engines tie

With agent prompts of about 5,000 tokens, vllm-metal and oMLX land within a second of each other on p99 latency when serving 3 requests at once: 14.7 seconds against 15.7. With a single request oMLX wins, generating 143 tokens per second against 100. Each run is 20 requests, streaming, temperature 0. The model is Liquid AI’s LFM2.5-24B-A2B, a mixture of experts with 24 billion parameters and about 2 billion active per token.

The chart puts the four cases side by side. The first three pairs nearly overlap. The last one decides.

Bar chart of p99 latency, 20 requests per bar. With prompts of about 5,000 tokens, oMLX and vllm-metal sit between 4.7 and 15.7 seconds and nearly tie. With 62,000-token prompts and one request, 50.7 against 52.2 seconds. With 62,000 tokens and three at once, oMLX takes 135.7 seconds, under the 141-second gate, and vllm-metal takes 206.3.

Engine Prompts Concurrency First token p50 Latency p50 Latency p99 Generation p50
oMLX ~5k 1 1.5 s 3.1 s 4.7 s 143 tok/s
vllm-metal ~5k 1 1.6 s 3.4 s 6.4 s 100 tok/s
oMLX ~5k 3 3.2 s 7.7 s 15.7 s 47 tok/s
vllm-metal ~5k 3 1.5 s 7.5 s 14.7 s 43 tok/s
oMLX ~62k 1 38.2 s 40.8 s 50.7 s 99 tok/s
vllm-metal ~62k 1 42.7 s 47.1 s 52.2 s 57 tok/s
oMLX ~62k 3 110.6 s 120.4 s 135.7 s 26 tok/s
vllm-metal ~62k 3 47.6 s 132.5 s 206.3 s 3.0 tok/s
vllm-metal, 512 per step ~62k 3 54.8 s 155.9 s 258.9 s 2.5 tok/s

With 62,000 tokens and three at once, vllm-metal wins the wait and loses the generation

With three 62,000-token prompts at once, vllm-metal delivers the first token at a median of 47.6 seconds and oMLX at 110.6. That is the advantage I expected from vLLM’s scheduler. The trouble comes after: while the other two prompts are still being read, the request that has started answering generates at about 3 tokens per second, so 256 tokens of output cost it 85 seconds. oMLX starts later but then generates the same 256 tokens in about 10.

Stacked bars of median latency with 62,000-token prompts and three requests at once. oMLX: 110.6 seconds to first token and 9.8 of generation, 120.4 in total. vllm-metal: 47.6 to first token and 84.9 of generation, 132.5 in total. vllm-metal with 512 tokens per step: 54.8 and 101.1, 155.9 in total.

My reading is chunked prefill, the way vLLM reads a long prompt. Instead of processing 62,000 tokens in one go, it splits them into chunks of 2,048 tokens per step and puts the next token of every request that is already generating into the same step. If each step takes as long as its chunk, the generating request gets one token per step, and with two 62,000-token prompts queued there are about 60 such steps. That fits what I measured, 256 tokens in 84.9 seconds, about 3 tokens per second, but I have not measured it step by step.

Smaller chunks made it worse

If the 2,048-token chunk was what slowed generation down, a smaller chunk should have sped it up. I tried --max-num-batched-tokens 512, which caps each step at 512 tokens. p99 latency rose from 206 to 259 seconds and generation fell from 3.0 to 2.5 tokens per second, over 20 requests with fresh prompts so the cache could not help.

So chunk size is not the whole story. With 512-token chunks there are four times as many steps, and if each step carries a noticeable fixed cost on Metal, that cost eats the gain. That is a hypothesis I have not checked. What is measured is that the obvious knob does not help in this version.

How to repeat the measurement

I used the SiliconBench script, a benchmark for inference servers on Apple Silicon, at commit 58cc538, with its dataset pinned to revision 3e9fa20c. The short prompts are the dataset’s agent split, about 5,000 tokens on average. I built the long ones by joining transcripts from that same split up to about 62,000 tokens, each with a different identifier at the start so none could reuse the prefix cache. Each run is 20 requests with at most 256 output tokens, and all 180 requests completed without error.

python scripts/benchmark.py --framework vllm-metal --port 8014 \
  --model lfm2.5-24b --concurrency 3 --requests 20 --warmup 0 \
  --prompts long-62k.json --output vllm-long-c3.json

vllm-metal was started like this, with 4 GiB of KV cache and a single copy of the model in memory:

vllm serve LiquidAI/LFM2.5-24B-A2B-MLX-5bit --port 8014 \
  --max-model-len 131072 --max-num-seqs 4 \
  --kv-cache-memory-bytes 4294967296 --enable-prefix-caching

One limitation works against oMLX: it kept serving Hermes’ real traffic during its runs, while vllm-metal sat on a private port with nobody else. oMLX’s numbers may be slightly worse than they would be on an idle machine, and it still wins.

A canary does not fit in 64 GB

Before the benchmark I tried the textbook gradual rollout: a canary sending 10% of Hermes’ traffic to vllm-metal and 90% to oMLX, split by weight in LiteLLM. It lasted an afternoon. With two copies of LFM2.5 loaded next to Nemotron, the other large model I serve, swap went from 10 to 21.5 GB and oMLX started aborting requests halfway through reading the prompt, because its memory guard read 33.8 GB against a limit of 33.7.

On top of that, with two deployments behind the same model name, the retry path in LiteLLM 1.104.3 failed with TypeError: '>=' not supported between instances of 'str' and 'int' inside should_retry_this_error, and the client got a 500 instead of a retry. I rolled the canary back the same day. On a single machine, a weighted canary needs memory for two copies of the model, and 64 GB does not have it.

What I would do differently, and what is still open

I would measure concurrency at the real prompt length first, before setting anything up. The metric that sold me on vllm-metal was time to first token, and that is exactly the one that misleads on this workload. In my earlier comparison of Qwen and Ornith the first token decided because there was a single request. With three, generation decides.

vllm-metal does not lose everywhere. It returns real logprobs, its prefix cache took an 82,000-token prompt from 60.4 seconds cold to 0.30 warm, and it loaded the model in 19 seconds. If a future version balances steps between reading and generating better, I will run this same test again. Until then, oMLX keeps serving Hermes.

With long prompts and several agents at once, the engine that starts first is not the one that finishes first: measure full latency at your real concurrency.

Keep reading