clef
3 TagsUpdated Apache-2.0by Cloudflare
Decision models by Cloudflare. Clef-Flash is Qwen3.5-9B, fully post-trained, with a joint schema head that scores every option of every question together, in one forward pass per request. Its probabilities come straight from the head. Ollaya runs its text path.
ollaya run clef --preset triage "I was charged twice for my subscription this month and want a refund."curl http://localhost:11435/api/decide \
-H "Content-Type: application/json" \
-d '{
"model": "clef",
"state": "I was charged twice for my subscription this month and want a refund.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices and refunds",
"technical": "Bugs, errors and outages",
"account": "Login, profile and settings"
}
},
"refund": {
"type": "noul",
"instructions": "Is the customer asking for a refund?"
}
}
}'# Already using a TypeSafe SDK? Set TYPESAFE_BASE_URL=http://localhost:11435 instead.
import requests
response = requests.post(
"http://localhost:11435/api/decide",
json={
"model": "clef",
"state": "I was charged twice for my subscription this month and want a refund.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices and refunds",
"technical": "Bugs, errors and outages",
"account": "Login, profile and settings"
}
},
"refund": {
"type": "noul",
"instructions": "Is the customer asking for a refund?"
}
}
},
)
answers = response.json()["answers"]
print(answers["department"]["choice"], answers["refund"]["noul"])const response = await fetch("http://localhost:11435/api/decide", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "clef",
state: "I was charged twice for my subscription this month and want a refund.",
questions: {
department: {
type: "choice",
instructions: "Which team should handle this?",
criteria: {
billing: "Payments, invoices and refunds",
technical: "Bugs, errors and outages",
account: "Login, profile and settings"
}
},
refund: {
type: "noul",
instructions: "Is the customer asking for a refund?"
}
}
}),
});
const { answers } = await response.json();
console.log(answers.department.choice, answers.refund.noul);Models
Every tag| Name | Accuracy | Latency | |||
|---|---|---|---|---|---|
| Most accurateHighest typed-decisions accuracy of the family. | |||||
| cleflatestSame as clef:flash. | 0.703 | 268 ms | |||
| FasterFastest first; accuracy as measured on the bench. | |||||
| clef:flash-fp16Cloudflare's Clef-Flash: Qwen3.5-9B post-trained with a joint schema head that scores every option of every question together, in one forward pass per request. Needs about 19 GB of memory. This tag computes in fp16 on NVIDIA GPUs: faster than clef:flash, with at least 99.5 % of its decisions the same. On a CPU it runs, slowly; use clef:flash there. | 0.703 | 150 ms | |||
| clef:flashClef-Flash (Qwen3.5-9B, post-trained) with its joint schema head, text only. Needs a 24 GB GPU. | 0.703 | 268 ms | |||
Accuracy: typed-decisions, argmax against the majority label on 400 states (left out for a tag trained on that data). Latency: the median five-question request on an RTX 5090, Ollaya Bench.
Readme
Clef is Cloudflare's family of decision models, released under Apache-2.0. Clef-Flash is Qwen3.5-9B, fully post-trained, with a joint schema head: a small transformer that reads the model's hidden states and scores every option of every question together, in one forward pass per request. It never generates text, and its probabilities come straight from the head, with no fitted temperature.
Needs Ollaya 0.9.0 or newer, the first release that runs the
clef-joint-v1layout.
Models
| Tag | Base | Params | Typed-decisions accuracy | Five questions, RTX 5090 |
|---|---|---|---|---|
clef:latest, clef:flash | Qwen3.5-9B, post-trained | 9B | 0.703 | 268 ms |
Typed-decisions accuracy is the argmax against the majority label on all 400 typed-decisions states, measured by Ollaya, with a calibration error (ECE) of 0.014 and no fitted temperature. The time is the median five-question request of Ollaya Bench through the HTTP API. Cloudflare reports Clef-Flash's results on their Decision Index on the model card.
The larger Clef (Qwen3.8-27B, about 54 GB in BF16) is not in the library yet: it does not fit the GPUs Ollaya checks parity on.
Usage
ollaya run clef --preset triage "My order never arrived and support ignores me. Refund me today or I'm switching to your competitor."Point any TypeSafe client at http://localhost:11435 and set the model to clef.
How it works
- One sequence per request. The prompt is built exactly as Cloudflare's
encode_recordbuilds it: the state, then every question with its options as a schema. The head scores all options of all questions at once, from the hidden states over each question and option. - Weights. Cloudflare's four BF16 shards and the head's
joint_head.safetensorsdownload from Hugging Face, pinned to a commit and verified by sha256. Ollaya hosts only the ONNX graph (11 MB). - Parity. Ollaya's Rust runtime matches Cloudflare's own code in fp32 on CUDA: identical token ids and spans, and the same decision on all 571 test questions, probabilities within 6.3e-6.
- fp16 tag.
clef:flash-fp16runs the trunk in fp16 on NVIDIA GPUs (how): 150 ms for five questions on the RTX 5090 instead of 268 ms, 570 of 571 decisions the same asclef:flashon the parity set, and 0.703 on typed decisions. On a CPU useclef:flash.
Limits
- Text only. Clef reads images and video upstream; Ollaya runs its text path, so a request with images is rejected.
- Questions. Choice criteria must be an object of options, as upstream. Ollaya requires
instructionson every question. - Length. Up to 4,096 tokens per request, so a request fits next to the weights on a 24 GB GPU (upstream reads up to 16,384); a longer state is cut to fit.
- Memory. About 19 GB with the weights kept BF16: a 24 GB GPU.
Badge
For the model card or a README. Day-0 support for a new model
[](https://ollaya.dev/library/clef)