Toolsiftly

Clef Model Request Builder (Cloudflare Workers AI)

Build a valid Cloudflare Clef decision-model request and copy it as curl, Workers or Python code.

Questions

The request is assembled in your browser. Nothing is sent to Cloudflare or to our servers, and no API key is needed.

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.

By the Toolsiftly editorial team · Updated

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

ClefClef-flashClef-omni
Size / backbone27B, post-trained from Qwen3.8-27B9B, from Qwen3.5-9BQwen3-Omni-30B-A3B-Instruct (mixture of experts)
InputsText, JSON, images, video framesText, JSON, images, video framesText, images, audio (wav, mp3), video (mp4, webm)
Hosted context window65,536 tokens24,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 forHighest-precision decisionsLatency-critical, hot-path decisionsDecisions 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

TypeUse it forWhat comes back
noulA yes/no question (optional descriptions for true and false)The probability that the answer is yes
choicePick one option from a set you define (option_id: description)The chosen option, a probability per option and a confidence value
scoreRate 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

  1. Pick clef or clef-flash and start from a preset or a blank request.
  2. Paste your state. If it is valid JSON and the box is ticked, it is sent as structured data.
  3. 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.
  4. Copy the curl, Workers or Python code and set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_AUTH_TOKEN in 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/clef with a bearer token. Both endpoints also work through AI Gateway.
  • Self-hosted: download Cloudflare/clef or Cloudflare/clef-flash from 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.

Facts checked against official documentation on . Official: Cloudflare blog, Cloudflare blog, Workers AI docs, Workers AI docs, Hugging Face.