Cloudflare Introduces Clef Decision Models and RL Fine-Tuning Platform
Cloudflare has introduced Clef and Clef-flash, open-source decision models designed for fast, structured AI decisions, alongside a new reinforcement learning service for fine-tuning Clef models for specific workloads.
Xcademia Team

Cloudflare Introduces Clef for Fast, Structured AI Decisions
Cloudflare has introduced Clef and Clef-flash, two company-trained decision models designed to produce bounded, structured outputs for workflows where AI needs to make a programmatic decision.
The models are hosted on Cloudflare Workers AI and are also being open-sourced on Hugging Face under the Apache 2.0 license.
Alongside the models, Cloudflare is introducing a new reinforcement learning service designed to help customers fine-tune Clef for specific workloads.
The announcement positions decision models as a different category from general-purpose large language models.
While LLMs are designed for open-ended reasoning, text generation, and tool use, Cloudflare describes decision models as models that can evaluate inputs and return structured choices with probabilities.
That makes them suitable for workflows where an AI system needs to determine what should happen next rather than generate a long-form response.
Cloudflare says Clef can be used for tasks such as support-ticket routing, urgency classification, security decisions, and other agentic workflows that require structured decisions.

What Is a Decision Model?
Cloudflare describes a decision model as a system that makes classifications to help agents determine how to act.
For example, a customer support message can be provided to the model with questions about urgency and the appropriate team.
The model can return typed outputs with probabilities.
Software can then use those outputs to:
Route a support ticket
Trigger an escalation
Select a workflow
Take an automated action
Defer a decision to a human
This creates a different role for AI inside an agentic system.
Instead of asking an LLM to generate a response and then interpreting that response, a decision model can provide structured results that software can consume directly.
Cloudflare says this can allow agents to gather context, make decisions, take actions, or defer to humans programmatically.
Cloudflare Uses Clef for Domain Classification
Cloudflare says its Threat Intelligence team has been testing Clef to classify website domains.
The workflow provides a domain to Clef using Browser Run, allowing the model to fetch and render the website before classifying it.
Cloudflare gives an example where a domain could receive probabilities such as:
95% fashion website
85% ecommerce
Less than 1% phishing
Cloudflare says the Clef workflow took 2.2 seconds to fetch, render, and classify the website.
For comparison, Cloudflare says its fastest general LLM in the same workflow, gpt-oss-120b, took 4.7 seconds and returned only two classifications.
These are Cloudflare's own test results and should not be interpreted as an independent benchmark.
The company says the lower latency and multiple classifications could help its threat intelligence workflows identify malicious or legitimate domains more quickly.
The broader use case extends beyond threat intelligence.
Any workflow that requires rapid programmatic decisions could potentially use a decision model as part of an agentic system.
Clef Adds Vision and a 64K Context Window
Cloudflare says Clef has several characteristics that distinguish it from other decision models.
First, the model includes a vision encoder, allowing it to process images and classify visual content.
Cloudflare contrasts this with Jev, which the company describes as supporting text classification today.
Second, Clef has a 64K context window, compared with the 32K context window Cloudflare attributes to Jev.
Cloudflare says the larger context window allows users to provide more input state for classification.
The company also reports competitive results across multiple decision-making benchmarks.
Cloudflare's Published Benchmark Results
Cloudflare evaluated Clef, Clef-flash, Jev, DiffusionGemma Jev, Kev 9B, and Laya across several benchmarks.
The results below reproduce the figures provided in Cloudflare's announcement.
Benchmark | Clef | Clef-flash | Jev | DiffusionGemma Jev | Kev 9B | Laya |
|---|---|---|---|---|---|---|
BFCL - case exact | 98.47 | 98.76 | 95.75 | 96.52 | 94.51 | 38.13 |
ToolRet - nDCG@10 | 69.19 | 66.43 | 65.28 | 61.21 | 64.26 | 12.69 |
API-Bank - accuracy | 91.93 | 93.11 | 88.19 | 83.66 | 56.30 | 11.41 |
Home appliances - case exact | 82.95 | 97.73 | 52.27 | 42.05 | 25.00 | 0.00 |
When2Call - accuracy | 72.37 | 65.58 | 80.97 | 75.44 | 49.62 | 11.94 |
BANKING77 - macro-F1 | 94.20 | 90.93 | 79.74 | 74.28 | 84.83 | 14.29 |
CLINC150+OOS - macro-F1 | 97.43 | 66.77 | 89.27 | 83.49 | 79.03 | 3.19 |
BRIGHT - nDCG@10 | 45.91 | 39.26 | 47.52 | 42.94 | 38.53 | 19.90 |
Amazon ESCI - macro-F1 | 57.48 | 57.39 | 55.21 | 53.37 | 49.22 | 24.40 |
PhishNChips - accuracy | 79.60 | 75.05 | 62.55 | 85.35 | 50.75 | 50.15 |
These results are based on Cloudflare's published evaluation and are not an independent assessment.
Clef Performs Across Workflow Evaluations
Cloudflare also evaluated its models using Typesafe's workflow evaluation suite.
The company says Clef models beat Jev in 3 of 4 workflow areas it evaluated.
The published results were:
Workflow | Clef | Clef-flash | Jev |
|---|---|---|---|
Invoice processing | 64.7 | 57.1 | 61.8 |
Customer service | 76.3 | 77.0 | 76.0 |
Security incidents | 62.9 | 61.7 | 61.7 |
Agent trace observability | 68.5 | 69.8 | 71.6 |
Cloudflare says the results are part of its evaluation of decision models for workflow-oriented tasks.
Latency Is a Core Part of Clef's Design
Cloudflare's announcement places significant emphasis on latency.
Across the 43 evaluation benchmarks it ran, Cloudflare says its Clef models beat the other decision models on latency, with the exception of Laya, which the company says is faster while making a quality tradeoff in the benchmarks above.
Cloudflare reported the following latency results:
Model | Median latency - ms | p95 latency - ms |
|---|---|---|
Clef | 209.3 | 238.6 |
Clef-flash | 38.8 | 122.4 |
Jev | 524.1 | 536.0 |
DiffusionGemma Jev | 84.4 | 211.2 |
Kev-9B | 51.4 | 187.9 |
Laya | 5.8 | 222.5 |
Cloudflare says the Workers AI deployment can further reduce network latency because the models run on its infrastructure and can use GPUs at the edge.
The company describes a possible architecture where Clef handles the decision step while another LLM handles subsequent action.
For example:
Clef → Decide → LLM → Act
This allows a decision model to operate in what Cloudflare calls the "hot path" of an agent workflow.

