Skip to main content

Jev AI / Guide

Cloudflare Clef vs Jev: Choosing an Open-Weight Decision Model

In September 2026, TypeSafe AI’s Jev brought the term “decision model” into the mainstream. Two weeks later, on October 1, Cloudflare released two comparable models—Clef and Clef-flash—hosted on Workers AI and also published as Apache-2.0 open weights on Hugging Face.

Clef’s positioning is blunt: take on Jev directly, and make “open-weight + multimodal + self-hostable” the differentiator. It is 27B, ships a vision encoder, supports a 64k context window, and is fully compatible with the Jev / SystemOne API. For anyone doing technical evaluation, the question is no longer whether decision models are useful—it is whether a hosted API or open-weight self-hosting fits your team better.

Every benchmark below comes from Cloudflare’s published internal runs. They are good enough to rule out obviously mismatched options, but they are not a substitute for re-testing on your own data.

The short version

  • Zero-ops, maximum accuracy: both Jev and Clef’s hosted versions work; Clef leads on most classification benchmarks, and multimodal input is unique to it. To get started fastest, try the hosted Clef API on defapi.
  • Image or video input: Jev is text-only today. Clef is the only option.
  • Self-hosting or data residency: Clef’s Apache-2.0 weights are a hard requirement advantage. The price is a 27B GPU footprint and ops.
  • Extremely low latency: Clef-flash (9B, 38.8ms median) is an order of magnitude faster than Jev (524ms), at some cost in accuracy.
  • Just want to try it: both start from a compatible API, but never let public benchmarks replace procurement validation.

If you already read our Jev vs Laya comparison, this piece applies the same framework to a third candidate.

What Clef is

Clef is a family of decision models trained by Cloudflare. Key characteristics:

ItemClefClef-flash
BackboneQwen3.8-27B (with vision encoder)Qwen3.5-9B
InputText, JSON, images, videoText, JSON, images, video
Context64k64k
OutputOne logit per allowed option per question, softmax per questionSame
LicenseApache-2.0Apache-2.0
HostingCloudflare Workers AICloudflare Workers AI

Its mode of operation is the same category as Jev but a different implementation: no free-form text generation, no output parsing. You give it a state (text, JSON, images, or video) plus a set of typed schema questions, and it returns a probability for every allowed option of every question in a single forward pass.

On naming, Cloudflare leans on a music metaphor: a clef at the start of a staff assigns pitch names to the lines and spaces, and a decision model defines the domain of the context that determines the actions that follow. The “CF” is also a nod to Cloudflare.

Architecture: prefill plus parallel scoring, not token-by-token generation

The key to understanding Clef is that it is not autoregressive:

  1. The Qwen backbone runs a prefill-only forward pass over the entire input.
  2. A small joint schema head reads the backbone’s final hidden states, routes evidence from the state to each question, and scores all options of all questions jointly.
  3. Each option gets a logit; a per-question softmax turns that into probabilities.

There is no intermediate generated text. Where an LLM generates reasoning and then formats it as JSON, Clef derives schema choices directly from internal backbone representations.

Cloudflare’s two-stage attention routing is worth remembering: every valid choice first extracts context relevant to itself (option-specific evidence routing), then fields cross-attend with each other and back to the original payload (joint cross-field attention) before schema-bound scoring. A lexical prior preserves semantic intent across options.

For training, Cloudflare froze the Qwen backbones and jointly optimized the routing head alongside rank-256 LoRA adapters:

  • label-smoothed cross-entropy (to guarantee valid schema outputs)
  • Brier loss (to improve probability calibration)
  • RLCD (Reinforcement Learning for Calibrated Decisions) as a secondary objective, granting partial credit to adjacent ordinal choices, rewarding fully precise records, and applying a reference penalty to prevent distribution shift

There is an interesting detail here: Cloudflare had published a decision-model experiment built on DiffusionGemma the same week Jev launched. Clef is a continuation of that line, just with a different backbone. It is not a copy of Jev’s architecture—it arrived via an independent path of exposing LLM logprobs as deterministic probabilities.

Compatibility with Jev / SystemOne

Clef is fully compatible. The same POST /v1/systemone request body returns the same model, answers, and usage structure. A choice answer has choice / confidence / probabilities; a score answer has the expected score / confidence / legend / probabilities; a noul answer returns the probability that the proposition is true.

The three primitives align with Jev:

PrimitiveMeaningReturns
noulBinary proposition, true/falseA probability between 0.0 and 1.0
choiceNamed options, pick oneChoice + confidence + per-option probabilities
scoreOrdered options, rateExpected score + confidence + per-level probabilities

For a system already integrating Jev, this means a very low migration cost—you can even put the same client behind two providers for shadow traffic. But one warning: wire-protocol compatibility is not semantic equivalence. Option limits, confidence formulas, and calibration curves can differ across models, so old thresholds must be re-validated on boundary samples.

A concrete official example (Cloudflare Workers AI endpoint):

curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/cloudflare/clef \
  -X POST \
  -H "Authorization: Bearer $CLOUDFLARE_AUTH_TOKEN" \
  -d '{
    "model": "clef",
    "state": "Checkout has been failing for every customer for the last hour.",
    "questions": {
      "urgent": { "type": "noul", "instructions": "Is this support request urgent?" },
      "team": {
        "type": "choice",
        "instructions": "Which team should handle this request?",
        "criteria": {
          "billing": "Payments, invoices, and refunds",
          "technical": "Outages, errors, and configuration",
          "sales": "Plans and upgrades"
        }
      },
      "severity": {
        "type": "score",
        "instructions": "How severe is the customer impact?",
        "criteria": ["No impact", "Minor", "Major", "Critical"]
      }
    }
  }'

Multimodal: the capability only Clef has today

This is Clef’s clearest product difference from Jev. Jev classifies text only, while Clef ships a vision encoder and can read images and video frames.

The usage is to add images (PIL images) or videos (frame arrays) to the record and pass the processor to encode_record; optional processor arguments go in media_kwargs. Text-only and multimodal records can be mixed in the same batch:

from PIL import Image

record = {
    "state": {"task": "Review the attached receipt."},
    "images": [Image.open("receipt.jpg")],
    "questions": {
        "legible": {"type": "noul", "instructions": "Is the receipt total legible?"},
    },
}

Cloudflare’s own showcase is threat intelligence: hand a domain plus a Browser Run screenshot to Clef and let it emit multi-label probabilities like “95% fashion, 85% ecommerce, <1% phishing.” They report the full fetch, render, and classify workflow took 2.2s with Clef versus 4.7s for their fastest general LLM, gpt-oss-120b, which only returned two classifications. That is a useful latency-and-coverage comparison, but note it measures the entire workflow, not model inference alone.

Benchmarks: who leads where

Vendor benchmarks deserve scrutiny. Here is a slice of the official Decision Index 0.2.1 internal run (percentages, higher is better):

BenchmarkClefClef-flashJevLeader
BFCL (case exact)98.598.895.8Clef family
ToolRet (nDCG@10)69.266.465.3Clef
API-Bank (accuracy)91.993.188.2Clef family
BANKING77 (macro-F1)94.290.979.7Clef
CLINC150+OOS (macro-F1)97.466.889.3Clef
Home appliance (case exact)83.097.752.3Clef family
ContractNLI (macro-F1)81.484.371.7Clef family
MMLU (accuracy)90.391.891.7Tie
GPQA Diamond (accuracy)48.051.078.3Jev
MMLU-Pro (accuracy)65.965.382.7Jev
BBH (accuracy)73.768.992.9Jev
When2Call MCQ (accuracy)72.465.681.0Jev
BRIGHT (nDCG@10)45.939.347.5Jev

The conclusion is not that “Clef sweeps.” A more accurate reading: Clef is strong on classification, tool calling, and structured indexing; Jev is ahead on tasks that require a bit of general reasoning (GPQA, MMLU-Pro, BBH). That matches their backbones and training objectives—Clef post-trains a Qwen backbone and retains more general reasoning, while Jev gets pulled ahead on some decision-specific metrics. Pick based on which kind of task yours resembles.

Latency (milliseconds, lower is better):

MetricClefClef-flashJevLaya
Median latency209.338.8524.15.8
p95 latency238.6122.4536.0222.5

Laya is extremely fast at the median but clearly trails on the quality benchmarks above—a “fast but trades accuracy” position. The Clef family takes different points on the quality-versus-latency curve: Clef optimizes quality, Clef-flash optimizes speed. These numbers come from different hardware and deployments and cannot be converted across rows—treat them as relative signals only.

Workflow evals (end-to-end business flows from TypeSafe Evals):

WorkflowClefClef-flashJev
Invoice processing (exact)64.757.161.8
Customer service (exact)76.377.076.0
Security incidents (exact)62.961.761.7
Agent trace observability (primary)68.569.871.6

Cloudflare’s framing is “won three of four.” To be fair, the gaps are all single-digit, and this is Cloudflare running TypeSafe’s own eval suite—so for a real purchase you still need your own data.

Deployment and license: what “open” really buys

Both Clef models ship on Hugging Face under Apache-2.0, with standard sharded safetensors you can run locally:

  • Transformers (image-text-to-text pipeline)
  • vLLM (vllm serve "Cloudflare/clef")
  • SGLang
  • Docker Model Runner, llama.cpp / Ollama / LM Studio (quantized builds)

The file layout is clear too: backbone weights, joint_head.safetensors + joint_head_config.json (the joint schema head), and joint_schema_model.py (record encoding, batching, and the systemone wrapper). Cloudflare tested on a single H200 with torch 2.11 and transformers 5.10.2.

This is where the “open source means free” illusion must be punctured:

  • Apache-2.0 waives the license fee, but you pay for GPUs. 27B in BF16 is not a comfortable fit for consumer cards; Clef-flash’s 9B is far more realistic.
  • You own the ops. Model serving, resident VRAM, version upgrades, security patches, and monitoring are all costs.
  • The hosted version removes those costs: besides Cloudflare Workers AI, you can pay to use the Clef or Clef-flash hosted API, at the price of switching to metered billing.

