Cloudflare Cuts Costs 10x for Kimi and GLM with KV Cache Quantization and New Inference Stack

Cloudflare · 3 Aug 2026 · 2 min read

#cloudflare

Serving frontier models like Kimi and GLM at scale is a battle for GPU memory. In a new engineering deep dive, Cloudflare reveals the optimizations that let it run these massive models more efficiently, cutting costs by up to 10x while improving latency and adding security checks.

The core challenge is that large models consume huge amounts of VRAM for weights and KV caches (the keys and values stored during attention). Cloudflare’s solution combines several techniques:

  • KV cache quantization: They use 4-bit and 8-bit quantization for KV caches via the kvcache API, reducing memory footprint by up to 75% while retaining accuracy through careful calibration.
  • Weight compression: They apply squeeze-LLM and other compression methods to shrink model weights, cutting memory usage by 50-60% without significant quality loss.
  • Integrity checks: They add SHA-256 hashes for each model shard, verified at load time with verify_model_integrity(), preventing tampering and corruption.
  • Faster loading: They use parallel shard downloads and a custom mmap-based loader to reduce cold-start latency by 4x.
  • Scheduling optimizations: They reorder attention computations to reduce fragmentation, improving throughput by 20%.

These changes are not just theoretical. In production, Cloudflare reports serving Kimi-1.5 and GLM-4 with 90% lower cost per request and 35% faster time-to-first-token compared to their previous stack. The integrity checks also catch misbehaving workers early, ensuring more reliable responses.

For developers building AI applications, this matters because it makes high-end models more affordable and responsive. Cloudflare’s approach shows that with smart quantization and system-level tuning, you don’t need the latest hardware to serve state-of-the-art models efficiently. The techniques are available through their Workers AI platform, so you can apply the same optimizations to your own inference workloads.

Source: https://blog.cloudflare.com/smaller-faster-safer-models/

Related

auto-curated · source linked above ← all news