Open Source Models and API Compatibility
Cloudflare says Clef and Clef-flash are fully API-compatible with Jev.
The company says this allows developers to experiment with the models without changing the overall decision-model approach.
Cloudflare is also open-sourcing the models on Hugging Face under an Apache 2.0 license.
The company describes the larger Clef model as its more powerful precision model and Clef-flash as the option designed for latency-sensitive decisions.
Cloudflare also states that it does not read, store, or train on customer requests or responses, unless customers choose to use its fine-tuning product.
The models can be accessed through Workers AI, while the open-source model weights are available on Hugging Face.
Example: Calling Clef Through the Workers AI API
Cloudflare provides the following example showing how Clef can classify a customer support request.
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"]
}
}
}'The example illustrates the basic decision-model pattern.
The application supplies a state and defines structured questions. Clef then produces outputs constrained by those schemas rather than generating a conventional free-form response.
This structure is important because the results can be consumed directly by application logic.
How Cloudflare Trained Clef
Cloudflare says Clef builds on earlier experiments involving decision models and the DiffusionGemma model.
The company previously experimented with exposing log probabilities generated by a large language model to produce deterministic probability outputs.
For Clef, Cloudflare uses Qwen as the base model and post-trains it for decision-model use cases.
During inference, Cloudflare says Clef uses Qwen for a prefill-only pass and then scores valid schema choices in parallel.
The decision step is non-autoregressive.
Instead of generating intermediate text token by token, Clef and Clef-flash derive schema choices directly from internal representations of the backbone model.
Cloudflare describes the architecture as using a specialized two-stage attention routing process.
The process includes:
Option-specific evidence routing
Joint cross-field attention
Schema-bound scoring
Lexical priors to preserve semantic intent across options
Cloudflare says the approach allows valid choices to be scored directly instead of generating intermediate text.
Post-Training and RLCD
Cloudflare says it froze Qwen3.8-27B for Clef and Qwen3.5-9B for Clef-flash.
The models were jointly optimized using a routing head and rank-256 low-rank adapters.
The post-training process uses:
Label-smoothed cross-entropy for valid schema outputs
Brier loss for probability calibration
Synthetic datasets generated by varying field orders, prompts, and schema structures
Cloudflare also developed Reinforcement Learning for Calibrated Decisions, or RLCD.
According to Cloudflare, RLCD provides partial credit to adjacent ordinal choices, rewards fully precise record outputs, and applies a reference penalty to reduce distribution shift.
The company says this approach helped improve accuracy and generalization.
Cloudflare identifies three resulting goals for Clef:
Improve classification accuracy
Constrain outputs to probabilities rather than text generation
Reduce decision latency compared with autoregressive LLMs and the underlying Qwen models
These are Cloudflare's reported design outcomes.
Why Cloudflare Wants Fine-Tuning for Clef
Cloudflare says its internal teams have identified several use cases where a general decision model could be fine-tuned for more specialized requirements.
Examples mentioned in the announcement include:
Trust & Safety submissions
Cloudflare Support request triage
Bot classification
Determining whether a crawler is a good bot or bad bot
The company says these workloads can benefit from domain-specific labeled decisions.
Cloudflare also says that fine-tuning can involve a tradeoff: a model may give up some general-purpose performance in exchange for higher accuracy within a specific domain.
The company says it has more than 15 years of network data across different domains, which it can use internally for specialized model development.
The announcement says Cloudflare is already working with internal teams to post-train Clef for specific use cases.
Cloudflare Launches a New RL Fine-Tuning Service
Cloudflare is also introducing a new reinforcement learning service around Clef.
Initially, customers can work directly with Cloudflare's forward-deployed engineering team to fine-tune the model for their workloads.
Cloudflare says the experience will inform the development of a future self-service platform.
The planned workflow is designed to allow customers to:
Capture data → Fine-tune Clef → Redeploy the model
Cloudflare says the eventual platform will allow these steps to take place on its infrastructure.
The company is positioning this service around workloads where a generic model may not provide enough domain-specific accuracy.