Cloudflare also stresses one enterprise-ready point: by default it does not read, store, or train on your requests and responses—unless you opt into its fine-tuning product. Self-hosting trivially satisfies data-boundary requirements. This fills in exactly the gap left by the Jev comparison, where hosted-API data retention had to be confirmed with the vendor.

The new RL fine-tuning platform

There is a section of the Clef launch that is easy to overlook but important: Cloudflare introduced an RL fine-tuning service.

The motivation is a large set of highly vertical internal classification needs (Trust & Safety submission review, support triage, deciding good bot versus bad bot). Those scenarios have years of labeled decision data. Fine-tuning trades some general-purpose performance for higher accuracy in a specific domain—and with 15+ years of network data, that is exactly Cloudflare’s strength.

The technical stack is worth noting:

  • Cloudflare AI Gateway: captures AI traffic into a dataset automatically
  • Workers AI: generates rollouts against the base Clef model
  • Cloudflare Containers: an RL sandbox for scoring and replaying agent actions
  • [New] Trainer: updates fine-tuned Clef weights
  • Workers AI + BYO Model: redeploys the fine-tuned model back onto Workers AI

Today it runs as a hands-on engagement with Cloudflare’s forward-deployed engineer (FDE) team, with a self-serve platform planned later. For teams already heavily on Cloudflare, it is a path to turn your labeled data into a bespoke decision model—something Jev has no public equivalent for today.

Recommendations: conditions, not slogans

Choose Clef (or Clef-flash) if

  • Your input includes images or video and you need multimodal classification.
  • Data cannot leave your boundary, and you need Apache-2.0 weights with self-hosting or offline deployment.
  • You want a 64k context window for longer state.
  • You want to fine-tune within the Cloudflare ecosystem to build a bespoke model from your labels.
  • Latency is critical and you accept the accuracy trade: Clef-flash is very fast.
  • Want to validate right now: run a Clef or Clef-flash request on defapi.

Choose Jev if

  • You only need text decisions and want a zero-ops hosted API.
  • Your tasks lean toward general reasoning (GPQA / MMLU-Pro / BBH), where Jev currently leads.
  • You already have Jev integrations, thresholds, and calibration curves, and the migration payoff does not cover the re-testing cost.
  • Your team has no GPU ops capacity and no plans to run model serving.

If both work, then

  • Run shadow traffic with your real state distribution, option sets, and score criteria.
  • Measure correct rate, calibration, p50/p95 latency, fallback behavior, and cost together.
  • Do not treat API compatibility as zero migration—re-validate thresholds on boundary samples.
  • Put data retention, residency, SLA, and support commitments into the procurement gate rather than relying on public benchmarks.

FAQ

Is Clef really fully compatible with Jev?
At the wire protocol level, yes: the same POST /v1/systemone request body and the same answers / usage response shape, with matching choice / score / noul primitives. But option limits, confidence formulas, and calibration curves differ inside the models, so old thresholds cannot be copied verbatim.

Clef is open source—can I run it in production for free?
A free license is not zero TCO. 27B needs a serious GPU, plus model serving, VRAM, monitoring, upgrades, and security patches. Clef-flash (9B) or the hosted version is often more economical.

Clef or Clef-flash?
Clef is the precision model and leads on most benchmarks; Clef-flash is the latency model at 38.8ms median, roughly 5× faster than Clef, with clear accuracy drops on tasks like CLINC150 and ContractNLI. Use flash on hot paths and Clef for critical judgments. Both are hosted and ready to try on defapi: Clef, Clef-flash.

Can I base a procurement decision on the official benchmarks?
No. These are Cloudflare’s internal runs, and Clef is being compared on TypeSafe’s own eval suite. They are fine for ruling out obviously mismatched options; the final call needs the same dataset, failure definition, and confidence thresholds on your data.

How do I actually use image input?
Add images (PIL images) or videos (frame arrays) to the record, put optional processor arguments in media_kwargs, and pass the processor to encode_record. Text and multimodal records can be mixed in a batch.

What does self-hosting Clef require?
An H200-class GPU, torch 2.11 + transformers 5.10.2, and pillow for image/video. Cloudflare gives no consumer-hardware guarantees, so load-test p95 on your target hardware before production.

Will Clef replace Jev?
Not necessarily. The two trade wins on benchmarks, Jev leads on general-reasoning tasks, and it remains a pure hosted path. What actually changed is that the decision-model category went from a single vendor to a competitive field with open weights and multimodal input—which is good for buyers.

Next steps

To try the hosted path directly, pay for Clef on defapi (27B precision) or Clef-flash (9B speed), and compare against the Jev API with shadow traffic. If image input or self-hosting is a hard requirement, read the Clef model card on Hugging Face and the Cloudflare launch post, then run a comparison on your own data. To fill in the basics first, see the Jev vs Laya comparison and the System One primer.