clef¶
Run Cloudflare's clef-flash decision model locally. Give it an input and a set of options, get a calibrated probability for every option in one forward pass. No text generation, no parsing.

from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8910/v1", api_key="not-needed")
schema = {
"type": "object",
"properties": {
"team": {"type": "string", "enum": ["billing", "technical", "account"]},
"outage": {"type": "boolean"},
},
}
r = client.chat.completions.create(
model="clef-flash",
messages=[{"role": "user", "content": "Checkout is down, orders blocked"}],
response_format={"type": "json_schema", "json_schema": {"name": "triage", "schema": schema}},
)
print(r.choices[0].message.content) # {"team": "technical", "outage": true}
The model is Cloudflare clef-flash: a 9B multimodal decision model (Qwen3.5-9B backbone plus a joint schema head). clef wraps it in a FastAPI server, a CLI, Python and JavaScript clients and a web console. It reads text, JSON, images and videos, runs on NVIDIA (CUDA), AMD (ROCm, also under WSL2), Apple Silicon (MPS) and CPU.
What you get¶
-
Classification in one call
POST /v1/classifywith labels returns a probability per label. Multi-label, scoring and saved classifiers included. -
OpenAI and Hugging Face compatible
The official OpenAI SDK (structured outputs) and Hugging Face zero-shot clients work against your own machine.
-
Evaluation and calibration
Accuracy, F1, a confusion matrix and calibration for your own labelled data, plus a threshold curve for auto-routing. In the API and in the console.
-
Async jobs and webhooks
Submit up to 100,000 rows, poll or get a signed webhook, and stream the results as JSON, NDJSON or CSV.
-
Smaller GPUs
CPU offload and int8 for 16, 12 and 8 GB cards, with measured latency and accuracy.
-
Safe remote access
Named API keys, rate limits, CORS and a TLS reverse proxy example.
Console¶
http://127.0.0.1:8910/ serves the Clef Console: Playground, History, Batch runs, Evaluate and live Ops charts.



Support matrix¶
| Platform | Backend | Status |
|---|---|---|
| Windows + WSL2, AMD RX 7900 XTX | ROCm 7.2 | verified (development machine, all tests + benchmarks) |
| Ubuntu / Windows + WSL2, NVIDIA | CUDA | untested on hardware (code paths unit-tested with mocked backends) |
| macOS, Apple Silicon | MPS | untested on hardware (no Apple Silicon machine has run it yet) |
| Any OS, no GPU | CPU | unit-tested on Ubuntu, macOS and Windows (the tests never load the model) |
"Untested on hardware" becomes "verified" only after a maintainer runs the hardware validation and pastes the result into hardware results.