Skip to content
HUIAHUB

Models & inference

Clef

Cloudflare's open-weight decision models that return typed answers with probabilities, hosted on Workers AI.

Verified Open sourceTool of the Week

What Clef does

Clef is a pair of decision models from Cloudflare, Clef and Clef-flash, announced on the Cloudflare blog on October 1, 2026. A decision model does not write free text. You give it an input state and a set of typed questions, and it returns a probability for each allowed answer, which your code can use to route a ticket, trigger an escalation or hand the case to a person.

Cloudflare's docs list Clef at 27B parameters and Clef-flash at 9B. Both read the state as text, JSON, images or video, have a 65,536-token context window, and take up to 64 questions per request in three types: yes/no, choice and score. They run on Workers AI as @cf/cloudflare/clef and @cf/cloudflare/clef-flash, and Cloudflare says they are compatible with the Jev API from Typesafe AI. The weights are on Hugging Face under Apache 2.0, and the model card names Qwen3.8-27B as the base for Clef.

Cloudflare also announced a reinforcement learning fine-tuning service. It starts as hands-on work with Cloudflare's forward-deployed engineering team, with a self-serve platform planned later. The announcement says Cloudflare does not read, store or train on Clef requests and responses unless a customer uses fine-tuning.

Clef suits developers who need fast, bounded classification steps inside agent workflows. The benchmark tables in the announcement are Cloudflare's own.

  • Decide whether a support message is urgent and which team should handle it.
  • Classify a website domain into categories, as Cloudflare's Threat Intelligence team does.
  • Classify images or video frames against a fixed set of labels.
  • Add a decision step to an agent workflow that can defer to a human when confidence is low.

Who should use it

  • Developers on Cloudflare Workers who need classification inside agent workflows.
  • Teams that want open weights they can run themselves.

Who should look elsewhere

  • Chat or open-ended text generation, since the models output only probabilities.
  • Teams that want self-serve fine-tuning now; the service starts as engineer-led work.

Strengths

  • Accepts images and video as well as text and JSON.
  • 65,536-token context window on both models.
  • Apache 2.0 weights on Hugging Face, plus a hosted API on Workers AI.
  • Hosted pricing is per million input tokens, with a free daily Workers AI allocation.

Limitations

  • Answers are limited to the options you define; the models do not generate text.
  • Benchmark results come from Cloudflare's own announcement.
  • Fine-tuning is not self-serve yet.

Sources