Cloudflare Runs Kimi and GLM at Scale: FP8 KV Caches, INT4 Weights, and a Cache Safety Net

TL;DR
Cloudflare runs Kimi K2.6 and GLM 5.2 on Workers AI with FP8 KV caches, INT4 weights and a KV cache integrity check. What each technique buys on GPU fleets.
Last updated: August 14, 2026
Update (August 14, 2026): Z.ai released GLM-5.3 today, on the same base model as the GLM 5.2 discussed here. Once its open weights ship (promised about two weeks after launch), the serving techniques in this post - FP8 KV caches, INT4 weights, the cache safety net - should transfer directly, since the architecture is unchanged.
On August 3, as part of Agents Week, Cloudflare published the serving playbook behind Workers AI running two of the most demanding open models it hosts: Moonshot's Kimi K2.6 and Zhipu's GLM 5.2. Both are large, long-context mixture-of-experts models, and both are memory-bound on the GPU. The post details three techniques layered on top of Cloudflare's existing large-model serving work: quantizing the KV cache, compressing model weights, and protecting the shared cache those two optimizations expose. The measured numbers make it one of the most concrete serving write-ups of the year.
What shipped#
Cloudflare serves these models on GPUs in its own data centers via Workers AI, using SGLang as the inference engine. The company says SGLang offers the best performance in the market and that it upstreams patches to the project. Three optimizations make up the new work:
1. FP8 KV caches. As a model generates, it stores attention keys and values for every processed token in the KV cache, and for a long-context model the cache fills GPU memory before the weights do. Cloudflare stores the cache in FP8 (e4m3) instead of BF16, halving its size. On Kimi K2.6 that raises resident context from roughly 686,000 tokens to about 1.37 million, twice as much.
The benefit is not raw speed. On a disaggregated H200 deployment, BF16 is a few percent faster per token at any single concurrency level, because the FP8 attention kernel converts values as it reads them. But BF16 runs out of cache at 32 concurrent requests and cannot admit a 33rd, while FP8 keeps going to 64 and reaches 2,192 tokens per second, about 41% higher than BF16's peak, for roughly 30% less cost per token. Because prefill and decode run as separate pools, prefill keeps the BF16 cache: prefill is compute-bound rather than memory-bound, and BF16's slightly higher throughput wins there. Across Cloudflare's evaluation suite, FP8 and BF16 caches are indistinguishable in accuracy.
2. INT4 weights. For GLM 5.2, Cloudflare compresses weights from FP8 to INT4. The checkpoint drops from 705 GB to 421 GB, about 40%, and per-GPU memory on an 8-way tensor-parallel deployment falls from roughly 88 GB to 52 GB, leaving room for about 1.18 million tokens of KV cache on the same hardware.
Decode gets faster because generating each token means streaming weights out of GPU memory, and decode speed is limited by memory bandwidth: move less data and every token arrives sooner. The effect is largest at low concurrency, where per-request latency matters most. Prefill behaves the opposite way, because INT4 weights must be expanded before matrix multiply: GLM sustains about 10,160 tokens per second of prefill in FP8 versus 8,660 in INT4. The disaggregated design turns this into a choice rather than a compromise, so Cloudflare runs INT4 for decode and FP8 for prefill. Accuracy stays within 0.8 points of the FP8 model across every benchmark it runs.
3. KV cache integrity checking. Both optimizations pack hundreds of requests onto one GPU, all reading and writing pages of the same physical KV cache. Paged attention, continuous batching, and cache reuse rely on exact bookkeeping, and at Cloudflare's request volumes, even a one-in-a-billion mistake shows up regularly. The fix: every physical cache page gets a tag that changes whenever the page is reallocated, and the server records which pages and tags each request expects. Before supported decode operations read from the cache, the mappings are checked, and a mismatch aborts the request rather than returning data from the wrong page. The validation runs as a separate batch check instead of being fused into the attention kernel, keeping the cost under 1% on both throughput and tail latency. It is opt-in per deployment, and the default path uses a no-op tracker with no measurable overhead.
Why it matters to developers#
Three takeaways stand out.
First, this is the real economics of open frontier models. The GPU costs of serving Kimi K2.6 or GLM 5.2 are dominated by memory, not compute. Halving the cache and cutting the weights 40% do not change answers, they change how many customers fit on a GPU. A 30% cut in cost per token on a model this large is the difference between viable and not viable for hosted open-weights inference. For anyone who has run the numbers on self-hosting open-weights models, this is the operator-side version of that math, and the direction is the same: quantized serving is table stakes, not an optimization.
Second, disaggregation converts tradeoffs into choices. The classic dilemma with quantization is that it helps one phase and hurts the other. Cloudflare sidesteps it by running INT4 decode pools and FP8 prefill pools, and the FP8 KV cache lands in decode only. This is the same architecture pattern that makes KV caching interesting in the first place: when memory is the bottleneck, where you place precision is a routing decision.
Third, the integrity check is the quiet interesting part. Multitenant GPU serving is a shared-memory system, and page-reuse bugs in paged attention are a known class of correctness risk. A tagging scheme that aborts mismatched reads, measured at under 1% overhead, is a defensible answer to the question of whether sharing hardware cheaply is safe. Cloudflare's plan to make it a fleet-wide default is worth watching.
On the practical side, the work being upstreamed to SGLang means the techniques are not locked behind Workers AI. If you self-host, the vLLM vs TGI vs SGLang comparison is the right starting point, and FP8 KV caches and quantized weights are increasingly supported across all three engines. For the models themselves, the Kimi K3 open-weights release and the GLM 5.2 cost math frame why anyone cares about serving these two families cheaply at all.
The direction of travel is clear: expect FP8 KV caches to expand across Cloudflare's fleet, NVFP4 weight validation on Blackwell, and integrity checks left on everywhere at negligible cost. For developers, hosted open frontier models keep getting cheaper per token, with the same answers.
FAQ#
How does an FP8 KV cache help Cloudflare serve Kimi K2.6?#
Storing the KV cache in FP8 (e4m3) instead of BF16 halves its size, raising Kimi K2.6's resident context from roughly 686,000 tokens to about 1.37 million. The gain is capacity rather than per-token speed: BF16 runs out of cache at 32 concurrent requests, while FP8 keeps going to 64 and reaches about 41% higher peak throughput for roughly 30% less cost per token.
Does INT4 quantization make GLM 5.2 faster?#
For decode, yes. Cutting GLM 5.2's weights from FP8 to INT4 shrinks the checkpoint from 705 GB to 421 GB, and decode speeds up because less data streams out of GPU memory per token. Prefill is slower in INT4, so Cloudflare runs INT4 for decode pools and FP8 for prefill pools.
Do FP8 KV caches and INT4 weights hurt accuracy?#
Across Cloudflare's evaluation suite, FP8 and BF16 KV caches are indistinguishable in accuracy, and the INT4 GLM 5.2 model stays within 0.8 points of the FP8 model on every benchmark it runs.
What is Cloudflare's KV cache integrity check?#
Every physical cache page gets a tag that changes when the page is reallocated, and the server records which pages and tags each request expects. Before supported decode operations read from the cache, the mappings are checked and a mismatch aborts the request. It runs as a separate batch check at under 1% overhead and is opt-in per deployment.
Which inference engine does Workers AI use for these models?#
Cloudflare serves Kimi K2.6 and GLM 5.2 with SGLang and upstreams patches to the project, so the techniques are not locked behind Workers AI.
Continue Reading#
- GLM-5.3 on Workers AI Leaked Other Users' Prompts - the October incident report on the same SGLang and KV cache stack
- vLLM vs TGI vs SGLang: Which Inference Server to Self-Host
- KV Caching: A Practical Guide to Optimizing Transformer Inference
- Kimi K3 Weights Land on HuggingFace: 2.8T Open Frontier Model You Can Actually Download
- GLM-5.2 Cost Math: When Open-Weights Coding Models Actually Save You Money
- Self-Hosting Open-Weights Models: The Real Break-Even Math
Sources#
Get the next deep dive like this in your inbox
One email a week on News and the rest of the AI dev stack. Free.
Read next on local and open-weight models
vLLM vs TGI vs SGLang: Which Inference Server to Self-Host
A fair comparison of vLLM, TGI, SGLang, TensorRT-LLM, llama.cpp, and LMDeploy for self-hosted LLM inference - batching, quantization, hardware, and ops.
7 min readKV Caching: A Practical Guide to Optimizing Transformer Inference
How KV caching speeds up LLM inference - the math, the code, the memory tradeoffs, and when it stops helping. Every dev running local models hits this wall.
11 min readKimi K3 Weights Land on HuggingFace: 2.8T Open Frontier Model You Can Actually Download
Kimi K3 open weights are on HuggingFace: 2.8T parameters, 1M context, native MXFP4 and a ~1.63TB download. The specs, license terms and HN reaction.
7 min readNew here? Start with
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.





