Skip to content

feat: clef-text-0.6b (distilled from clef-flash) runtime + 1,000-ticket demo - #36

Merged
Alex-Wengg merged 1 commit into
mainfrom
feat/clef-text-demo
Oct 10, 2026
Merged

Alex-Wengg merged 1 commit into
mainfrom
feat/clef-text-demo

Conversation

@Alex-Wengg

Copy link
Copy Markdown
Member

Stacked on #34. Adds the 0.6B student distilled from Cloudflare clef-flash: FluidInference/clef-text-0.6b-coreml @ 3c61a609 (PyTorch: FluidInference/clef-text-0.6b).

  • ClefTextManager: Qwen3-0.6B + Clef joint head. One multifunction fp16 decoder (L256–L2048) plus an fp16 head; the host does the embedding gather, RoPE and causal mask. Runs on .cpuAndGPU (~48 ms per 3-question ticket) or 100% on the Neural Engine (~77 ms).
  • ClefTextModelStore: pinned revision, per-file SHA-256 (~1.3 GB).
  • ClefFlashDemo: CLEF_MODEL=text runs the 0.6B; fixed 1,000-ticket mock backlog with progress and total time ("1,000 tickets in 57 s"); bars.py CPU/GPU bar charts over macmon pipe (asitop crashes on M5 Pro, and the CPU/ANE power counters read 0 W on macOS 27).
  • ClefCompareDemo: 9B on the GPU and 0.6B on the ANE side by side (85% of decisions match, 5.6× faster).
  • ClefTextCheck: parity CLI. Swift vs PyTorch on the demo tickets: identical tokens, 0 / 60 flips.

Student quality (held-out test splits): 79.1 vs teacher 88.2. Classification is within 0–4 points; knowledge QA is far behind (table on the HF card).

Reviewer notes: ClefTextTests need no model. As in #34, they compile and run on CI only (no local XCTest).

🤖 Generated with Claude Code

@Alex-Wengg
Alex-Wengg changed the base branch from feat/clef-flash-demo to main October 10, 2026 17:14
…-ticket demo

ClefTextManager runs FluidInference/clef-text-0.6b-coreml (Qwen3-0.6B + Clef
joint head distilled from clef-flash): one multifunction fp16 decoder
(L256-L2048) + fp16 head, host embedding gather / RoPE / causal mask,
.cpuAndGPU or .cpuAndNeuralEngine. ClefTextModelStore pins @3c61a609 with
per-file SHA-256. Swift == PyTorch on the demo tickets (identical tokens,
0/60 flips, ~48 ms GPU / ~77 ms ANE per ticket).

ClefFlashDemo: CLEF_MODEL=text runs the 0.6B; fixed 1,000-ticket mock backlog
with progress / total time; queue updates without animation (tickets arrive
every ~50 ms); bars.py CPU / GPU bar charts over macmon replace the power pane.
ClefCompareDemo: 9B (GPU) and 0.6B (ANE) side by side. ClefTextCheck CLI for
parity runs.
@Alex-Wengg
Alex-Wengg merged commit 0230049 into main Oct 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant