Cloudflare says it cut time per token on huge open AI models
In short
- On 16 April 2026, during its Agents Week, Cloudflare published a technical post on how its Workers AI service runs very large open models, starting with Moonshot AI's Kimi K2.5, which it had added on 19 March.
- The main change was to run the two stages of answering a request, reading the prompt (prefill) and writing the reply (decode), on separate servers. Cloudflare says p90 time per token fell from about 100 ms to 20-30 ms, which it calls a 3x improvement.
- Clients that tag their requests with a session header helped raise input-token cache hits from 60% to 80% at peak, and NVIDIA's EAGLE-3 draft model speeds up output through speculative decoding.
- The models are other labs' open-weight releases. Cloudflare's own engine, Infire, is proprietary. All figures are Cloudflare's, measured on its own traffic.
20-30 ms p90 time per token, down from about 100 ms; 60% → 80% input-token cache hit ratio at peak; ~560 GB Kimi K2.5's weights, over 1 trillion parameters; 8 H100s the fewest GPUs that can hold Kimi K2.5; under 20 s Infire's start-up time for the largest models
Why agents change the problem
A server can be tuned to read long inputs fast or to write long outputs fast. Cloudflare tuned for agents, whose requests start with a long system prompt and tool descriptions and resend everything said before on each turn. So it says it focused on "fast input token processing and fast tool calling".
How did Cloudflare make huge AI models faster?
Answering a request has two stages. Prefill reads all the input tokens at once and stores the result in the KV cache, the model's working memory of the conversation. Decode then writes the output one token at a time. Cloudflare explains that prefill is limited by raw computing power and decode by memory, so they use different parts of the GPU, and on one machine they block each other.
With prefill-decode disaggregation, a request goes first to a prefill server, then to a decode server that copies the KV cache across. Each pool can then be tuned, scaled and even run on different hardware. Cloudflare says this needed "a relatively complex load balancer" that spreads requests by estimating how many tokens each server already has in flight.
After moving traffic to this set-up, with the same number of GPUs and more requests, Cloudflare reports a "significant improvement" in the spread of p90 time to first token (the post shows this as a chart and gives no figure in the text), and p90 time per token going from about 100 ms "with high variance" to 20-30 ms. The company calls it a 3x improvement; on the raw numbers the drop is between about 3.3 and 5 times (our arithmetic).
Reusing work between turns
Because an agent resends its whole history each turn, recomputing it every time wastes GPUs. Cloudflare asks clients to send an x-session-affinity header so a request goes back to the place that already holds its computed input. The March launch post introduced the header and a discount on cached tokens; the April post says Cloudflare added the header to agent tools such as OpenCode.
"A small difference in prompt caching from our users can sum to a factor of additional GPUs needed to run a model," the post says. After the company's heaviest internal users adopted the header, input-token cache hit ratios rose from 60% to 80% at peak times.
One model, many GPUs
A model this big spans several GPUs, so its KV cache has to be shared. Cloudflare uses Moonshot AI's Mooncake software to copy memory directly between GPUs and machines, let one server reuse a cache built on another, and spill the cache onto NVMe drives so sessions stay cached longer.
Guessing ahead: speculative decoding
In speculative decoding, a small, fast "draft" model proposes the next few tokens and the big model checks them all in one pass, keeping only the ones it agrees with. Checking is cheaper than writing, and the big model still has the final say, so quality is kept.
Cloudflare says this "really shines" for agents because tool calls are predictable. For Kimi K2.5 it uses NVIDIA's EAGLE-3 draft model. The post gives no separate speed-up figure for this step.
Infire, Cloudflare's own engine
Infire is Cloudflare's inference engine, written in Rust and first announced in 2025. The post says it now runs models across several GPUs in pipeline-parallel or tensor-parallel mode, with expert parallelism. Cloudflare's own figures:
Cloudflare says "you would have trouble even booting vLLM", a widely used open-source engine, in those two set-ups, without a published side-by-side test.
Is Cloudflare's setup open source?
The post is about serving other labs' models; Cloudflare released no model and no code with it.
Moonshot's Modified MIT licence lets anyone use, copy, change and sell the model. Its one extra rule: a commercial product with more than 100 million monthly users, or more than $20 million in monthly revenue, must show "Kimi K2.5" prominently in its interface.
What came next on Workers AI
The changelog shows the large-model catalogue moving fast around the post:
19 Mar 2026: Kimi K2.5 added, with a 256k context window, tool calling, vision and structured outputs. 4 Apr 2026: Google's Gemma 4 26B A4B added: a mixture of experts with 26B parameters, 4B active. 16 Apr 2026: Cloudflare publishes the post on serving extra-large models. 20 Apr 2026: Kimi K2.6 added. 30 May 2026: Kimi K2.5 retired; requests to it go to Kimi K2.6, "which has a higher price". 12 Jun 2026: Kimi K2.7 Code added, a 1T-parameter mixture of experts tuned for coding. 16 Jun 2026: Z.ai's GLM-5.2 added, with a 262,144-token context window.
Read in late 2026, the post describes Kimi K2.5, a model Workers AI stopped serving under that name six weeks later. The serving methods it describes are what carry over to the newer models.
Terms in plain English
- Token: a piece of a word, the unit models read, write and are priced in (our wording).
- p90: the time 90% of requests beat, so it tracks the slow tail (our wording).
- KV cache: what the model has already computed about the conversation, kept so it does not redo the work (our wording).
Where things stand
Cloudflare closes by saying it keeps tuning its stack as new models arrive weekly. The speeds here are the company's own, from its own traffic, and no outside group has measured them that we found.
Official channels of Cloudflare: Website · LinkedIn · X
Sources
- Building the foundation for running extra-large language models, Cloudflare blog, 16 April 2026
- Powering the agents: Workers AI now runs large models, starting with Kimi K2.5, Cloudflare blog, 19 March 2026
- Workers AI changelog, Cloudflare docs
- moonshotai/Kimi-K2.5, model card and licence, Hugging Face
- nvidia/Kimi-K2.5-Thinking-Eagle3, Hugging Face
Sources
- Building the foundation for running extra-large language models
- Powering the agents: Workers AI now runs large models, starting with Kimi K2.5
- Workers AI changelog
- moonshotai/Kimi-K2.5
- nvidia/Kimi-K2.5-Thinking-Eagle3
- https://github.com/kvcache-ai/Mooncake
Related stories
- Cloudflare brings full post-quantum switch forward to 2027
- Cloudflare releases five open-weight models built on Qwen
- NVIDIA releases open synthetic data for training document readers
- Hugging Face says an agent sped up Inkling 2 Mini 40% on one GPU
- nginx2root: five nginx bugs, one in every release since 2015 and exploitable with HTTP/2 alone, chained with a Linux kernel flaw to get root; Cloudflare says its proxy blocks the worst
- Cloudflare releases open Clairic models that pull data from PDFs