Cloudflare 开源其多模态决策模型 Clef:能听声音、看视频、直接做判断
基于阿里 Qwen3-Omni,Clef-omni 能结合图文音视频给选项打分;Flash 降价,Clef 提速。看懂它省掉的步骤、实际账单,以及该选哪款模型。
客服工单该派给谁?设备有没有异响?这些是 Agent 工作流里反复出现的小判断。Cloudflare 的开源决策模型 Clef,专门把输入材料变成预设选项的概率,再交给程序决定下一步。
本次 Cloudflare 对 Clef 家族推出了三项主要更新:
- 发布多模态决策模型 Clef-omni:基于阿里巴巴开源的 Qwen3-Omni-30B-A3B-Instruct 混合专家(MoE)模型改造,在文本和图像之外原生支持音频(WAV/MP3)与视频(MP4/WebM)输入;
- Clef-flash 大幅降价:Workers AI 托管输入单价降至 $0.038 / M tokens(降幅 57.8%),托管上下文窗口缩至 24,576 tokens(开源权重训练支持 256k);
- Clef 托管版显著提速:模型权重不变,通过服务层优化,三档测试的中位数耗时缩短约 40%—51%。
先理解输入,再直接给选项打分
以一张报修单为例:系统同时问“紧不紧急”“交给哪个团队”“影响有多严重”,并为每个问题列出允许的答案。
生成式 LLM 通常先理解材料,再逐 token 写出答案;Clef 省掉后一步。它让输入通过负责理解的骨干网络,再交给一个小型评分模块:先由各候选选项从输入中提取相关证据,再结合不同问题的信息,给所有选项打分。 这就是两阶段注意力路由。每个问题的分数随后被转换为概率,业务程序据此派单或转人工。
同一个判断,两条计算路径
差别在于怎样产出答案;输入理解依然需要模型计算。
传入工单或模型支持的媒体,说明要返回哪些字段。
读完输入,再依次生成回答。结构化输出可约束格式。
例如解释原因、写回复或生成结构化结果;仍需校验业务含义。
部门:技术 / 支付 / 销售;紧急:是 / 否。
各选项从输入取证,字段间联合处理,一次给所有问题的选项打分。
不逐字写答案;程序拿到概率后决定路由或转人工。
省掉的是逐字生成答案这一步
输入越长、媒体越多,理解输入本身仍可能更慢。合法选项中也可能选错;概率校准是训练与评估问题,不能由输出格式保证。
训练时,Cloudflare 冻结骨干,训练 LoRA 适配参数与评分模块,既优化选项判断,也用 Brier 损失改善概率校准。但把分数归一化为概率的 Softmax,本身不能保证“报 0.8 的判断就有 80% 正确率”;格式合法,也可能选错。
它还减少了为每个分类任务单独训练模型的工作。 今天把工单分给支付、技术、销售,明天把帖子分成求助、反馈、广告,可以更换请求里的问题与选项描述后测试效果,不必每换一套标签就先训练专用分类器。
Omni 如何一起看画面、听声音?
以设备巡检为例,语音转录能保留“人说了什么”,电机摩擦声却未必能转成文字;画面能提供部件状态,声音能提供运行线索。直接结合音画,既减少串联服务,也有机会保留转成文字时丢失的证据。 支持相应媒体的通用多模态 LLM 也能直接处理输入;Omni 的特色是把这些信息用于受限选项评分。
一个 API 简化了调用方的转录、拆分与拼接工作,模型内部仍会编码媒体、抽取视频帧:
- 视频按 2 fps 采样,可能漏掉短暂闪烁等瞬态事件;
- 同一请求中的所有视频都带音轨时,才同时解析视频声音;
- 推理只使用 Qwen3-Omni 的理解骨干及音视觉编码器。语音生成权重仍在开源仓库中,但不加载、不使用。
Cloudflare 报告的测试中,纯文本决策中位数耗时约 130 ms,图像输入约 150 ms,音频片段约数百毫秒;一段 21 秒的带声视频评分约 1.5 秒。
能接收更多输入,不代表每项任务都更强
三款模型各有侧重:Flash(9B 稠密)主打低成本,Clef(27B 稠密)侧重精度与较长上下文,Omni(30B-A3B MoE)增加音视频输入。选型还要看具体任务,不能只看参数量。
任务变了,领先者也会变
Cloudflare 自测:同一行可比较,不同指标不能相加排名。
Cloudflare 自测中,Omni 在 BANKING77、CLINC150+OOS 意图分类上的 macro-F1 分别为 94.8% 和 97.7%,与 Clef 接近;但在家电指令模拟中,Flash 的 97.73% 明显高于 Omni 的 69.30%。When2Call 调用时机判断则由 Jev 领先(80.97%,Omni 为 63.30%)。这些主要是文本与指令测试,不能当成音视频专项准确率。
还要看指标要求什么:Omni 的发票处理主要动作正确率为 82.0%,完整动作集合一致率只有 60.2%。前者看关键动作,后者要求整组动作匹配。若业务需要整套处理都正确,就不能拿 82% 当作流程成功率。
便宜了多少,又少了多少上下文?
Workers AI 当前三款模型的托管配置与单价如下(均不收取输出 Token 费用):
| 模型 | 托管上下文(tokens) | 每百万输入 tokens |
|---|---|---|
| Clef-flash | 24,576 | $0.038 |
| Clef | 65,536 | $0.24 |
| Clef-omni | 64,000 | $0.15 |
Flash 的降价伴随托管窗口从 64k 缩至 24k。Cloudflare 的依据是:其线上仅 0.24% 的请求超过 24k tokens。开源权重没变,训练时支持 256k 窗口;需要长上下文,可以考虑 Clef,或按硬件条件自托管 Flash。
按每次 1,000 输入 tokens、调用 100 万次计算,Flash 的模型费用从 90 美元降到 38 美元。这里的单价单位是百万 tokens,不是百万次调用。
在多模态输入方面,Workers AI 要求媒体以 Base64 data URL 提交,不接受远程 URL:
- 媒体配额:单次最多 4 张图片、4 段音频(单段 ≤300 秒)、2 段视频(单段 ≤60 秒,2 fps 抽帧);另外还有文件大小与像素限制,见 Workers AI 媒体规格文档;
- Token 折算:音频按时长约 13 tokens/秒(780 tokens/分钟);480p 视频每分钟画面约消耗 8,600 tokens(最高画质约 15,400 tokens/分钟),符合前述音轨条件时,声音另按音频折算;
- 超限与截断规则:媒体折算 Token 与 questions 共同计入上下文窗口,若二者之和超限请求直接报错拒绝;只有在媒体与问题未超限、但加上 state 整体超出时,文本 state 才会自动截断。
改一改输入,看看成本和窗口取舍
按 100 万次相同请求估算输入费;只检查模态与 token 预算,不判断模型效果。
公式:单次 token × 调用次数 ÷ 1,000,000 × 每百万 token 单价。图片按上限、媒体按约数估计;视频此处不带声轨。上传字节数、问题长度分配及其他服务费未计算。超窗口时暂停报价:媒体与问题超限会失败,否则文字 state 可能被截断;请先检查实际输入。
假设评估一段 3 分钟音频(约 2,340 tokens)附带 800 tokens 文本问题(合计 3,140 tokens),以 Clef-omni 的 $0.15 / M 单价计算,调用 100 万次纯推理费约为 471 美元(不包含媒体存储与传输带宽等其他云基础设施成本)。
Clef 没换权重,为什么能更快?
Clef 这次提速来自服务层。Cloudflare 公布了三档输入的中位数耗时:
| 输入规模 | 优化前中位数耗时 | 优化后中位数耗时 | 中位数提速倍率 |
|---|---|---|---|
| ~800 tokens | 262 ms | 152 ms | 1.7× |
| ~3,400 tokens | 616 ms | 305 ms | 2.0× |
| ~16,000 tokens | 2,721 ms | 1,635 ms | 1.7× |
模型权重未变,迁移至 SGLang 是优化之一(Cloudflare 提交了 PR #42721,预定在 SGLang 0.5.22 中正式支持)。
自托管部署的注意事项
权重以 Apache 2.0 许可开放,但自托管仍需算硬件账。Omni 的 30B 是总参数,3B 是每次激活参数,不等于只需装载 3B 权重。模型卡给出的 bfloat16 骨干显存约 64 GB(测试使用 H200),还需额外预留输入、缓存和运行空间。Clef 已提供 SGLang 启动方案;Omni 模型卡仍标注该方案“coming soon”。
怎样接进现有工作流?
接口用 state 放待判断材料,用 questions 定义问题与答案。报修单的三问对应三种题型:
noul:紧不紧急?返回“是”的概率。choice:交给哪个团队?返回一个选项及各选项概率。score:影响多严重?按从 0 开始的有序等级,返回概率加权的期望分值。
Clef 兼容 Jev/SystemOne 接口,也支持通过 AI Gateway 接入。已有兼容流程可以切换模型做替换测试;重新测误判率、耗时和处理阈值后,再决定哪些分支适合自动执行。
Cloudflare 已把它用在哪里?
Cloudflare 披露的 Clef 家族应用包括:文档仓库识别并关闭垃圾 Issue,EmDash 审核插件库的钓鱼风险,DLP 团队扫描身份证件等个人身份信息,威胁情报团队识别恶意域名。这些案例并未全部指定使用 Omni。
决策模型让代码能处理难以穷举规则的小判断:低风险、验证可靠的分支自动处理,不确定或高风险的情况交给人工。需要自由写作与开放式规划时,仍由生成式模型承担。
Cloudflare 开源其多模态决策模型 Clef:能听声音、看视频、直接做判断
先理解材料,再为允许的答案打分
Clef 省去逐 token 生成答案。Omni 基于阿里开源的 Qwen3-Omni-30B-A3B-Instruct 改造:画面提供部件状态,声音保留转录可能丢失的电机异响线索。
加上问题与候选答案
编码输入内容
再结合不同问题打分
派单或转人工
换分类任务时,可改问题和选项后测试,不必每换一套标签就先训练专用分类器。
按任务选模型,再算输入账单
| 模型 / 侧重 | 托管窗口 tokens | 美元 / 百万 输入 tokens |
|---|---|---|
| Flash · 低成本 | 24,576 | $0.038 |
| Clef · 精度与长文 | 65,536 | $0.24 |
| Omni · 音视频 | 64,000 | $0.15 |
原价 $90;三款均不收输出 Token 费用
Flash 降价伴随托管窗口由 64k 缩至 24k:官方线上仅 0.24% 的请求超 24k。开源权重训练支持的 256k 窗口未变。
Clef 权重没变,提速来自服务层优化,中位数耗时减少约 40%—51%;SGLang 迁移是优化之一。
更多模态,不等于每项任务更准
Introducing Clef-omni with full multimodality, plus a faster Clef and a cheaper Clef-flash
We are expanding the Clef decision model family with Clef-omni, natively processing audio, video, images, and text in a single pipeline.
Following last week’s release of Clef and Clef-flash, Cloudflare’s open-weight decision models, we decided to bring forth more gifts. Today, we’re releasing Clef-omni, which takes in audio and video input alongside text and image. We also cut the price of Clef-flash so it is now cheaper than Jev, and we made Clef faster.
Although the model game is still early for Cloudflare, innovation and iteration is in our DNA, and we apply these principles to everything we do. In fact, the story of Clef came together over the course of less than a week. We decided we wanted to do something in the decision model space on a Friday evening, trained the model over the weekend, and launched it on Thursday. Even with such a short timeline, we were able to ship performant, high-quality, open-weight models for the community — imagine what more we can do in the future.
For today, we’re excited to keep up the momentum with new additions and improvements to our Clef family of models. This is just the beginning, and we’ll continue to get better, faster, cheaper, and more innovative.
Clef-omni takes audio, video, image, and text input
Our new Clef-omni model is able to take audio, video, image, and text input. This changes the paradigm for decision models, which have been largely text-only since the debut of Jev from TypeSafe. With Clef, we supported images and video frame arrays, but Clef-omni is able to take in audio (wav or mp3) and video (mp4 or webm) alongside text and images.
Instead of setting up cascading pipelines of models that transcribe speech-to-text, or splitting audio and image channels from video, you can just call one model to make decisions across any modality. We are now one step closer to a model that is able to interact with the world as we experience it — through audio, visual, and textual communication, all in one.
Check out our developer docs for the new Clef-omni model. We also released the model open-weights on HuggingFace. For a quick start, here’s how you can send new modality inputs to Clef-omni:
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/cloudflare/clef-omni \
-X POST \
-H "Authorization: Bearer $CLOUDFLARE_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "clef-omni",
"state": "Review the installation: a photo of the unit, an audio recording of it running, and a video of the fan.",
"images": ["data:image/png;base64,<base64-png>"],
"audio": ["data:audio/mpeg;base64,<base64-mp3>"],
"videos": ["data:video/mp4;base64,<base64-mp4>"],
"questions": {
"label_visible": {"type": "noul", "instructions": "Is the model and serial number label visible in the photo?"},
"sounds_normal": {"type": "noul", "instructions": "Does the unit sound like it is running smoothly, without rattling or grinding?"},
"fan_running": {"type": "noul", "instructions": "Is the fan running in the video?"}
}
}'Clef-omni expands our open-weight decision architecture to natively handle multimodal workflows. We built this on a Qwen3-Omni-30B-A3B-Instruct mixture-of-experts (MoE) foundation, where the model was already capable of processing text, imagery, audio, and video directly within a single pipeline. However, we adopt the primary comprehension backbone while discarding the text-to-speech output components. In production, Clef-omni executes a quick prefill pass across the complete payload, scoring all modalities and valid parameter options simultaneously.
Because we skip output token generation since Clef models are not Large Language Models (LLMs), we remove the overhead of transcribing or captioning incoming files. Media elements map straight into the unified sequence, where video and audio are synced with visual frames for joint processing. Clef-omni then pulls candidate values directly from internal embeddings using our two-stage attention routing: every valid option gathers key evidence from the input (regardless if they are buried in text snippets, visual elements, or audio streams) before field vectors cross-attend across the full context to compute confidence scores. We add a built-in lexical grammar that preserves option semantics, so that we can deliver fast, schema-constrained scoring across every input type.
We train the model with the same techniques as we did with Clef — freezing the Qwen3 backbone, training low-rank adapters (LoRA), and applying our standard post-training approach: combining label-smoothed cross-entropy loss with Brier score calibration. The result is a model that is resilient and designed to succeed regardless of schema variations, field ordering, and prompt structures.
This brings several core upgrades to the Clef model family. Calibrated, schema-bound decisions now seamlessly handle text, images, audio, and synchronized video in a single API call. It's also fast. Text-only decisions return in about 130 ms at the median, image inputs in about 150 ms, and audio clips in a few hundred milliseconds. Even a full 21-second video clip with sound is scored in about 1.5 seconds, all in a single API call.
Our benchmarking shows strong performance across benchmarks, even with new modalities and MoE architecture.
| Benchmark | Clef-omni | Clef | Clef-flash | Jev |
|---|---|---|---|---|
| BFCL · case exact | 98.2 | 98.47 | 98.76 | 95.75 |
| ToolRet · nDCG@10 | 66.6 | 69.19 | 66.43 | 65.28 |
| API-Bank · accuracy | 92.7 | 91.93 | 93.11 | 88.19 |
| Home appliances · case exact | 69.3 | 82.95 | 97.73 | 52.27 |
| When2Call · accuracy | 63.3 | 72.37 | 65.58 | 80.97 |
| BANKING77 · macro-F1 | 94.8 | 94.20 | 90.93 | 79.74 |
| CLINC150+OOS · macro-F1 | 97.7 | 97.43 | 66.77 | 89.27 |
| BRIGHT · nDCG@10 | 42.0 | 45.91 | 39.26 | 47.52 |
| Amazon ESCI · macro-F1 | 57.8 | 57.48 | 57.39 | 55.21 |
| PhishNChips · accuracy | 73.2 | 79.60 | 75.05 | 62.55 |
We also benchmarked against the TypeSafe evals to show how Clef-omni performs.
| Workflow | Metric | Clef-Omni | Clef | Clef-flash | Jev |
|---|---|---|---|---|---|
| Invoice processing | Exact actions | 60.2 | 64.7 | 57.1 | 61.8 |
| Invoice processing | Primary action | 82.0 | 86.2 | 73.3 | 83.1 |
| Customer service | Exact actions | 71.6 | 76.3 | 77.0 | 76.0 |
| Security incidents | Exact actions | 61.7 | 62.9 | 61.7 | 61.7 |
| Agent trace observability | Primary action | 65.8 | 68.5 | 69.8 | 71.6 |
Clef-flash model is now cheaper
We heard your feedback — you want a decision model affordable enough to incorporate into any workflow. We’ve made a few optimizations and can now offer Clef-flash at cheaper prices. We want Clef to be able to make decisions that scale for you across all your agentic workflows, and now our pricing also incentivizes that.
We were able to optimize the model to the point where Clef-flash is now cheaper than Jev while still being performant and high-quality. Check out the developer docs for the most up-to-date pricing information at all times, including more detail on how image and audio modalities are converted to input tokens for pricing.
- Clef-flash – originally $0.09 per M input tokens, now $0.038 per M input tokens
- Clef – remains at $0.24 per M input tokens
- Clef-omni – launched today at $0.15 per M input tokens
However, one trade-off we have to make in order to have cheaper pricing is to cut the context window of Clef-flash. The hosted version of Clef-flash now has a context window of 24k, instead of 64k as previously advertised. The model weights on Hugging Face are untouched and were trained to support a 256k context window should you choose to self-host it.
From our usage data, we see that only 0.24% of requests exceed 24k input tokens. Based on this data, we decided to make the call to drop the context window to 24k for Clef-flash in order to price it at a more accessible entry point. Our Clef model remains at a 64k context window, and we encourage folks with larger context needs to switch to Clef instead of Clef-flash.
Clef model is now faster
Speeds are also faster for the Clef model, with new optimizations to the hosted version of Clef on Workers AI. No new model weights are released because most of the optimizations we made are at the serving infrastructure layer, not materially to the model weights or architecture. Check out our new speeds below:
| Input size | Before: median / p95 (ms) | Now: median / p95 (ms) | Median speedup |
|---|---|---|---|
| ~800 tokens | 262 / 438 | 152 / 351 | 1.7× |
| ~3,400 tokens | 616 / 777 | 305 / 531 | 2.0× |
| ~16,000 tokens | 2,721 / 3,250 | 1,635 / 1,805 | 1.7× |
One of the optimizations we made was to move to SGLang for serving the model. We worked with the SGLang team and made pull requests to incorporate Clef (PR #42721), which will be released in SGLang 0.5.22. You can also self-host Clef since we released the weights, and the new SGLang launch commands are available on our updated Hugging Face repo as well as the SGLang cookbooks.
How are people using Clef?
At Cloudflare, we’ve had teams experimenting with Clef as a model that can help classify over general domains. The coolest thing about watching teams adopt Clef is that the capability to do detections and classifications have moved into the model layer, where it is accessible for anyone to start incorporating decision models into their use cases. Previously, even with zero-shot classifiers, the small models may not have been powerful enough to classify across any domain without further tuning. You might have needed to stand up a specialized machine learning team to help train over your particular domain, and gather a corpus of data in order to train a better model. Now, all you need to do is call a model to instantly parse through input data with precision.
A few highlights of how teams at Cloudflare are using Clef: Our public GitHub docs repo uses Clef to instantly detect and close spam issues. EmDash, our content management system, moderates plugin libraries for phishing. Our data loss prevention team is scanning data for potential personally identifiable information (PII) like government IDs. And our threat intelligence team is using Clef to help detect malicious domains.
Give it a try!
We’re excited to bring you more from the Clef family of models, including new modalities like audio and video, as well as making the model more accessible with cheaper pricing and faster speeds. Clef is fully Jev-API compatible and available via AI Gateway, so it is as simple as changing the model ID to try out Clef today. Check out our developer docs for more information.
Thank you for all the love and warm reception around Cloudflare’s first models — we are focused on bringing you more. Try out our Clef family of models, and tell us what you think.
