Cloudflare's Clef: open-weight decision models for typed classification steps

Cloudflare released Clef and Clef-flash, Apache 2.0 decision models on Workers AI, for builders who need a fast, bounded classifier step in a workflow.

Picture an ops lead at a ten-person agency who has vibe-coded a small inbox router. Every inbound email (a client complaint, a vendor invoice, a sales lead) goes to a small LLM with a prompt like "return JSON with category and urgent." It mostly works. Then, a few times a week, the model returns a category that isn't on the list, wraps the JSON in prose, or labels the same email differently on a rerun. She adds a retry loop, a regex cleanup and a fallback, and the router slowly becomes a pile of patches around one decision: which bucket does this go in?

That step is what Cloudflare is targeting with Clef and Clef-flash, two decision models released October 1, 2026. You don't get generated text back. You define the possible answers up front and the model returns a probability for each one. Your code reads the numbers and branches. If a model can't write free text, it can't invent a fourth category or hand back broken JSON.

What it is

Cloudflare describes a decision model as one that "produces bounded structured outputs cheaply, quickly and consistently" and returns "typed answers with probabilities" that code can use to route, escalate or defer to a human. Here is what shipped, according to the announcement and Cloudflare's docs:

Cloudflare also announced an RL fine-tuning service. It starts as a hands-on engagement with its forward-deployed engineer team, and a self-serve platform comes later.

Alternatives, with one-line trade-offs:

Two more entrants landed in the same window. Copes notes that OpenAI announced a Decisions API in limited preview on September 29, and AI Weekly reports that Amazon shipped Strands Decider 2B the same day as Clef.

Who it's for

Pick it up if your workflow has a recurring bounded judgment: ticket routing, invoice categorization, "does this need a human?" gates, or domain or content classification. It fits especially well if you already run on Workers or call Jev today. The open weights also matter if you want an exit from hosted inference later.

Skip it if the step needs open-ended reasoning, written explanations or tool calls; that's LLM territory, as both Cloudflare and the Jev explainer say. Skip it too if your categories are fuzzy or constantly expanding, or if a small LLM with structured output already passes your own evals and the failure modes above don't bite you.

Before and after

Before (LLM-as-classifier):

  1. Write a prompt listing the categories and asking for JSON.
  2. Call the LLM and wait for it to generate the answer.
  3. Parse the output, validate it against the allowed labels, and retry or repair on failure.
  4. Pick a threshold with no real probability to anchor it.

After (decision model):

  1. Define state plus typed questions, each with explicit criteria.
  2. Make one call and get back answers keyed by your question IDs, with probabilities.
  3. Branch in code: route if the top choice clears your threshold, defer to a human otherwise.

Cloudflare's own example is threat-intel domain classification. It reports that Clef took 2.2s to fetch, render and classify a site, versus 4.7s for gpt-oss-120b in the same workflow, which also returned fewer classifications. That is Cloudflare's internal test, not an independent one.

Try it

Copes' walkthrough describes the setup: in the Cloudflare dashboard, open Workers AI, select Use REST API, create a token from the Workers AI API Token template, and export CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_AUTH_TOKEN. Then send the request shown in the announcement:

curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/cloudflare/clef \
-X POST \
-H "Authorization: Bearer $CLOUDFLARE_AUTH_TOKEN" \
-d '{
"model": "clef",
"state": "Checkout has been failing for every customer for the last hour.",
"questions": {
"urgent": { "type": "noul", "instructions": "Is this support request urgent?" },
"team": {
"type": "choice",
"instructions": "Which team should handle this request?",
"criteria": {
"billing": "Payments, invoices, and refunds",
"technical": "Outages, errors, and configuration",
"sales": "Plans and upgrades"
}
},
"severity": {
"type": "score",
"instructions": "How severe is the customer impact?",
"criteria": ["No impact", "Minor", "Major", "Critical"]
}
}
}'

To try the smaller model, swap in @cf/cloudflare/clef-flash and "model": "clef-flash".

Cost. Workers AI pricing is $0.011 per 1,000 Neurons, with 10,000 Neurons per day free; usage beyond that requires Workers Paid. Copes and Crypto Briefing report $0.24 per million input tokens for Clef and $0.09 for Clef-flash, with output not billed.

A sane first eval. A GitHub issue lays out a migration plan:

The same recipe works against your current LLM classifier: export real labeled rows and compare the outputs.

Where it breaks

Sources