Skip to content

Clef

Checkpoints Inputs
Cloudflare/clef text, images

Clef is Cloudflare's family of decision models with a joint schema head, here Clef on Qwen3.8-27B. Flide writes a request as the release's encode_record writes it and runs the head that the checkpoint saves in joint_head.safetensors.

A request is one sequence that holds every question. A system turn comes first, then STATE: and the state, then SCHEMA FIELDS: and each question in order with its id, its type, its instructions and its allowed options, each option the JSON of its id and description. The assistant turn closes the sequence with thinking off. A choice's options are in the order of their names, a noul's are true and false with the release's descriptions unless the request gives its own, and a score's are its levels. Every piece is tokenized on its own, as the release tokenizes it, and the state is cut so the sequence holds at most 16,384 tokens.

The head reads the final hidden state at every position. It averages the tokens of each question's instructions and of each option, adds the output embeddings of the option's tokens, lets every option gather evidence from the whole sequence, runs its joint layers over the questions and gives each option one logit. The answer is the softmax over a question's options, and one pass answers every question of the request.

Speed

On one H200, one request at a time, Flide answers clef 1.0 to 1.8 times faster than SGLang 0.5.22.dev20261009, the nightly with Clef support that its README serves it with, at its defaults. Each workload is 32 requests, each run once on both sides before timing, and the tables give the median latency of a request. MultiRC requests ask about 49 questions each, and GQA requests carry one image each.

clef

Workload Flide Release Speedup
Decision Index 71.6 ms 92.7 ms 1.3×
RACE 50.8 ms 91.3 ms 1.8×
MultiRC 609.1 ms 624.3 ms 1.0×
QuALITY long 348.2 ms 349.6 ms 1.0×
GQA 147.9 ms 151.1 ms 1.0×

Start a server

flide serve --model Cloudflare/clef

Send a request

curl http://localhost:8000/v1/systemone -H "Content-Type: application/json" -d '{
  "state": "Order #1182 arrived with a cracked screen. The customer asks for a refund and attached two photos.",
  "questions": {
    "action": {"type": "choice", "instructions": "What should support do next?",
               "criteria": {"refund": "refund the order", "replace": "send a replacement", "escalate": "ask a human"}},
    "urgent": {"type": "noul", "instructions": "Does this need a reply within the hour?"}
  }
}'

Images

Images go in images, as data URLs or plain base64. They sit between STATE: and the state, as the release places them, at the sizes of the checkpoint's processor, and every question of the request sees them. The release's server reads no video, and Flide refuses a request with videos.

IMG=$(base64 -w0 photo.jpg)
curl http://localhost:8000/v1/systemone -H "Content-Type: application/json" -d '{
  "state": "A customer sent this photo of the delivered parcel.",
  "images": ["data:image/jpeg;base64,'"$IMG"'"],
  "questions": {"damaged": {"type": "noul", "instructions": "Is the parcel damaged?"}}
}'

Images need torchvision, installed from the same place as torch.

Limits and options

A request takes choice, noul and score questions. A choice takes up to 256 options and a score up to 256 levels. The sequence holds at most 16,384 tokens with its images, and a request whose questions alone need more is refused, as the release refuses it.

Option What it does
--format-arg max_length=N longest sequence in tokens, 16384 by default