Deep dive into Cloudflare Clef: a step-by-step PyTorch walkthrough of its decision-model architecture
amaarora · x · 2026-11-26
amaarora read Cloudflare's Clef source code line by line and published a step-by-step PyTorch walkthrough with runnable clef-flash CPU code.
- Clef uses a Qwen backbone whose outputs feed a JointSchemaHead with evidence routing, returning calibrated probabilities.
- The post covers data processing, the backbone, JointSchemaHead and EvidenceRoutingLayer with every tensor shape; uses the 9B clef-flash (Qwen3.5-9B) variant so it runs locally on CPU, with the JointSchemaHead identical to the 27B version.
- Excludes multimodal inputs and training/Brier loss (planned follow-up).
Related event: Deep Dive into Cloudflare's Clef Decision Model Architecture(2 posts)→
More from coding & agent
- Vibe coders habitually pick one thinking-effort tier higher than needed, out of caution — snowclipsed · 2026-11-26
- ASC CLI 7.6.0 upgrade guide: three breaking changes and safer catalog applies — rudrank · 2026-11-26
- asc CLI 7.5.0 upgrade: breaking changes to screenshots, receipts and price tiers — rudrank · 2026-11-26
- asc CLI adds Vietnam license, China permit and DSA trader status queries — rudrank · 2026-11-26
- asc CLI's publish testflight guards against duplicate tester notifications — rudrank · 2026-11-26
- asc CLI tester import is now idempotent with full CSV pre-check — rudrank · 2026-11-26