
Cloudflare Clef turns application state and a set of typed questions into decisions with probabilities. A support queue can ask which department should receive a ticket without asking a chat model to write a paragraph and then parsing the answer. The application still decides what actions those classifications permit.
Cloudflare introduced Clef and Clef-flash on October 1, 2026. This guide reviews their official model cards and Workers AI documentation as of October 3. It explains a documented integration and an evaluation plan; no authenticated classification run or independent speed benchmark is claimed.
The Clef model card identifies Qwen3.8-27B as its backbone. The Clef-flash card identifies Qwen3.5-9B. Both releases include a schema head that scores allowed answers rather than generating free-form text.
Cloudflare's release explanation describes post-training Qwen for this role. Clef evaluates the input and scores schema choices without an intermediate answer generated token by token. This makes it a distinct interface from prompting a general Qwen chat model to return JSON.
The model cards describe compatibility with Jev and SystemOne and publish the releases under Apache-2.0. For a local deployment, use the release's loader, schema head, and processor instructions together. Downloading the backbone alone does not recreate the documented decision interface. Our Qwen3.8-27B directory entry provides context on the underlying model.
The two hosted entries share a decision-oriented contract but have different sizes and listed prices.
| Documented property | Clef | Clef-flash |
|---|---|---|
| Workers AI identifier | @cf/cloudflare/clef | @cf/cloudflare/clef-flash |
| Request model selector | clef | clef-flash |
| Model size | 27B | 9B |
| Hosted context window | 65,536 tokens | 65,536 tokens |
| Listed price per million input tokens | $0.24 | $0.09 |
These are the Clef and Clef-flash catalog values checked on October 3, 2026. They describe input-token pricing. Do not add a chat-model output-token rate to this table or assume either entry guarantees a particular application latency.
For a queue handling many short tickets, compare the smaller model first against your labeled examples. Escalate difficult cases to a different route only when that improves measured outcomes. Model size and provider positioning do not tell you which classifier will handle your company's ambiguous tickets correctly.
The API uses state for the content to evaluate and questions for a map of typed questions. The supported question types are noul for true/false decisions, choice for named options, and score for ordered options. Use stable question and option IDs so your application can interpret responses without depending on display wording.
Here is an illustrative request body for a support ticket. Its fields follow the official hosted schema; it is not a recorded request or response.
{
"model": "clef-flash",
"state": "The invoice total appears wrong; payment succeeded.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should review this ticket?",
"criteria": {
"billing": "Invoice amounts, payment records and refunds",
"technical": "Application errors and configuration",
"review": "Unclear or outside the available categories"
}
},
"urgent": {
"type": "noul",
"instructions": "Does the ticket describe a current service outage?"
}
}
}
Submit that body to the documented Workers AI REST route for @cf/cloudflare/clef-flash, or pass it to env.AI.run with the same identifier in a Worker that has an AI binding. Configure the account and authentication through the Workers AI REST quickstart. Keep both the route identifier and the body selector aligned when switching variants.
Read the returned answers by question ID. Validate the response against the published output schema before routing a ticket. A probability is evidence for a classification, not permission to issue a refund, delete records, or execute an arbitrary tool.
The hosted schema accepts between one and 64 questions. It also documents up to four embedded PNG, JPEG, or WebP images, with per-image and total decoded-size limits. Remote image URLs are not accepted. Its current limits include 4 MiB and 16 megapixels per image, 8 MiB total decoded image data, and a 13 MiB request body.
The model cards also describe local video-frame inputs. That does not establish an equivalent video parameter in the hosted request schema. Follow the interface you are actually calling, especially when porting a local example to Workers AI.
The hosted documentation says long text state is truncated to fit the model limit. Place relevant ticket facts in the state deliberately and test long inputs for lost context. A syntactically successful response can still classify an incomplete record.
Build a labeled set from the decisions your queue actually needs. Include short tickets, multiple issues in one message, unfamiliar wording, empty content, and cases that should enter manual review. Keep a separate test set while adjusting instructions and category descriptions.
Track accuracy per department, urgent-case misses, unnecessary escalations, and the proportion sent for review. Inspect confidence calibration as well: cases receiving similar probabilities should have reasonably similar observed outcomes. Choose thresholds from these results and the cost of mistakes, rather than assuming that 0.9 always means a safe action.
Cloudflare publishes its own benchmark results in the announcement. Those results motivate a pilot; they do not establish performance on your support taxonomy. Compare the complete routing workflow, including preprocessing, network time, validation, and fallback handling.
It serves typed decisions. Keep a generative model for drafting replies or explanations when those outputs are required. The classifier and the writing step can have separate acceptance checks.
The interface accepts question schemas with named choices. Test any changed category definitions on representative records; schema flexibility does not guarantee accuracy for a new domain.
Do not transfer limits automatically between deployments. Follow the local loader and encoding settings in the model card, and the catalog limits for Workers AI.
Start with a small schema and a labeled queue sample. Validate answers, choose review thresholds from observed mistakes, and measure the cost of accepted classifications. Add automated actions only after the surrounding application has clear rules for them.