[Feat] Add Cloudflare Clef / Clef-flash as a System One decision backend
维护者通常 1 天内回复
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 28/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
- 领域
- ai, backend-api-design
调研方向
Start with s1a/decision_models/factory.py and the existing served backends (clm, onejev), then read their shared contract tests and DecisionModel interface. Trace how Observation.images is represented and how served backends record URLs, request IDs, model names, usage, and deadlines. Done means the clef backend passes choice, noul, and image contract tests for Workers AI and local serving, with qualification runs and the specified capability and configuration documentation; score and video support must be stated.
由索引模型根据 Issue 内容生成。
描述
Why
Cloudflare released Clef (27B) and Clef-flash (9B) on 2026-10-01: open-weight, Apache-2.0, multimodal System One decision models that return a probability for every option of every typed question in one forward pass. They are advertised as Jev / System One compatible, with a vision encoder and a longer context than hosted Jev on the 27B model.
This repository still has no --model clef (or clef-flash). s1a/decision_models/factory.py registers jev, jev-vl-served, clm, laya, laya-served, cua, omnijev, onejev, random, and rule only. Clef is not a substitute for the open issues that qualify other checkpoints through an existing adapter:
- #103 qualifies Open-Jev 9B/27B on the local System One text path
- #108 qualifies Kev (
kev-0.6b-browser-useand Kev-4B) by pointingTYPESAFE_API_URLatkev.serve - #114 qualifies served OneJev 1.6
- #97 is TypeSafe image input on hosted Jev
Clef cannot ride those paths unchanged. Workers AI is not /v1/systemone: it is POST /client/v4/accounts/$ACCOUNT_ID/ai/run/@cf/cloudflare/clef (or clef-flash) with a Cloudflare token. Local serving (the model card's SGLang image) does speak POST /v1/systemone, but screenshots use Clef's images (and optional videos) field, not OneJev's media + <image:N> markers and not TypeSafe's image input. Our DecisionModel interface also has only choice and noul today; Clef's score type is out of scope here.
Official docs (context window and pricing from the Workers AI pages, not the blog's rounded 64k figure):
- Clef: 27B, 65,536-token context, $0.24 per M input tokens, no output-token charge — https://developers.cloudflare.com/workers-ai/models/clef/
- Clef-flash: 9B, 24,576-token context, $0.038 per M input tokens — https://developers.cloudflare.com/workers-ai/models/clef-flash/
- Announcement: https://blog.cloudflare.com/clef-decision-models/
- Weights (Apache-2.0): https://huggingface.co/Cloudflare/clef (Qwen3.8-27B backbone, revision checked 2026-11-19:
171287b2571042abec9e7b99752aee58216b0ed0) and https://huggingface.co/Cloudflare/clef-flash (Qwen3.5-9B) - Local serve:
lmsysorg/sglang:dev-clefas in the Clef model card;POST http://localhost:30000/v1/systemone
Do not copy Cloudflare's Decision Index or workflow-eval numbers into our docs as ours.
Proposed work
- Add
--model clef(variant viaCLEF_MODEL=clef|clef-flash, defaultclef-flashfor latency) that talks to either Workers AI or a local/v1/systemoneserver, selected by env (CLEF_URL/ Cloudflare account + token). Follow the existing served-backend pattern (clm,onejev): one deadline per decision, recordurl, request id, the served model name, and usage; fail closed on a missing URL/token or a bad body. Contract tests against a stub server; no live Cloudflare or GPU call in CI. - Text path first (choice + noul only): ticket-router or
s1a probe, plus one browser suite already in-tree (Allrecipes task 0 or the deterministic local search path used for Laya). Count every attempt (success, failure, timeout,BLOCKED), decision p50/p95, and hardware /S1A_DECISION_TIMEOUT_S. - Screenshot path: map
Observation.imagesto Clef'simagesarray (PNG/JPEG/WebP, max 4 per the Workers AI schema). An observation without an image may still run as text; do not pretend theonejevmedia mapping works. If Workers AI or the local server rejects or ignores a field of our body, document which field and stop rather than inventing a second shaping layer in this PR. - Add a Clef / Clef-flash row to
docs/capabilities.mdthat distinguishes "adapter wired" from "qualified on this checkpoint and path", link it from #54, and mention the env vars indocs/configuration.md.
Acceptance criteria
-
build_model("clef")is registered and covered by the shared decision-model contract tests (choice + noul; images when present). - Every claimed run names Agents SHA, checkpoint or Workers AI model id, path (Workers AI vs local SGLang), hardware, and timeout.
- Results under
docs/results/include failures in the denominator. No Decision Index figure is reported as an Agents result. - Docs state whether
scorequestions andvideosare unsupported on our interface.
Out of scope
- Adding a
ScoreQuestiontype tos1a/decision_models. - Fine-tuning or an in-process PyTorch loader (
joint_schema_model.py); HTTP only in this issue. - Replacing hosted Jev in the README headline table.
- Qualifying Open-Jev (#103), Kev (#108), or OneJev 1.6 (#114).
References
- https://blog.cloudflare.com/clef-decision-models/
- https://developers.cloudflare.com/workers-ai/models/clef/
- https://developers.cloudflare.com/workers-ai/models/clef-flash/
- https://huggingface.co/Cloudflare/clef
- https://huggingface.co/Cloudflare/clef-flash
- Related: #54 (roadmap backends), #103, #108, #114, #97, #88 (served OneJev media path)
- 主要语言
- Python
- 星标
- 120
- 派生
- 21
- 平均合并
- 17 小时 13 分钟
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ThinkFlowLab/system1-agents 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 30/100
ThinkFlowLab/system1-agents#129 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
ThinkFlowLab/system1-agents#130 ·
维护者通常 1 天内回复
-
[Eval] Measure cross-question interference when decide_many bundles questions可能已有人在做 @Birfy 于 3 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
ThinkFlowLab/system1-agents#127 ·
维护者通常 1 天内回复
-
[Eval] Measure a pre-execution tool-call gate (Jev noul on BEFORE_TOOL_CALL) on TS-Bench step-level labels可能已有人在做 @Birfy 于 10 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 38/100
ThinkFlowLab/system1-agents#122 ·
维护者通常 1 天内回复
-
[Eval] Add a seeded WebHarbor slice: locally reset, verifier-graded browser tasks (offline counterpart to #116)可能已有人在做 @Birfy 于 12 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 22/100
ThinkFlowLab/system1-agents#118 ·
维护者通常 1 天内回复
查看 ThinkFlowLab/system1-agents 的全部 Issue
相似的 Issue
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Pin Hugging Face commit revisions for AuK weight downloads and eliminate post-download SHA TOCTOU未关闭area:voice better-dependency-freedom dependencies effort:low in-progress model:medium plan planner:gemini-4-neon-high priority:2 security
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
needs-area-label
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
OpenFreeEnergy/openfe#2371 ·
维护者通常 2 天内回复
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)未关闭
难度 2/5 1-3 小时 新手友好度 80/100
NCATSTranslator/Babel#1269 ·
维护者通常 1 天内回复