---
title: "Clef"
description: "Cloudflare's open-weight 27B decision model, a fine-tune of Qwen3.8-27B served on Workers AI. It answers up to 64 typed questions about a state per request, with a median latency of 209 ms in Cloudflare's tests."
canonical: https://pydantic.dev/models/list/clef/
---

# Clef

> Cloudflare's open-weight 27B decision model, a fine-tune of Qwen3.8-27B served on Workers AI. It answers up to 64 typed questions about a state per request, with a median latency of 209 ms in Cloudflare's tests.
>
> Markdown copy of [https://pydantic.dev/models/list/clef/](https://pydantic.dev/models/list/clef/). Index for agents: [llms.txt](https://pydantic.dev/models/llms.txt)

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://pydantic.dev/models/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: [select.md](https://pydantic.dev/models/select.md)
- Search models by name: `GET https://pydantic.dev/models/api/search?query=<text>`
- List, filter and sort models: `GET https://pydantic.dev/models/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://pydantic.dev/models/api/models/<slug>`
- Any other question about the models: `GET https://pydantic.dev/models/api/ask?query=<question>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of all but the single model. An `OPTIONS` request to any endpoint returns its schema. The same five are tools of the MCP server at `https://pydantic.dev/models/mcp`. More: [usage.md](https://pydantic.dev/models/usage.md)

A decision model answers typed questions about a state (yes/no, choice from a list, or a score) with a probability for each answer, instead of writing text. Pydantic AI and Pydantic AI Gateway call models that write text, so they can't call it: use its provider's decisions API, or OpenRouter's. OpenRouter's decisions API: [docs](https://openrouter.ai/docs/guides/features/decisions).

## Spec sheet

- **Type:** decision model
- **Family:** Cloudflare
- **Released:** 1 Oct 2026
- **Weights:** open
- **Context window:** 65,536 tokens
- **Accepts:** text, image
- **Answers:** Typed questions: yes/no, choice, score
- **Knowledge cutoff:** unknown
- **Scores updated:** 2026-12-02
- **Price:** $0.24 per 1M input tokens; output is free
- **Popularity:** rank 150 of 211 by usage
- **Pydantic AI Gateway:** not available

## Benchmarks


| Benchmark          | Score | Rank among models tested | What it measures                                                                                                     | Source                                             |
| ------------------ | ----- | ------------------------ | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| AA Decision Index  | 60    | 14                       | Artificial Analysis's composite for decision models: six evaluations of typed answers, partly on private data        | Artificial Analysis, via OpenRouter                |
| Jev Decision Index | 54.9  | 6                        | An independent suite of 37 public benchmarks recast as typed questions, run on each decision model by its maintainer | Jev Decision Index (multimodalart on Hugging Face) |

## Providers and prices

US dollars per million tokens.

| Provider              | Gateway | Pydantic AI string | Input | Cached input | Output |
| --------------------- | ------- | ------------------ | ----- | ------------ | ------ |
| Cloudflare Workers AI | –       | –                  | $0.24 | –            | $0     |
| OpenRouter            | –       | –                  | $0.24 | –            | $0     |

## About Clef

Clef costs $0.24 per million input tokens and $0 per million output tokens and has a 66k token context window.

Clef is a decision model Cloudflare released on 1 October 2026, with open weights under the Apache 2.0 licence. It is Qwen3.8-27B, kept frozen, with LoRA adapters trained to answer typed questions. It takes a state of text, JSON or up to four images, and answers between 1 and 64 yes/no, choice or score questions per request.

Its context window is 65,536 tokens. On Workers AI, input costs $0.24 per million tokens and output is free; OpenRouter is cheaper. In Cloudflare's own tests, its median latency was 209 ms and p95 239 ms. It scored above Jev on BFCL, BANKING77 and CLINC150, though Cloudflare ran those comparisons itself.

Cloudflare's docs note that a state longer than the window is truncated silently.

**Strengths**

- Open weights under Apache 2.0
- Median latency of 209 ms in Cloudflare's tests
- Up to 64 questions per request
- Served on Workers AI and through OpenRouter

**Weaknesses**

- Answers only typed questions (yes/no, choice, score); it cannot write text, call tools or run as an agent
- Dearer per input token than most decision models on Workers AI
- A state longer than the window is truncated without an error

**Best for:** Classification, intent detection and tool selection where open weights matter, or on Cloudflare Workers.

Prices come from [genai-prices](https://github.com/pydantic/genai-prices), in US dollars per million tokens. Benchmark scores come from Epoch AI and LMArena (CC BY 4.0), Browser Use, our own Pydantic AI benchmarks (CC BY 4.0), and, for decision models, Artificial Analysis and the Jev Decision Index; the index and its sources are described in [the methodology](https://pydantic.dev/models/methodology.md). Data built 2026-12-03. This model from the API: `https://pydantic.dev/models/api/models/clef`. Compare it with others: `https://pydantic.dev/models/api/models?slug=clef,<other slug>`
