In 30 seconds
Cloudflare trained small models to handle decisions and extract data before calling a large language model. In a failed-build investigation, group product manager Michelle Chen says the combined workflow cut language-model calls from five to one and cost 72% less in one run. The approach fits Cloudflare's distributed network: when a model responds quickly, the time a request spends on the network matters more. Chen traces the decision to a shift away from the company's original bet on small models, followed by a return to that idea when fast decision models emerged.
- 1Cloudflare's original bet on smaller models ran into larger onesWorkers AI launched in 2023 on the assumption that smaller models would make network delay matter. Models instead grew, and Cloudflare pivoted to hosting large models as part of its developer platform.
- 2Fast decision models made the original network bet relevant againChen says a single-pass model can make certain decisions quickly and leave more demanding work to a language model. When inference is fast, distance to the user becomes important again.
- 3A closed model prompted Cloudflare to build its ownAfter TypeSafe introduced Jev, Cloudflare experimented with its own version and trained Clef over a 48-hour weekend. Chen says the company released four models in three weeks, including an extraction model.
- 4A failed-build agent can filter tools and logs before reasoningIn the example, Clef Flash narrows 40 tools to 10, and Clairic extracts the pull request number and pertinent log fields. A language model then receives the smaller context.
- 5One test run used 94% fewer language-model tokensChen reports 9.2 seconds versus 17.2 seconds, 72% lower cost and one language-model call versus five in a run away from conference Wi-Fi. The figures describe that example, not all workloads.
Takeaways
- Use a small decision model to narrow the tools an agent considers before calling a large language model.
- Extract the relevant fields from long logs before sending them to a language model.
- Chen's build-triage example cost 72% less and used 94% fewer language-model tokens in one run; it is an example rather than a general benchmark.
- Fast local inference makes network delay more consequential than it is for a slow, large-model response.
Read the edited text by chapter
From a delivery network to a developer platform
Cloudflare put servers close to users to deliver and protect content. It later added on-demand computing and storage so developers could build applications on that infrastructure.
I'm Michelle Chen, a group product manager at Cloudflare working on Workers AI, AI Search and AI Gateway. To explain why we recently trained our own models, I want to look back at the choices that brought us here and then show what developers can do with those models.
Cloudflare began as a content delivery network: it sits between a user and a website's origin server, caching content and providing security so requests can be served quickly. When we launched in 2010, that meant building data centers around the world, close to users, rather than concentrating computing in a few regions.
Once we had computers close to users, we asked what else people could build with them. In 2017 we launched Workers, which run short pieces of code without renting an entire machine. We added stateful Durable Objects and, in 2025, containers for workloads that need them.
We then added storage: KV, R2 object storage and databases such as D1. The aim was to let developers build complete applications on the same platform, combining computation with persistent data.
The small-model bet and a pivot to larger models
Workers AI began with the expectation that models would shrink. As they grew instead, Cloudflare began hosting large models for its developer platform.
When ChatGPT took off, we asked what our infrastructure could contribute to AI. In 2023 we launched Workers AI and put GPUs on our distributed network. Our hypothesis was that models would become smaller and faster, making the delay of sending a request across the network increasingly important.
Instead, models grew larger. In my view that was understandable: training on more data and increasing model size helped make systems more general. But it went against our original hypothesis, and the time spent running a large model made network delay less significant.
We pivoted to serving large models. In March 2026 we launched Kimi on our infrastructure, followed by GLM and DeepSeek. We took time to make the decision because these models did not fit our original infrastructure story as neatly, though they did fit our developer platform.
By 2026 we had infrastructure near users, compute for agents, storage for their data and large models to power them. We wanted all of those pieces to make Cloudflare an agent cloud, but the model-serving pattern still did not quite match what Workers AI had originally been designed to do.
Decision models bring the network advantage back
Chen says fast single-pass models made network delay important again. Because Jev was closed source, Cloudflare developed Clef and later an extraction model.
There is a Chinese saying about everything being ready except the east wind. You cannot predict where that wind will come from, but you need to react when it arrives. For us, it came in September 2026 when TypeSafe introduced Jev and the idea of a System 1 model.

Unlike a language model that generates a sequence of tokens, this kind of model makes a decision in one pass through its input. I thought the timing was right: people were increasingly frustrated by the cost and time of sending every task to a large language model.
The point is not to replace the larger model. A small, fast model can take some decisions off its plate, and the two can work together. That also brought us back to the original Workers AI hypothesis: when the model itself is fast, network delay matters again.
Jev was closed source, so we could not host it on our own infrastructure. It launched on September 15; three days later we started experimenting with our own version. After a week of deliberating about what becoming a model lab would mean, we decided to go ahead.
We trained a model over a 48-hour weekend and launched it the following week as Clef. It gives agents a way to make certain decisions programmatically, without asking a large language model to reason for minutes or waiting for a person to respond. For an inference provider, that can also reserve large-model capacity for other work.
We then asked what other tasks people were sending to language models that might not need one. We launched four models in three weeks, including Clairic, an extraction model. Like the decision model, it is designed for a single fast pass, but its job is to turn unstructured material into usable fields.

Real inputs come as emails, messages and other text, not neatly filled-out forms. Clairic can extract, compute, estimate or forecast values and return typed JSON that software can use; it can also take images. An agent can use Clairic to read the input, Clef to make a decision and a language model where further reasoning is needed.
For me, building these models supplied the missing part of our infrastructure story. It also means we can create a model we need ourselves when an outside model is closed source or other constraints leave a gap.
Reducing language-model work in a failed-build investigation
A demo filters available tools and extracts useful log fields before involving a large model. Chen reports lower time, cost and token use for the example.
To show how the pieces work together, consider an agent investigating a failed continuous-integration build. The agent has 40 tools available. In a conventional flow the language model calls a tool, receives the result and repeats, potentially sending the tool list and growing context back and forth several times.

With System 1 models, we can use Clef Flash to narrow the 40 tools down to the 10 the task may need. Clairic extracts the pull request number, then ordinary code makes the relevant API calls. Clairic reads the returned logs to pull out the error and affected lines, instead of passing hundreds of lines to the language model.
The language model then gets the relevant information and can perform the final reasoning and action. In the live demonstration both approaches reached an answer. The run using the smaller models finished sooner, with one language-model call and roughly 1,800 tokens, compared with six calls and around 40,000 tokens for the other run.


I also ran the same example away from conference Wi-Fi. That run took about 9.2 seconds with the smaller models versus 17.2 seconds with the language-model flow, cost 72% less, reduced five language-model calls to one and used 94% fewer tokens. It is an illustrative example of using both kinds of model together, not an attempt to eliminate language models.
Other uses and adapting to change
Chen points to routing, fraud and extracting support-ticket data as possible uses. She argues that Cloudflare's path required responding to changing model capabilities.

Other uses we are seeing include routing, fraud, spam and phishing decisions, as well as extracting data from web pages and support tickets. Clairic was in early preview when I gave this talk, and I expected the uses to grow as more people tried it.
We had to adapt when our initial hypothesis about smaller models did not match what happened, and again when decision models fit our infrastructure. Looking back explains the path, but moving forward required acting on what we had learned. The question I will leave you with is: what are you going to build today?
More from this channel
19:26EN
18:03EN
18:43EN
18:01EN
22:29EN
21:22EN