The RL Platform Uses Cloudflare's Existing AI Infrastructure
Cloudflare says the new service combines several components of its AI platform.
The architecture includes:
Cloudflare AI Gateway
Cloudflare says AI Gateway can route AI traffic and automatically create datasets of requests for a specific use case.
Cloudflare Workers AI
Workers AI is used to generate rollouts against the base Clef model.
Cloudflare Containers
Containers provide the reinforcement learning sandbox used to score and replay agent actions.
Trainer
Cloudflare identifies Trainer as a new component used to update the weights of the fine-tuned Clef model.
Workers AI + BYO Model
The fine-tuned model can then be redeployed on Workers AI using Cloudflare's Bring Your Own Model capability.
Cloudflare says this work combines several components that are still under development across its AI platform.
What Clef Could Mean for Agentic AI Workflows
The announcement highlights a broader shift toward using specialized models for individual stages of an AI workflow rather than relying on one general-purpose model for every task.
A general LLM can remain responsible for reasoning, generation, and tool use, while a smaller decision model can handle specific classification or routing steps.
That architecture could be useful when a workflow needs predictable structured outputs and fast decisions.
For enterprises, this could mean designing agent systems as collections of specialized model calls rather than treating a single LLM as the entire decision layer.
Cloudflare's own examples focus on support routing, threat intelligence, Trust & Safety, and bot classification.
The company is also using Clef internally while building its customer fine-tuning offering.
These examples are based on Cloudflare's announcement and do not establish performance for other workloads.
Availability and How to Try Clef
Cloudflare says Clef and Clef-flash are available through Workers AI.
The company has also released the model weights on Hugging Face under an Apache 2.0 license.
Developers can explore the models through Cloudflare's Workers AI documentation or run the open-source models themselves.
Cloudflare is also accepting customers interested in fine-tuning workloads through its initial hands-on service.
Additional details about the eventual self-service RL platform were not disclosed in the announcement.
Conclusion
Cloudflare's Clef announcement introduces a different approach to AI-powered agent workflows: use a specialized decision model when the task requires fast, structured, probability-based decisions, while leaving broader reasoning and generation to general-purpose LLMs.
Clef and Clef-flash are designed around that role.
Cloudflare is making the models available through Workers AI and open-sourcing them under Apache 2.0. The company is also introducing a reinforcement learning service that can help customers adapt Clef to specialized workloads.
The technical approach combines a Qwen-based backbone, schema-bound scoring, specialized attention routing, probability calibration, and reinforcement learning techniques developed by Cloudflare.
The broader significance is architectural.
Instead of asking one model to perform every part of an agent workflow, developers can use specialized models for specific decisions and connect them with larger models for reasoning and action.
Cloudflare is now extending that idea beyond a generic decision model by adding domain-specific fine-tuning.
The company says the initial RL offering will be delivered through a hands-on engineering service, with a self-service platform planned as the work develops.
Additional details about the timing and final capabilities of that self-service platform were not disclosed in the announcement.
Source: Cloudflare Blog
About the Author