Clef is Cloudflare’s open-weight decision model (27B, Apache-2.0) on Workers AI. Build a valid Clef or Clef-flash request in your browser and copy it as curl, Workers or Python — plus prices, limits and Clef vs Jev.
What is the Clef model?
Clef is Cloudflare’s family of open-weight “decision models”, launched on October 1, 2026. Instead of writing text, a Clef model reads a state (text, JSON or images) plus a set of typed questions and returns a probability for every allowed answer in a single forward pass, so your code gets a structured decision it can act on: route a ticket, block a request or escalate to a human. The weights are released under Apache-2.0 on Hugging Face, and the models are hosted on Workers AI as @cf/cloudflare/clef and @cf/cloudflare/clef-flash. The API follows System One and is compatible with Typesafe’s Jev, so an existing Jev integration can switch by changing the endpoint and model.
Clef, Clef-flash and Clef-omni compared
| Clef | Clef-flash | Clef-omni | |
|---|---|---|---|
| Size / backbone | 27B, post-trained from Qwen3.8-27B | 9B, from Qwen3.5-9B | Qwen3-Omni-30B-A3B-Instruct (mixture of experts) |
| Inputs | Text, JSON, images, video frames | Text, JSON, images, video frames | Text, images, audio (wav, mp3), video (mp4, webm) |
| Hosted context window | 65,536 tokens | 24,576 tokens (cut from 64K on Oct 9, 2026; the open weights support 256K self-hosted) | See the Clef-omni model page |
| Workers AI price (checked Oct 13, 2026) | $0.24 per million input tokens | $0.038 per million input tokens (was $0.09) | $0.15 per million input tokens |
| Best for | Highest-precision decisions | Latency-critical, hot-path decisions | Decisions over audio and video in one call |
Clef models don’t charge for output tokens. Images are converted to input tokens: each 32 × 32-pixel block is one token, with a cap of 1,024 tokens per image.
The three question types
| Type | Use it for | What comes back |
|---|---|---|
noul | A yes/no question (optional descriptions for true and false) | The probability that the answer is yes |
choice | Pick one option from a set you define (option_id: description) | The chosen option, a probability per option and a confidence value |
score | Rate against an ordered rubric (level 0 = lowest) | A probability-weighted score and a probability per level |
One request can ask 1 to 64 questions. Question ids may use letters, digits, _, . and - (up to 100 characters), and answers come back under the same ids. On Workers AI you can add up to 4 embedded PNG, JPEG or WebP images (4 MiB each, 8 MiB total decoded); remote image URLs are not accepted, and the whole request body is limited to 13 MiB.
How to use this Clef request builder
- Pick clef or clef-flash and start from a preset or a blank request.
- Paste your state. If it is valid JSON and the box is ticked, it is sent as structured data.
- Add your questions. The builder checks the documented limits (1–64 questions, valid unique ids, at least two options or rubric levels) and warns when the state is probably longer than the model’s context.
- Copy the curl, Workers or Python code and set
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_AUTH_TOKENin your environment. Nothing you type here is sent anywhere — the builder runs in your browser and never calls the API.
Ways to run Clef
- Workers AI binding:
env.AI.run("@cf/cloudflare/clef", {...})inside a Worker. - REST API:
POST https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/run/@cf/cloudflare/clefwith a bearer token. Both endpoints also work through AI Gateway. - Self-hosted: download
Cloudflare/cleforCloudflare/clef-flashfrom Hugging Face. The model card tested it with torch 2.11 and transformers 5.10.2 on a single H200, and SGLang serves it in BF16 on one H200, B200 or B300 at/v1/systemone.
Clef vs Jev: what Cloudflare reports
In Cloudflare’s launch benchmarks, a Clef model scored highest on 7 of 10 decision benchmarks. Examples: BANKING77 macro-F1 94.20 (Clef) vs 79.74 (Jev), and CLINC150+OOS 97.43 vs 89.27. Median latency was 209.3 ms for Clef and 38.8 ms for Clef-flash, against 524.1 ms for Jev. Jev still led on some tests, such as When2Call (80.97 vs 72.37 for Clef). After serving changes on October 9, 2026, Cloudflare reported Clef’s median latency at about 152 ms for an ~800-token input. These are the vendor’s own numbers, so test on your own data before you rely on them.
When a decision model is the right tool
Use Clef when you need a bounded answer fast and cheaply: support triage, spam and phishing checks, policy scoring, “should the agent take this action?” guardrails, or classifying a screenshot. It is not a chat model: it can’t write replies or explain its reasoning, so pair it with an LLM when the next step needs generated text. Cloudflare also offers fine-tuning for Clef, starting as a hands-on service with its forward-deployed engineers.
Frequently asked questions
What is the Clef model?
Clef is Cloudflare’s open-weight decision model, launched October 1, 2026. It reads a state (text, JSON or images) plus typed questions and returns a probability for every allowed answer in a single pass, instead of generating text. It runs on Workers AI as @cf/cloudflare/clef.
Is Clef open source?
Yes. Cloudflare released the Clef and Clef-flash weights under the Apache-2.0 license on Hugging Face (Cloudflare/clef and Cloudflare/clef-flash). Clef is post-trained from Qwen3.8-27B; Clef-flash from Qwen3.5-9B.
How much does Clef cost on Workers AI?
As of October 13, 2026: Clef $0.24 per million input tokens, Clef-flash $0.038 per million (cut from $0.09 on October 9) and Clef-omni $0.15 per million. Clef models don’t charge for output tokens; images are billed as input tokens.
What is the difference between Clef and Clef-flash?
Clef (27B) is the higher-precision model with a 65,536-token hosted context. Clef-flash (9B) is faster and cheaper for hot-path decisions, but its hosted context is 24,576 tokens. Cloudflare reported median latency of 209.3 ms for Clef and 38.8 ms for Clef-flash at launch.
Is Clef compatible with Jev?
Yes. Clef follows the System One API used by Typesafe’s Jev, so you can switch an existing Jev integration by changing the endpoint and model. Clef also accepts images, which Jev does not.
Can I run Clef locally?
Yes. Download Cloudflare/clef from Hugging Face. The model card was tested with torch 2.11 and transformers 5.10.2 on a single H200, and SGLang can serve it in BF16 on one H200, B200 or B300 at /v1/systemone.
Does this Clef request builder call the API?
No. It only assembles and validates the request in your browser and gives you curl, Workers or Python code. You run that code with your own Cloudflare account ID and API token.