Cloudflare puts frontier open-source models on Workers AI

Cloudflare has positioned its developer platform as a home for agentic workloads, providing primitives like Durable Objects for state, Workflows for long-running tasks, and Dynamic Workers or Sandbox containers for secure execution. What has been missing from that stack, until now, is access to the kind of large, powerful models that can actually drive those agents.

Workers AI is now serving frontier-scale open-source models, starting with Moonshot AI's Kimi K2.5. The model is available with a full 256k context window and support for multi-turn tool calling, vision inputs, and structured outputs, making it well-suited for agentic tasks. With this addition, developers can run the complete agent lifecycle on a single platform, from the model inference to the orchestration layers.

Why cost is driving open-source adoption

Cloudflare engineers have been testing Kimi K2.5 internally for several weeks, both as a daily driver for agentic coding in the OpenCode environment and integrated into automated code review through the public agent Bonk. The results have led the company to describe the model as a fast, efficient alternative to larger proprietary options without a sacrifice in quality.

The economics are the primary motivator. As an illustrative example, Cloudflare runs an agent that performs security reviews of its codebases. This agent processes over 7B tokens per day, and with Kimi it has caught more than 15 confirmed issues in a single codebase. Running that same workload on a mid-tier proprietary model is estimated to cost $2.4M annually. With Kimi K2.5 on Workers AI, the company reports cutting those costs by 77%.

The broader trend, as Cloudflare sees it, is a rise in always-on personal agents like OpenClaw. When every employee runs multiple agents processing hundreds of thousands of tokens per hour, proprietary model pricing becomes the primary blocker to scaling. Open-source models with frontier-level reasoning are positioned to fill that gap, and Workers AI is being built to serve both serverless endpoints for individual agents and dedicated instances for organization-wide autonomous workloads.

Serving large models at scale

While Workers AI has offered LLMs since launch two years ago, the focus was historically on smaller models. That was partly because open-source models lagged behind frontier labs for some time. Kimi K2.5 represents a shift, but serving a model of this size required changes to Cloudflare's inference stack.

Cloudflare has developed custom kernels for Kimi K2.5 on top of its proprietary Infire inference engine to improve performance and GPU utilization. Serving very large models typically requires a combination of data, tensor, and expert parallelization, along with strategies like disaggregated prefill, where the prefill and generation stages run on separate machines for better throughput. Much of this optimization does not come out of the box when self-hosting an open-source model, and it is exactly the hard part that Cloudflare has aimed to remove. Developers using Workers AI just call an API rather than managing a fleet of GPU servers and the associated ML engineering and SRE work.

Platform updates for agent workloads

Alongside the Kimi K2.5 launch, Cloudflare has shipped several platform improvements targeting the way agents consume LLM inference.

Prefix caching and cost transparency

Agentic workloads often send large inputs: detailed system prompts, tool definitions, MCP server tools, or entire codebases. In multi-turn conversations, clients resend all previous context with each new prompt, even though only a few lines may have changed. Prefix caching avoids redoing prefill on the entire request by caching input tensors from prior requests and processing only the new tokens. This reduces Time to First Token (TTFT) and improves Tokens Per Second (TPS) throughput.

Workers AI has always done prefix caching, but now cached tokens are surfaced as a usage metric and priced at a discount compared to regular input tokens. Pricing details are listed on the model page in the developer docs.

Session affinity header

To improve cache hit rates, Cloudflare has introduced a new x-session-affinity header. Sending this header with a unique string per session or agent routes requests to the same model instance, improving cache hits and reducing costs. The Agents SDK starter already includes this wiring, and some clients like OpenCode implement it automatically.


// Example showing the new session affinity header
// with a unique string per session or agent

A redesigned async API

Serverless inference has inherent trade-offs. There's no capital expense for dedicated GPUs per request, but requests must contend with other traffic and capacity constraints. For workloads that exceed synchronous rate limits, Cloudflare has revamped its Asynchronous API. The sysstem now uses a pull-based model rather than push-based, pulling queued requests into model instances as capacity becomes available there is no Out of Capacity error - inference will eventually execute durably.

Cloudflare monitors GPU utilization in real time and pulls asynchronous requests when utilization is low, prioritizing critical synchronous traffic while still processing async workloads efficiently. In internal testing, async requests typically execute within 5 minutes, but this will vary with live traffic. This API is designed for non-real-time use cases like code scanning agents or research agents. Developers can also set up event notifications to receive notice when inference is complete rather than polling.

Getting started

Kimi K2.5 is now the default model in the Agents SDK starter, and developers can find model information, pricing, and documentation on prompt caching and the asynchronous API in the developer docs. Opencode users can connect to Kimi K2.5 on Workers AI as a provider, and there is a playground for live experimentation.