Cloudflare says it cut time per token on huge open AI models

In short

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

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

Sources

Related stories

More from Open Models

All stories from Open Models