Cloudflare Clef and the Decision-Model Race: Agents That Answer Without a Paragraph
💡 Tool Tip:AI Token Counter, API Response Time Calculator, AI Code Reviewer
In early October 2026, Cloudflare open-sourced the decision models Clef and Clef-flash on its blog: decision models for high-speed classification and agentic workflows, hosted on Workers AI, licensed Apache 2.0, with weights posted to Hugging Face. The significance is not that there is one more model to choose from. It is that Clef puts a quiet waste on the table: most agents still work the same dumb way underneath. You ask a large model a yes-or-no question and it generates a full sentence to answer "yes," burning time and tokens to say one word. A decision model skips the sentence and returns a probability instead. The same week, OpenAI's Decisions API and Amazon's Strands Decider 2B arrived. Here are the specs, the benchmarks and how to use them.
1. What a decision model actually is
Start with the definition. Per the Cloudflare blog, a decision model makes classifications to help agents decide how to act, based on probabilities. It takes some data plus a typed question and returns how likely the answer is yes, which option from your list fits best, or where something sits on a scale you defined. That is fundamentally different from asking an LLM to write a sentence answering a yes-or-no question: a decision model produces a structured result your code can branch on, while a general LLM first generates the sentence token by token. Cloudflare's example is concrete: pass in a customer support message and ask whether it is urgent and which team should handle it; the model returns typed answers with probabilities that your code uses to route the ticket, trigger an escalation, or defer to a human.
# A decision model is not a smaller chatbot. It does one job: score
# typed answers against a fixed schema, and return probabilities your
# code can branch on. Cloudflare's framing is concrete.
DECISION_MODEL = {
"input": "some data plus a typed question",
"output": "how likely the answer is yes / which option fits / where on a scale",
"not": "a generated sentence that says 'yes'",
}
# Example: a support message in, a routing decision out.
classify(
state="customer support message",
schema={"urgent": ["yes", "no"], "team": ["billing", "tech", "other"]},
)Agentic decisions no longer require a human in the loop
2. Clef's specs: two sizes, one Apache 2.0 licence
Per the Cloudflare blog, Clef comes in two sizes. Clef is a 27 billion parameter model aimed at the most accurate calls; Clef-flash is a 9 billion parameter version built for answers in a few tens of milliseconds. Both use Qwen as the base model, post-trained for decision-model use cases, and both have a 64,000 token context window — double Jev's 32k, so users can squeeze more input state in for the model to classify against. Both ship under the Apache 2.0 license with weights posted to Hugging Face, which means a developer can download them and run them on their own hardware rather than only calling an API. Cloudflare also highlights a vision encoder, letting Clef classify a screenshot or photo the same way it classifies text — a difference from the text-only Jev at release time.
# The Clef line, as published on the Cloudflare blog. Two sizes, one
# backbone family, and a licence choice that is the real headline.
CLEF = {
"clef": {"params": "27B", "aim": "most accurate calls"},
"clef-flash": {"params": "9B", "aim": "answers in a few tens of ms"},
"backbone": "Qwen (post-trained for decision use cases)",
"context": "64,000 tokens",
"license": "Apache 2.0",
"weights": "posted to Hugging Face (self-hostable)",
"vision": "vision encoder; up to four images alongside text state",
}
# Cloudflare notes the 64k window is double Jev's 32k, so more input
# state can be squeezed in for the model to classify against.3. Why it can be this much faster
The speed comes from removing autoregressive generation. Per the Cloudflare blog, during inference Clef uses Qwen for a prefill-only pass, then scores the valid schema choices in parallel. The decision step is non-autoregressive, so there is no intermediate text to generate token by token, making Clef significantly faster than autoregressive LLMs. The reported numbers give a feel for the gap: in one real workflow test, Clef classified a website in 2.2 seconds, while gpt-oss-120b took 4.7 seconds and returned fewer classifications; across 43 benchmark runs, Clef ran 2.5 times faster than TypeSafe's Jev at the median, and Clef-flash came in 13 times faster. For high-frequency, short decisions — classification, routing, gating — that gap shows up directly in latency and on the bill.
# The trick is skipping autoregressive generation entirely. Clef does
# a prefill-only pass, then scores the valid schema choices in parallel.
# No intermediate text means nothing is generated token by token.
def clef_decide(state, schema):
# Step 1: single prefill pass over (state + schema)
prefilled = clef.prefill(state, schema)
# Step 2: score every allowed choice in parallel
scores = clef.score_choices(prefilled, schema.choices)
return scores # typed answers with probabilities
# Cloudflare's reported numbers, for context:
BENCHMARKS = {
"website_classification": {"clef": "2.2s", "gpt-oss-120b": "4.7s",
"note": "Clef returned more classifications"},
"vs_jev_median": "2.5x faster across 43 benchmark runs",
"clef_flash": "13x faster",
}Non-autoregressive, prefill-only: scoring choices in parallel
4. That week: a category forming
Clef is not an isolated release, which is exactly why it deserves attention. According to Startup Fortune's coverage, the category solidified in roughly two days. TypeSafe AI's Jev started it, built specifically around bounded, machine-readable decisions rather than open-ended text. OpenAI introduced its Decisions API at DevDay (2026-09-29), built on Luna, aimed at the same bounded-answer use case: classification, routing, picking the next step in an agent loop. Amazon followed on October 1 with Strands Decider 2B, built on a Qwen3.5 base with what AWS calls a pointer head that scores predefined options directly. The coverage also gives a cost intuition: one reported hackathon demo used a decision model to monitor an agent's actions for $2.94, versus $372 running the same check through a frontier LLM. The expensive part was never the decision — it was making it the wrong way.
# Clef did not arrive alone. The category solidified in roughly two
# days, which is why it matters beyond one vendor.
CATEGORY_RACE_2026 = {
"TypeSafe Jev": "the model that started it; text-only, 32k context",
"OpenAI": "Decisions API at DevDay (2026-09-29), built on Luna",
"Amazon": "Strands Decider 2B, Qwen3.5 base, 'pointer head'",
"Cloudflare": "Clef (27B) + Clef-flash (9B), Apache 2.0, vision",
}
# The economic argument: one reported hackathon demo used a decision
# model to monitor an agent's actions for $2.94, versus $372 running the
# same check through a frontier LLM. Routing decisions should not cost
# frontier prices.5. The surrounding platform: serve, observe, fine-tune, redeploy
Self-hostable weights are only step one; being able to fine-tune and redeploy is what completes the loop. Per the Cloudflare blog, the release is paired with platform pieces: the models serve on Workers AI, are observed through AI Gateway, run in sandboxes built on Containers, and come with a new reinforcement learning fine-tuning platform that lets developers fine-tune decision models using their own data. Fine-tuned models can be redeployed back onto Workers AI through a component called Trainer. On rollout, Cloudflare says it starts with a forward-deployed engineer team working with early customers before opening up to self-serve. The subtext: Cloudflare is betting that infrastructure wins this fight before any single model does.
# Cloudflare pairs the release with tooling, because a model you can
# self-host only pays off if you can also fine-tune and serve it.
CLEF_PLATFORM = {
"serve": "Workers AI",
"observe": "AI Gateway",
"sandbox": "Containers",
"fine_tune": "new RL fine-tuning platform (bring your own data)",
"redeploy": "Trainer, to push fine-tuned models back onto Workers AI",
"rollout": "starts forward-deployed with early customers, then self-serve",
}
def pick_runtime(need_weights, latency_budget_ms):
if need_weights: # lock-in is the real cost
return "self-host Clef / Clef-flash"
if latency_budget_ms < 100:
return "Clef-flash"
return "Clef" # accuracy-first tierLock-in, not per-token price, is the real cost
6. Putting decision models into your agent stack
Using a decision model is refreshingly direct. First, find the nodes in your agent loop that are high-frequency, finite-answer and free of open-ended prose — classification, routing, gating, next-step selection — and move those off the general-purpose LLM. Second, design your branching around probability-bearing outputs, and route low-confidence cases explicitly to a human or an escalation path. Third, validate value on the hosted version before deciding whether to self-host the weights to remove lock-in; self-hosting only pays off if you can fine-tune and serve end to end. Fourth, fold decision calls into your token and latency budgets — quantify the win with our AI Token Counter and API Response Time Calculator, standardise your schemas with AI Prompt Templates, and add a review pass to branching logic with the AI Code Reviewer. Fifth, if the decision model is your gatekeeper, give it rate limits and quotas, sized with the API Rate Limit Calculator.
📌 Frequently Asked Questions
What is a decision model?
Per the Cloudflare blog, a decision model makes classifications to help agents decide how to act, based on certain probabilities. For example, you can pass in a customer support message (input) and ask whether it is urgent and which team should handle it. The model returns typed answers with probabilities (output) that your code can use to route the ticket, trigger an escalation, or defer to a human. Cloudflare's framing is that a human does not necessarily need to be in the loop for agentic decisions anymore.
What are the specs of Clef and Clef-flash?
Per the Cloudflare blog, Clef is a 27 billion parameter model aimed at the most accurate calls, and Clef-flash is a 9 billion parameter version built for answers in a few tens of milliseconds. Both use Qwen as the base model, post-trained for decision-model use cases, with a 64,000 token context window. Both ship under the Apache 2.0 license with weights posted to Hugging Face, so a developer can download them and run them on their own hardware. Cloudflare notes the 64k window is double Jev's 32k, and that Clef has a vision encoder that can take in images and classify visual content.
Why is Clef faster than a general-purpose LLM?
Per the Cloudflare blog, during inference Clef uses Qwen for a prefill-only pass, then scores the valid schema choices in parallel. The decision step is non-autoregressive, so there is no intermediate text to generate token by token, making Clef significantly faster than autoregressive LLMs. Cloudflare's reported benchmarks: in a real workflow test, Clef classified a website in 2.2 seconds while gpt-oss-120b took 4.7 seconds and returned fewer classifications; across 43 benchmark runs, Clef ran 2.5 times faster than TypeSafe's Jev at the median, with Clef-flash coming in 13 times faster.
What else happened that week?
According to Startup Fortune's coverage, the category solidified in about two days. TypeSafe AI's Jev started it, built around bounded, machine-readable decisions rather than open-ended text. OpenAI introduced its Decisions API at DevDay (2026-09-29), built on Luna, for classification, routing and choosing an agent's next step. Amazon followed on October 1 with Strands Decider 2B, built on a Qwen3.5 base with a "pointer head" that scores predefined options directly. Of the three, Cloudflare is the only one giving away full model weights under Apache 2.0.
How do I wire Clef into an agent?
Per the Cloudflare blog, the release is paired with tooling: the models serve on Workers AI, are observed through AI Gateway, run in sandboxes built on Containers, and come with a new reinforcement learning fine-tuning platform that lets developers fine-tune decision models using their own data, then redeploy them onto Workers AI through a component called Trainer. In practice, teams usually validate the classification and routing value on the hosted version first, then decide whether to self-host the weights to remove vendor lock-in.
🔧 Recommended Tools
AI Token Counter
Quantify the token win from decision models
API Response Time Calculator
Budget latency for classification and routing
AI Prompt Templates
Standardise decision-schema prompts
AI Code Reviewer
Review probability-based branching logic
API Rate Limit Calculator
Cap high-frequency decision calls