News
Cloudflare releases Clef decision models and a managed RL fine-tuning service
Cloudflare released Clef and Clef-flash, decision models that return typed answers with probabilities, on Workers AI and Hugging Face. Prices, specs and gaps.
Cloudflare released two decision models, Clef and Clef-flash, on October 1, 2026. Instead of generating text, the models return typed answers with a probability for each option, which code can use to route a ticket or flag a domain. Both run on Workers AI, the weights are on Hugging Face under Apache 2.0, and Cloudflare announced a fine-tuning service for Clef that starts as hands-on work with its engineers.
What a decision model does
A Clef request has two parts: a state describing the situation and a set of questions. Each question has a type. noul is true or false, choice picks from named options, and score picks from an ordered list. According to the Clef model card (opens in a new tab), the model reads the state as text, JSON, images or video and scores every allowed option of every question in a single forward pass. There is no free-form output to parse.
Cloudflare's announcement (opens in a new tab) places Clef against Typesafe's Jev System One model and says the Clef API is fully compatible with Jev's. Under the hood, a Qwen backbone does a prefill-only pass and a small schema head scores the options in parallel. Cloudflare froze the backbone and trained the head together with rank-256 low-rank adapters, using a Brier loss to tune probability calibration.
What is new in Clef
The two models differ in size and base:
- Clef is a 27B multimodal model post-trained from Qwen3.8-27B.
- Clef-flash is a 9B model post-trained from Qwen3.5-9B.
Cloudflare lists two differences from Jev. Clef has a vision encoder, while the post says Jev handles text only. The Workers AI documentation gives both models a 65,536-token context window; the blog compares 64k with Jev's 32k.
The benchmark results are Cloudflare's own runs of the Decision Index 0.2.1 suite, published in the model card and on a leaderboard site Cloudflare hosts. Clef leads Jev on BANKING77 (94.2 macro-F1 against 79.7) and CLINC150+OOS (97.4 against 89.3). Clef-flash scores 97.7 on a home appliance simulator task, where Jev scores 52.3. Jev comes out ahead on reasoning-heavy sets: GPQA Diamond (78.3 against Clef's 48.0), MMLU-Pro (82.7 against 65.9), BBH (92.9 against 73.7) and When2Call (81.0 against 72.4).
Latency is the larger gap. Across 43 benchmarks, Cloudflare measured median latency of 209.3 ms for Clef, 38.8 ms for Clef-flash and 524.1 ms for Jev. On Typesafe's four workflow evals, Clef beat Jev on invoice processing (64.7 against 61.8) and Jev led on agent trace observability (71.6 against 68.5).
Who Clef is for
Clef fits steps in an agent or backend where the answer set is fixed and a confidence score matters: triage, routing, moderation, or deciding whether to escalate to a person. Cloudflare's example is its Threat Intelligence team classifying website domains. Clef took 2.2 seconds to fetch, render and classify a site in that workflow, against 4.7 seconds for gpt-oss-120b, which returned two categories.
Teams that already force JSON out of a general model can compare the two approaches; our guide to structured outputs with JSON schema in the OpenAI and Claude APIs covers the LLM side. Cloudflare says it does not read, store or train on Clef requests or responses unless a customer opts into fine-tuning.
How to try Clef
On Workers AI the model IDs are @cf/cloudflare/clef and @cf/cloudflare/clef-flash. The documentation lists unit prices of $0.24 per million input tokens for Clef and $0.09 per million input tokens for Clef-flash. A request, based on Cloudflare's example:
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?" },
"severity": {
"type": "score",
"instructions": "How severe is the customer impact?",
"criteria": ["No impact", "Minor", "Major", "Critical"]
}
}
}'
To run the weights yourself, download Cloudflare/clef or Cloudflare/clef-flash (opens in a new tab) and import joint_schema_model.py from the repository. That file holds the loader and a systemone function that accepts Jev-style request bodies. Cloudflare tested the code with torch 2.11 and transformers 5.10.2 on a single H200. Before switching a production classifier, a side-by-side run on your own labeled cases with promptfoo shows whether the published scores hold for your data.
Limits and open questions
The RL service has no price and no self-serve date. For now Cloudflare offers fine-tuning through its forward-deployed engineering team, asks existing customers to register interest as design partners, and says a self-serve platform will follow. Its planned pipeline uses AI Gateway to collect data, Containers as a scoring sandbox and a new Trainer component, some of which the post calls work in progress.
Every benchmark comes from Cloudflare, including the Decision Index run and the leaderboard it hosts. No third-party evaluation is cited.
Local use means running Python code shipped in the model repository, so review it first. The card's encode_record helper defaults to 16,384 input tokens, below the 65,536-token window listed for the hosted models. The documentation lists only an input-token price, and the pages reviewed here say nothing on rate limits.
Frequently asked questions
How is Clef different from a regular classifier model?
A trained classifier usually needs retraining when the categories change. Clef takes the questions and allowed options in each request, so the same model can answer a new schema without retraining. It returns a probability for every option rather than a single label.
Can Clef read images?
Yes. Both Clef and Clef-flash keep the vision encoder of their Qwen base models, and the model card shows how to pass images or video frames alongside the state. Cloudflare says Jev handles text only.
Which model should I start with?
Cloudflare describes Clef as the more accurate option and Clef-flash as the choice for latency-critical decisions. In Cloudflare's runs, Clef-flash had a 38.8 ms median latency against 209.3 ms for Clef. It also costs $0.09 per million input tokens against $0.24 on Workers AI.
Sources
- 1.Introducing Clef: our open-source decision models, and new RL fine-tuning platform | Cloudflare BlogOfficial sitePrimaryblog.cloudflare.com
- 2.huggingface.co/Cloudflare/clefRepositoryPrimary
- 3.huggingface.co/Cloudflare/clef-flashRepositoryPrimary
- 4.developers.cloudflare.com/workers-ai/models/clefOfficial docsPrimary
Spotted an error? See our corrections policy.
Enjoyed this? Get the weekly brief.
New guides, Project & Tool of the Week and the AI developments that matter. One email, no spam.
Read next
- Weekly digest
The week on HuiaHub: sandboxed agents, RAG tooling and local models
41 new HuiaHub pages this week: sandboxing coding agents, RAG retrieval, local models on Macs and phones, Claude Haiku 5.5 and six how-to guides.
4 min read
ExplainerAgents & automationAI agents found in US bank accounts: what banks are blocking and why
See which banks are restricting AI agents in bank accounts, how read-only access differs from credential sharing, and which claims remain unverified.
10 min read
GuideCoding & dev toolsPHP critical security update CVE-2026-109618: Versions and patch steps
Check the PHP critical security update CVE-2026-109618, identify affected servers, install fixed PHP versions, and apply temporary settings if needed.
12 min read