Dev.to
7/22/2026

The Cheap Way to Add AI Review to CI: Small Local Models Plus Prompt Caching
Short summary
The author describes a two-tier AI code review system for CI that cuts costs dramatically. A cheap local model (Ollama + qwen2.5-coder) triages diffs for risk; only high-risk changes escalate to a frontier model with prompt caching for the stable system prompt and repo context. Most PRs (docs, tests, formatting) never reach the expensive model.
- •Two-tier AI code review: cheap model triages, expensive model reviews only risky diffs
- •Prompt caching on stable prefixes (rubric + repo context) reduces per-review cost
- •Includes a working GitHub Actions workflow with conditional escalation
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



