Skip to content

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.

Get started HTTP API GitHub

Clef Console: playground, evaluation and live ops

from clef_client import ClefClient

ClefClient().classify("Checkout is down", ["billing", "technical"])
# -> label='technical' confidence=0.96 scores={'billing': 0.04, 'technical': 0.96}
curl -s http://127.0.0.1:8910/v1/classify -H 'Content-Type: application/json' \
  -d '{"input": "Checkout is down", "labels": ["billing", "technical"]}'
# {"label":"technical","confidence":0.96,"scores":{"billing":0.04,"technical":0.96}, ...}
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}
import { ClefClient } from "./clients/js/src/index.js";

const c = new ClefClient({ baseUrl: "http://127.0.0.1:8910" });
const r = await c.classify("Checkout is down", ["billing", "technical"]);
console.log(r.label, r.confidence, r.scores);

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/classify with labels returns a probability per label. Multi-label, scoring and saved classifiers included.

    Classification guide

  • OpenAI and Hugging Face compatible


    The official OpenAI SDK (structured outputs) and Hugging Face zero-shot clients work against your own machine.

    Compatibility

  • 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.

    Evaluation

  • 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.

    Jobs & webhooks

  • Smaller GPUs


    CPU offload and int8 for 16, 12 and 8 GB cards, with measured latency and accuracy.

    Smaller GPUs

  • Safe remote access


    Named API keys, rate limits, CORS and a TLS reverse proxy example.

    Remote access

Console

http://127.0.0.1:8910/ serves the Clef Console: Playground, History, Batch runs, Evaluate and live Ops charts.

Evaluate Evaluate

Classify Classify

Batch Batch

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.