Cloudflare cut its AI code reviewer's inference bill by 68% with prompt caching and model routing

DanielLockyer · x · 2026-10-20

Cloudflare's postmortem on its AI code reviewer: with no architectural changes, average review cost climbed from $1.19 in April to $2.46 by late August. After auditing where tokens were going, the team cut average cost to $0.77 — down 68% from the $2.43 averaged over the two most expensive weeks — via reviewer code changes (40% of savings) and experimenting with model choice and effort levels (60%). Median review time also dropped from 4m09s to 1m32s.

Why costs rose: better models led engineers to produce larger, more complex changes, pushing more reviews into the most expensive "full review" tier (59% in March → 65% in August). Key levers included prompt caching and intelligent, risk-tiered model routing.

Original post →

More from coding & agent

coding & agent channel →