← TinyGPT · docs · devlog · roadmap · speedup
source: docs/prds/B34-batched-eval-runtime.md · view on GitHub ↗

PRD — Batched eval-runtime: steal oMLX’s batching + prefix-KV cache for the eval harness

Goal

Make tinyGPT’s eval harness fast and scalable by stealing the two oMLX techniques that fit eval’s workload — continuous batching and a persistent shared-prefix KV cache — and by making the harness drive a pluggable fast MLX backend instead of the in-house single-stream serve. The eval/judgment layer is the strategic asset post-A1; it’s only as good as how fast it runs. Pace consumes the same qualified backend.

Why now

What we steal (and what we don’t)

oMLX featureSteal for tinyGPT?Why
Continuous / iteration-level batchingYes — top priorityeval = many concurrent requests; biggest throughput lever
Persistent shared-prefix KV cacheYeseval requests share the system+tools prefix verbatim
Tiered KV cache RAM→SSDAdopt via backendlets eval drive big-context models; don’t reimplement
OpenAI + Anthropic dual APIYes (small)harness can drive any backend + matches Claude-Code clients
Native menu-bar app / general production servingNothat’s oMLX’s lane; don’t build runtime #5

Scope — in

Scope — out

Files to touch

FileChange
native-mac/Sources/TinyGPT/EvalHarnessSupport.swift--backend selector + concurrent submission helper
native-mac/Sources/TinyGPT/EvalBFCL.swift / EvalTauBench.swiftfire requests with bounded concurrency
native-mac/Sources/TinyGPT/* (Anthropic shim)new — Anthropic-format request adapter
scripts/eval-throughput-smoke.shnew — throughput A/B (tinygpt vs batched backend)
docs/learn/omlx-steals.mdnew — the steal rationale (house style)
docs/PLAN.mdB34 entry

Don’t touch

Acceptance criteria

Reference patterns

Open questions