Dev.to
7/20/2026

We built one AI tutor for five completely different subjects — here's the routing layer that keeps it from falling over
Short summary
A team built a multi-subject AI tutor with 60+ features backed by a single registry-based routing layer that manages model chains, fallbacks, automatic refunds, and caching policies. Key lessons include treating thinking-token costs as a major budget leak, making invisible feedback loops explicit (a hidden 'quiz' keyword meant mastery scores never updated), and replacing swallowed errors with user-facing error states. The post is a practical engineering retrospective on the unglamorous plumbing AI products need but rarely ship on day one.
- •Registry-based routing with primary+fallback model chains and automatic price refunds
- •Thinking tokens were the single largest cost leak — forced a full redesign
- •Mastery system was silently broken because only a hidden chat keyword triggered quiz write-backs
Generated with AI, which can make mistakes.
Is this a good recommendation for you?


