Cloudflare Clef

Cloudflare Clef: What the Decision Model Does and What People Build With It

Updated Oct 23 · 5 min read

On this page
Browse every Cloudflare Clef build, repo and video

Cloudflare Clef is a pair of open-weight "decision models", Clef and the smaller Clef-flash, that take a situation plus a set of typed questions and return a probability for every allowed answer instead of writing text. Cloudflare released them on 1 October 2026 on Workers AI, with weights on Hugging Face under Apache 2.0. People mostly use them for routing, triage and fast yes/no checks inside agents.

What Clef is

In the launch post, Cloudflare describes a decision model as one that "produces bounded structured outputs cheaply, quickly and consistently" for the moment a workflow needs a decision. You pass a customer message and ask whether it is urgent and which team should own it. You get back typed answers with probabilities, and your code routes, escalates or hands off to a human.

Clef is Cloudflare's answer to Typesafe AI's Jev, which started the category a few weeks earlier. Cloudflare says Clef is "fully Jev-API compatible," so requests written for Jev's System One API should work with it. The model card lists three question types: noul (true/false), choice (named options) and score (ordered options).

Under the hood, per the post and model card:

  • Clef is a 27B multimodal model post-trained from Qwen3.8-27B. Clef-flash is a 9B model built on Qwen3.5-9B.
  • The backbone is frozen, and a small joint schema head plus rank-256 low-rank adapters were trained on top.
  • Decisions are non-autoregressive. The model does one prefill pass and scores every valid option in parallel, with no generated text to parse.
  • It has a vision encoder, so the state can include images or video. Cloudflare notes Jev is text-only.

Cloudflare's own example is its Threat Intelligence team, which paired Clef with Browser Run to classify website domains. The post says that took 2.2 seconds to fetch, render and classify a site, against 4.7 seconds for gpt-oss-120b in the same workflow.

Release date, access and pricing

  • Released: 1 October 2026.
  • Hosted: on Workers AI as @cf/cloudflare/clef and @cf/cloudflare/clef-flash.
  • Open weights: on Hugging Face under the Apache 2.0 license. Cloudflare says it does not read, store or train on hosted requests unless you opt into fine-tuning.
  • Price: the Workers AI Clef model page lists $0.24 per million input tokens, and the Clef-flash page lists $0.038. Neither model charges for output tokens. Images are converted to input tokens, capped at 1,024 tokens each.
  • Context window: 65,536 tokens for Clef and 24,576 for Clef-flash, per the docs.
  • Fine-tuning: a reinforcement learning service run by Cloudflare's forward-deployed engineers, with a self-serve platform promised later. No price is published.

How to start using Clef

On Workers AI. From a Worker, call env.AI.run("@cf/cloudflare/clef", {...}). Over REST, POST to https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/cloudflare/clef with a bearer token. The body needs three things:

  1. model: "clef" or "clef-flash".
  2. state: a string or JSON describing the situation, such as "Checkout has been failing for every customer for the last hour."
  3. questions: 1 to 64 questions keyed by ID, each with a type, optional instructions, and criteria for choice and score questions.

You can also add up to four embedded PNG, JPEG or WebP images. The docs say remote image URLs are not accepted. Answers come back under the same IDs: a probability for noul, the chosen option with per-option probabilities for choice, and a probability-weighted score for score.

Locally. The model card says it was tested with torch 2.11 and transformers 5.10.2 on a single H200. You download the repo with snapshot_download("Cloudflare/clef"), import its joint_schema_model.py, and call load_release_model. There is also an SGLang Docker image that serves the Jev-style endpoint at /v1/systemone. For smaller hardware, Clef-flash is the realistic option.

Pick the model. Cloudflare positions Clef as the precision model and Clef-flash for latency-critical calls. Its own table reports median latency of 209.3 ms for Clef and 38.8 ms for Clef-flash, against 524.1 ms for Jev.

What people build with Clef

The Cloudflare Clef page shows a split: a handful of real tools and a lot of explainer videos.

Request routing. ry sits on 404 pages: when a URL fails, Clef reads the request and picks the most likely real destination, turning dead links into redirects. It is a good example of a decision model in the hot path of a web request.

Vision on a live feed. clef-webcam runs Clef-flash locally on a webcam stream and answers typed questions about each frame. It was the most-starred community build of its week on the site.

Judges inside agents. s1 is a voice-first macOS agent that reads the screen through Accessibility, clicks and types, and can use a local Clef-flash judge to check its steps. clef-evals uses Clef as a cheap grader and audits whether its confidence numbers are actually calibrated.

Testing the claims. Several creators ran their own checks, including Better Stack's test against Jev, a Clef-flash run that scored 29 of 30 with one confident miss, a support ticket triage walkthrough, and a video on where Clef trails Jev.

Limits and caveats

  • Benchmarks are Cloudflare's own. The post says Clef leads the Jev Decision Index, but its tables show Clef behind in places. On the model card, Jev beats Clef on When2Call (81.0 vs 72.4), GPQA Diamond (78.3 vs 48.0), MMLU-Pro and BBH, and leads one of four Typesafe workflow evals.
  • Clef-flash trades accuracy for speed. On CLINC150+OOS it scores 66.8 against Clef's 97.4, and its context window is much smaller.
  • It only decides. Clef returns probabilities over options you define. It does not write text, so you still need an LLM to act on the decision.
  • Local use needs serious hardware for the 27B model, per the H200 test setup.
  • Skepticism on Hacker News. The launch thread drew 642 points and 218 comments. Several commenters argued decision models are a rebrand of older discriminative classifiers, and one said many "better than Jev" models turn out narrow on non-trivial tasks.
  • Fine-tuning is early. The RL product starts as a hands-on service, and pricing is not disclosed.

Frequently asked questions

When was Cloudflare Clef released?

Cloudflare announced Clef and Clef-flash on 1 October 2026, hosted on Workers AI with open weights on Hugging Face.

How much does Cloudflare Clef cost?

On Workers AI, Clef is $0.24 per million input tokens and Clef-flash is $0.038, with no charge for output tokens. The weights are free under Apache 2.0 if you host them yourself.

What is the difference between Clef and Clef-flash?

Clef is the 27B precision model with a 65,536-token context. Clef-flash is a 9B model with a 24,576-token context, built for low latency, with lower scores on some benchmarks.

Is Clef compatible with Jev?

Cloudflare says it is fully Jev-API compatible, and the model card says the same of the System One API, so you can swap the endpoint and keep the request format.

Can Clef read images?

Yes. It has a vision encoder, and the Workers AI API accepts up to four embedded images per request. Remote image URLs are not accepted.

Browse every Cloudflare Clef build, repo and video

The Monday email

  • The week's best AI builds and who made them
  • New model releases and what people built with them
  • No spam. One click to leave.

Sign in once and you're on the list.