How Much To Run AI
Open weights

Cloudflare Clef: Decision Model Cost, Benchmarks and Setup

Clef is Cloudflare Workers AI’s 27B multimodal decision model, with Clef-flash as a 9B low-latency variant. Instead of generating free-form text, both take a state plus typed questions and return probabilities for the allowed answers in one forward pass. Cloudflare hosts them on Workers AI and publishes both sets of weights under Apache 2.0. Clef-omni adds audio and video inputs on a 30B mixture-of-experts backbone at $0.15 per million input tokens. This guide separates hosted token cost from self-hosting cost, compares the two variants with Jev, and shows what to measure before placing a decision model in an agent hot path.

Content reviewed:

Use this model

API docs and console

Official model repository

What should Clef decide?

  • Support triage: classify a ticket into billing, technical or sales, score severity, and independently estimate whether the case is urgent.
  • Agent routing and guardrails: choose a tool, model or escalation path from a bounded set of allowed actions without parsing a generated paragraph.
  • Trust and safety: score or classify supplied text, JSON or visual evidence, then let application policy decide what threshold triggers a block or human review.
  • Visual classification: attach images and ask typed questions about the supplied evidence. The hosted API accepts up to four images in one request.

Clef-omni: audio, video and media input cost

Clef-omni is a separate multimodal decision model on a 30B mixture-of-experts backbone with 3B active parameters. Its Workers AI ID is @cf/cloudflare/clef-omni; the request body uses model: clef-omni with the same state and typed-question pattern. Cloudflare lists a 64,000-token context window and $0.15 per million input tokens. Output tokens are not charged.

Images are resized while preserving aspect ratio, rounded to 32-pixel multiples and counted as 32×32 patches plus three marker tokens. Cloudflare caps each image at 1,024 tokens. Audio uses about 780 tokens per minute. Video uses up to about 15,400 frame tokens per minute at maximum resolution, plus about 780 audio tokens per minute for sound; 480p is about 8,600 frame tokens per minute.

At $0.15 per million input tokens, one minute of audio contributes about $0.000117, while a minute of maximum-resolution video with sound contributes about $0.002427. A one-minute 480p clip with sound contributes about $0.001407. These examples count media only; add the text state, questions and repeated checks to the full input bill.

A request accepts up to four audio clips and two videos. Media and questions share the context window; exceeding it causes the request to fail. Otherwise the text state is truncated to fit remaining space. For long clips, shorten or split the evidence and verify that the decisive part of the state survives.

Media inputApproximate tokensMedia-only USD cost
One minute audio780$0.000117
One minute 480p video with sound9,380$0.001407
One minute maximum-resolution video with sound16,180$0.002427
Image at 1,024-token cap1,024$0.0001536

How Clef returns typed decisions

Cloudflare launched Clef and Clef-flash on October 1, 2026 as the first models trained by the Workers AI team. A request contains a state and one to 64 typed questions. Each question is Noul (yes/no), Choice or Score. The response contains probabilities over the permitted answers; there is no free-form completion to parse.

This makes Clef useful when the application already knows the allowed actions. A decision model can route, rank, block or escalate. It is not a substitute for a generative model when the output itself must be an explanation, report, plan or code change.

Clef uses the Jev/System One typed-decision format. Existing question definitions provide a starting point for migration; evaluate confidence thresholds on labeled cases for the model you choose.

Clef vs Clef-flash: precision model or hot-path model?

Clef is a 27B multimodal post-train of Qwen3.8-27B. Clef-flash is a 9B multimodal post-train of Qwen3.5-9B. Both add a joint schema head that scores the allowed answers together and both expose the same typed-decision contract.

Cloudflare describes the larger Clef as the precision model and Clef-flash as the latency-critical option. The published benchmark table is not a clean “bigger always wins” ranking: Clef-flash is higher on BFCL, API-Bank and the home-appliance simulator, while Clef is much higher on BANKING77 and CLINC150+OOS. Independent tests also show task-dependent gaps: Nicia’s admission workflow found Clef-flash over-escalated routine cases, while a Japanese support-triage test found Flash missed one multi-intent signal that Clef caught. Pick the variant on labeled cases rather than parameter count alone.

VariantBackboneHosted contextWorkers AI input priceCloudflare median latency
ClefQwen3.8-27B65,536 tokens$0.24 / 1M209.3 ms
Clef-flashQwen3.5-9B24,576 tokens$0.038 / 1M38.8 ms

