On November 29, LocalAI released version 5.1.0, changing how its llama.cpp backend serves more than one conversation at a time. Long prompts can now be read in smaller chunks, leaving room for chats that have already started producing text. The change matters for a shared self-hosted system: the biggest job in the queue no longer has to monopolize the model while it reads its input.
The release does not make every answer faster. In a maintainer benchmark, the longest gap in an ongoing chat fell from 690 to 109 milliseconds when a long prompt arrived. But the long prompt’s own wait for its first token increased by about half a second at the 99th percentile. LocalAI is trading a delay at the beginning of one request for fewer visible stalls in others.
A long prompt no longer gets the whole machine at once
A model server has two different jobs. First it processes the input prompt, a stage called prefill. Then it generates output one token at a time. A large prefill can keep a shared accelerator busy while other users are waiting for their next token. On a screen, that delay is the moment when a response that was streaming seems to freeze.
In the project’s Qwen3-8B benchmark, the machine was an NVIDIA DGX Spark, the model was quantized to Q4_K_M, and an 8,000-token prompt arrived after eight chats were already underway. Reading the long input in chunks of 256 tokens cut the maximum pause in an active stream. Aggregate generation barely moved, from 187.8 to 189.8 tokens per second in the two compared arms. The result is about when output arrives, not how much text the system can generate.
The release notes also describe a shared key-value cache, which holds intermediate model state for tokens already processed. When the llama.cpp backend runs with more than one slot, its scheduler budgets that cache across requests by default. A request can wait if the server cannot fit its prompt and reserved output. That admission decision is distinct from splitting up the work of reading a prompt once it is admitted.

The 89% headline is not the effect of paging alone
LocalAI also tested a larger, different model: Ornith-1.5-35B-A3B at Q8_0, again on a DGX Spark. With roughly 16 requests in flight, its existing four-slot setup produced 81.0 output tokens per second in aggregate. At the same four slots, the new configuration reached 84.3. Moving to eight slots reached 138.0, and 16 reached 153.3. Both the original four-slot setup and the 16-slot configuration completed all 128 requests across two runs.
Those figures compare complete setups. The original configuration used an MTP drafting option, whereas the eight- and 16-slot configurations cited here had drafting off. The results support the claim that the tested setup handled more work under load. They do not support treating the roughly 89% increase as the benefit of a cache change in isolation, or promising that a single user will see their response speed almost double.
There was another trade-off. At 16 slots, median time to the first token fell from 35.52 to 8.29 seconds, but the 99th-percentile gap between tokens rose from 227 to 629 milliseconds. The measured eight-slot setup kept that gap at 197 milliseconds while improving aggregate throughput against the original setup. That is a useful reason to test intermediate settings, not a universal recommendation to use eight slots.
Tune for the wait your users notice
Someone sharing a server between document workloads and interactive chat may care more about the worst visible stall than peak tokens per second. An operator running a batch queue may make the opposite choice. A useful upgrade check is to keep the model, hardware, request mix, and drafting settings fixed while changing one serving parameter at a time. Compare first-token waits and gaps inside a response, as well as completed requests and aggregate output.
Test mixed workloads as well as evenly sized requests. Send a short prompt through while a long document is already being processed, then reverse the order. Recording which request arrives first makes the results easier to interpret when two reports appear to disagree.
The release also warns operators with existing distributed workers to upgrade frontends and workers together; mixed versions cannot use the new backend upgrade protocol. For teams that just run one server, the practical question is simpler: when a colleague pastes a large document, can the other people using that model still get a smooth answer? This release gives operators a way to tune for that problem, with one measured trade-off rather than a blanket speed promise.
P.S. Compare time to first token with the gaps inside the stream. A faster queue is not always a smoother chat.
Frequently Asked Questions
Q: Does LocalAI 5.1.0 make one chat faster?
A: Not necessarily. The headline throughput figure covers concurrent requests, not the speed of a single chat.
Q: What fell from 690 ms to 109 ms?
A: The maximum pause in an ongoing chat when an 8,000-token prompt arrived in the Qwen3-8B benchmark.
Q: Did the long request also benefit?
A: Its first-token wait at the 99th percentile increased by about half a second in that test.
Q: When does the shared cache scheduler apply?
A: It is enabled by default on LocalAI’s llama.cpp backend when more than one slot is used.
Q: Is the 89% improvement due to paging alone?
A: No. The compared configurations differed in concurrency and drafting, and the four-slot change alone was small.
