Clef
Clef is a 27B multimodal decision model from Cloudflare that turns a state and typed questions into per-option probabilities, hosted on Workers AI.
At a Glance
About Clef
Clef is Cloudflare’s family of open-weight decision models for making fast, structured decisions inside applications and AI agents. Instead of generating free-form text, Clef takes application state plus typed questions and returns probabilities for every allowed answer, making it useful for routing, classification, moderation, guardrails, scoring, and other decisions that sit directly in an application’s hot path.
The family now includes three models:
- Clef — The primary 27B model for higher-quality decisions across text and images. It supports a 64K hosted context window and is available on Workers AI as @cf/cloudflare/clef.
- Clef-flash — A smaller 9B variant optimized for inexpensive, latency-sensitive decisions. Hosted inference costs $0.038 per million input tokens with a 24K context window, while the open weights support up to 256K context when self-hosted.
- Clef-omni — A 30B mixture-of-experts model with 3B active parameters that extends the family to native text, image, audio, and video input. It can reason over a video’s visual frames and soundtrack together instead of requiring separate transcription or media-processing pipelines.
What It Is
Clef is a decision-model family in the same emerging category as Typesafe’s Jev. Rather than asking a general-purpose LLM to generate and then parse an answer, applications send Clef a state plus one or more constrained questions and receive structured probabilities that code can act on immediately.
The API supports three question types:
- noul — A yes/no decision that returns the probability of yes.
- choice — Selects between predefined options and returns probabilities and confidence.
- score — Evaluates an input against an ordered rubric and returns a probability-weighted score.
A single request can contain up to 64 questions, allowing applications to evaluate several decisions against the same input without repeatedly invoking the model.
Clef
The standard Clef model is designed for applications that need stronger decision quality while still prioritizing latency. It supports text and image inputs with a 64K hosted context window.
Cloudflare has also optimized its Workers AI serving stack since launch, reducing median decision latency by as much as 2x without changing the model weights.
Clef-flash
Clef-flash trades some model capacity for lower latency and substantially lower cost. It is intended for high-volume decisions such as request routing, lightweight classification, filtering, and agent control loops where the cost of invoking a full language model would be difficult to justify.
On Workers AI, Clef-flash costs $0.038 per million input tokens and uses a 24K hosted context window. The open-weight version is unchanged and can support up to 256K context when self-hosted.
Clef-omni
Clef-omni expands the decision-model approach beyond text and images to audio and video.
Instead of building a pipeline that transcribes audio, extracts video frames, processes each modality independently, and then asks another model to make a decision, Clef-omni can evaluate text, images, audio, and video directly in one request. For video, the model aligns the soundtrack with visual frames so decisions can incorporate what is happening both visually and audibly.
Clef-omni uses a 30B-parameter mixture-of-experts architecture with 3B active parameters and a 64K hosted context window.
Use Cases
Cloudflare positions the Clef family for decisions including:
- Agent routing and tool selection
- Support-ticket triage
- Trust and safety classification
- Threat intelligence
- AI agent guardrails
- Content and visual classification
- Scoring and ranking
- Audio and video classification with Clef-omni
Because results are constrained and structured, Clef can be used for decisions where an application needs a predictable output rather than prose generated by an LLM.
API and Compatibility
All three Clef models use the same System One API, so developers can switch between Clef, Clef-flash, and Clef-omni primarily by changing the model identifier.
They are available through Cloudflare Workers AI using Workers bindings or the REST API and can also be routed through AI Gateway.
Cloudflare publishes the model weights under the Apache 2.0 license, allowing developers to self-host the models instead of relying exclusively on Workers AI.
Pricing
Model Workers AI price Hosted context Best for Clef-flash $0.038 / 1M input tokens 24K Cheap, high-volume decisions Clef-omni $0.150 / 1M input tokens 64K Audio, video, image, and text decisions Clef $0.240 / 1M input tokens 64K Higher-quality text and image decisions
All three are open-weight models and can also be self-hosted.
Community Discussions
Setting up Clef-flash in Cloudfalre workers
I want to try Clef-flash as the router in a multi-agent app running on Cloudflare Workers. Say it gets a few thousand requests a day. Clef-flash looks at each request and decides whether it should go to a coding agent, a research agent, or a normal model call. Curious how often it routes code change…
Pricing
Clef
Cloudflare's 27B decision model on Workers AI, billed per input token. Open weights are also published under Apache 2.0 on Hugging Face.
- Input: $0.24 per M input tokens
- Context window: 65,536 tokens
- Vision: Yes
- Model ID: @cf/cloudflare/clef
- Up to 64 questions per request (noul, choice, score)
Capabilities
Key Features
- Typed decision questions: noul (yes/no), choice, and score
- Returns probabilities for every allowed option
- Up to 64 questions per request
- Multimodal input: text, JSON, images, or video
- Up to 4 embedded images per request
- 65,536-token context window
- System One API compatibility with Jev
- Available via Workers AI binding and REST API
- Open weights on Hugging Face under Apache 2.0
- Companion 9B clef-flash model for low-latency decisions