Run Clef on Workers AI

The hosted model IDs are @cf/cloudflare/clef and @cf/cloudflare/clef-flash. The listed input rates are $0.24 for Clef and $0.038 for Clef-flash per million input tokens. Cloudflare publishes no separate generated-output rate for these decision responses.

At 100,000 requests averaging 1,000 input tokens, the input volume is 100 million tokens: about $24 for Clef or $3.80 for Clef-flash before any account allowance, application infrastructure, retries or human review. At Jev 1.13’s $0.042 per million input tokens, the same volume costs $4.20. Compare those fees alongside quality and latency on the same task.

The hosted API accepts one to 64 questions and up to four embedded PNG, JPEG or WebP images. Each image must fit within 4 MiB and 16 megapixels; decoded images together must fit within 8 MiB, and the complete request body within 13 MiB. Resize or compress before embedding when needed. Remote image URLs are not accepted.

Cloudflare says requests and responses are not read, stored or used for training unless the customer opts into the fine-tuning product.

Cloudflare documents 65,536 tokens for hosted Clef and 24,576 for Clef-flash. Media and questions use that budget before text state; over-budget media/questions fail, and its API schema says long text state is truncated to fit the token limit. Independent reports from October 3–4 observed silent truncation near 2,048 state tokens; they do not establish how the current endpoint handles long state. Before sending long logs or documents, test whether the endpoint uses evidence placed near the end of your input.

Clef reads state and typed questions, returns probabilities, and leaves routing or review thresholds to the application.
The model scores the allowed answers. Application thresholds determine which action follows.
Workers AI request with three typed decisions
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/cloudflare/clef-flash \
  -H "Authorization: Bearer $CLOUDFLARE_AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "clef-flash",
    "state": "Checkout has failed for every customer for the last hour.",
    "questions": {
      "urgent": {"type": "noul", "instructions": "Is this urgent?"},
      "team": {
        "type": "choice",
        "instructions": "Which team should handle this request?",
        "criteria": {
          "billing": "Payments and invoices",
          "technical": "Errors and outages",
          "sales": "Plans and upgrades"
        }
      },
      "severity": {
        "type": "score",
        "instructions": "How severe is the customer impact?",
        "criteria": ["No impact", "Minor", "Major", "Critical"]
      }
    }
  }'

Clef latency: publisher benchmark and public REST tests

Cloudflare’s launch table reports median latency of 38.8 ms for Clef-flash and 209.3 ms for Clef, versus 524.1 ms for Jev. On October 4, Nicia reran 85 synthetic admission cases over public REST from one US west-coast laptop. With one request at a time, Clef-flash measured 229–281 ms p50, Clef 628–668 ms and Jev 92–94 ms. Akari Iku’s 15-request support-triage experiment from Japan measured medians of 166 ms for Flash and 406 ms for Clef.

Early runs also saw long tails. Nicia saw 9–26 second Clef tails under six-way concurrency. In an October 3 run, rmax-ai recorded roughly 18.6-second medians and attributed them to scale-from-zero queueing. Nicia’s later rerun reduced its tails, showing how service conditions changed between the two measurements.

These measurements cover different paths. The publisher table does not specify enough timing detail to equate it with a public REST round trip; Nicia did not measure the Workers AI binding. Measure the endpoint from the region and runtime that will call it, including queueing and network transit.

Source / pathClef-flashClefJev
Cloudflare launch benchmark38.8 ms median209.3 ms median524.1 ms median
Nicia, public REST, 2026-10-04229–281 ms p50628–668 ms p5092–94 ms p50
Akari, Japan public REST166 ms median406 ms median—
Flavio Copes, Italy public REST191–205 ms median524–726 ms median—

Migrating Jev questions and thresholds to Clef

Independent harness rmax-ai found that the System One shape is close enough to compare the services directly, but the wire contract still has traps. Workers AI uses the question type noul where some Vercel Gateway Jev integrations use boolean; Workers AI requires instructions on every question, wraps the response differently, and expects the Clef model name in the request body.

Nicia reused thresholds of 0.5 and 0.2 tuned on Jev; Clef-flash escalated more routine cases without model-specific tuning. Preserve labeled examples, inspect the new confidence distribution and select thresholds using the cost of false positives and false negatives.

Question representation can matter too. In rmax-ai’s test, the same refund-urgency case changed sharply between prose, flat JSON and nested JSON. Keep state serialization stable in evaluation and production, and include an explicit escape or “other” path when the real world can fall outside the listed choices.

Self-host Clef or Clef-flash

SGLang’s Clef support landed after v0.5.21. Its cookbook pins nightly 0.5.22.dev20261009+g37ae292e6f for Python 3.10 on Linux x86_64 with glibc 2.39 or newer, or the lmsysorg/sglang:dev-clef Docker image. It documents BF16 on one B200, B300 or H200 with TP=1. Use /v1/systemone; this path does not serve chat generation.

In that SGLang path, the reference encoder caps the full prompt, including images, at 16,384 tokens by default. Server context, KV capacity or max-prefill-tokens can lower it. The server truncates the state to leave room for questions and images, then rejects a request if those alone do not fit. This local runtime limit is separate from the weights’ context specification and the hosted Workers AI limit.

Both weight sets are Apache-2.0 and published as standard sharded safetensors with the vision encoder plus a small joint schema head. The Clef model card documents a Transformers/PyTorch example tested on a single H200.

llama.cpp v0.6.0 adds Clef text and vision support and the /v1/systemone decision endpoint. The ggml-org Clef-GGUF and Clef-Flash-GGUF repositories provide converted weights. For a first local text request, download the exact file in the table, install a v0.6.0 build for your backend and run the commands below. The example uses a 4,096-token context and physical batch; Clef’s entire prompt must fit in --ubatch-size. Increase these together when your state plus questions exceed that budget.

Check GET /v1/models for decisions in architecture.output_modalities, then POST state and questions to /v1/systemone. Read answers.route.choice and its probabilities to see the decision. This is a typed decision API; Clef does not serve generated chat completions. An old build or a client that only sends chat messages will need to be updated.

For images, load the matching mmproj file with --mmproj and send Base64 data URLs in images. GGUF sizes are disk sizes, not total RAM or VRAM requirements. Allow additional memory for the projector, full prompt evaluation, working buffers and the operating system; CPU/GPU placement changes where that memory lives. Compare Q4_K_M and Q8_0 on the same labeled cases before choosing the smaller file.

The release’s up-to-3× result concerns few-row Metal matrix multiplication kernels for speculative and batched decoding on Apple GPUs. It is not an end-to-end Clef speedup. Measure your complete decision request on the chosen backend before changing a capacity estimate.

Local cost depends on precision, runtime, batching, state length, question count and hardware. Measure warm request latency on the exact checkpoint and workload you plan to serve, then enter that measurement and your full machine or cloud-instance quote in the decision calculator.

Switching from Clef to Clef-flash changes the workload profile and clears the calculator latency measurement. Re-measure after changing the variant, number of questions, input length, image mix or runtime.

Early community implementations offer concrete starting points. An A800 80GB vLLM service reports 45 ms p50 for 291-token Clef-flash requests and 28 requests/s at concurrency 16. An L4 24GB mixed-FP8 build reports 136 ms median on 1,042 rows averaging about 2,000 tokens. Its 12.4 GiB startup memory excludes the vision tower and reserved KV cache, so allow additional memory for your workload. A 3090 bf16 test ran Flash locally at 315 ms p50 on 42 coding-agent decisions. Compare each setup with your own request lengths and concurrency before estimating capacity.

llama.cpp v0.6.0: load a downloaded Flash GGUF, then send a local decision request
llama-server --version
llama-server -m ./Clef-Flash-Q4_K_M.gguf --alias clef-flash \
  --ctx-size 4096 --batch-size 4096 --ubatch-size 4096 \
  --host 127.0.0.1 --port 8080

# In a second terminal after the server is ready:
curl http://127.0.0.1:8080/v1/models
curl http://127.0.0.1:8080/v1/systemone \
  -H "Content-Type: application/json" \
  -d '{
    "state": "I was charged twice for my subscription.",
    "questions": {
      "route": {
        "type": "choice",
        "instructions": "Which team should handle this?",
        "criteria": {
          "billing": "Charges, invoices and refunds",
          "technical": "Bugs and outages",
          "triage": "Cases requiring human review"
        }
      }
    }
  }'
GGUF selectionFile size, decimal GBWhen to compare it
Clef-Flash-Q4_K_M6.49Smaller text-first trial; evaluate decision quality after quantization
Clef-Flash-Q8_09.66Higher-precision Flash alternative
Clef-Q4_K_M19.23Larger model when labeled cases justify the capacity
Clef-Q8_028.73Higher-precision Clef alternative
Flash / Clef BF16 projector0.92 / 0.93Additional matching file for image input

What Cloudflare’s Decision Index results show

Cloudflare reports results from Decision Index 0.2.1 and additional Typesafe workflow evaluations. Use the tasks and input conditions below to choose a baseline for your application.

On the published table, Clef scores 98.47 on BFCL case exact, 94.20 macro-F1 on BANKING77 and 97.43 on CLINC150+OOS. Clef-flash scores 98.76 on BFCL, 93.11 on API-Bank and 97.73 on the home-appliance simulator. Jev remains ahead on some tasks including When2Call and BRIGHT.

BenchmarkClefClef-flashJev
BFCL case exact98.4798.7695.75
API-Bank accuracy91.9393.1188.19
BANKING77 macro-F194.2090.9379.74
CLINC150+OOS macro-F197.4366.7789.27
When2Call accuracy72.3765.5880.97
Median latency209.3 ms38.8 ms524.1 ms

When should you choose Clef, Clef-flash or Jev?

Start with Clef-flash for simple bounded routing when lower token price and a smaller self-hosting footprint matter. Move a question to Clef when labeled evaluation shows the larger model improves multi-intent, visual or high-cost decisions enough to justify the extra cost.

Keep Jev in the comparison when hosted latency and unit cost matter, especially for an existing text-only workflow with calibrated thresholds. Choose Clef when open weights, local deployment, visual inputs or the Cloudflare stack are more valuable. Because all three expose similar typed decisions, compare calibration, false positives, missed escalations, wall-clock latency and total cost per accepted decision.

Jev’s 64K request budget includes the state plus every question; the state plus the longest question must also fit within 32K. Pin jev-1.13.0 when preserving calibrated thresholds. It accepts text, including JSON objects or arrays of text values, with no output-token charge. Convert image, audio or video evidence into text before sending it to Jev.

Hosted modelExact model IDUSD / 1M input tokensInputToken budget
Clef@cf/cloudflare/clef$0.24Text / JSON and up to 4 embedded images65,536-token context
Clef-flash@cf/cloudflare/clef-flash$0.038Text / JSON and up to 4 embedded images24,576-token context
Jev 1.13jev-1.13.0$0.042Text only; no direct image, audio or video input64K total; state + longest question ≤32K

How does Cloudflare Clef compare?

Compare the models on the same labeled cases, using quality, end-to-end latency and cost per accepted decision.

Should the hot path use Clef-flash?

Clef-flash’s hosted input price is about 84.2% lower than Clef’s. It also wins several individual publisher benchmarks, including API-Bank and the home-appliance simulator. Those results make it a useful first candidate for bounded routing.

The larger Clef has much stronger results on some intent-classification benchmarks. Evaluate both on your own false-positive and false-negative costs, then route only the cases that need the larger model if that improves cost per accepted decision.

Compare the Clef variants

Before you use it

  • Probability scores are not business policy. Calibrate thresholds on labeled examples and keep high-risk actions, permissions, arithmetic and irreversible operations in explicit application logic.
  • For visual decisions, include the image types and quality you expect in production when labeling evaluation cases. Akari Iku’s blurred-image examples produced materially different confidence scores from the clear images.

How to get started

Start with at least a small labeled decision set and compare Clef-flash, Clef and your current baseline on the same serialized state and questions. Recalibrate confidence thresholds per model. Record false positives, missed escalations, public-endpoint latency or local latency, input tokens and total cost per accepted decision before automating a high-impact action.

Sources

Sources (21)

Calculators

Using this calculator for this model

Enter questions per request, requests per month and provisioned hours. To estimate capacity, supply measured request latency and name the exact workload and device. Average input tokens are used for the separate API comparison; decision models do not generate output tokens.

How to fill in the calculator
Deployment
Local estimates use hardware ownership, electricity and operations; cloud estimates use hourly rental pricing. Compare the path you are considering.
Request mix
Use questions per request, monthly request count and provisioned hours. Leave latency blank until you have a matching measurement; memory fit alone does not establish throughput.
Checkpoint and measurement
Choose a checkpoint belonging to this model. Measure request latency for the same questions, input size, runtime and device; do not substitute chat-token generation speed.

Use the calculator for a deployment budget; enter your expected usage and measured wall power.