Cost, Limits and Production
Show what an answer costs, stop one user from emptying the budget, keep working when a provider is down, cache safely, measure without spying, and test every state.
A demo works once. A product works on a bad day: the provider is slow, one user asks a thousand questions, the bill arrives, and nobody can tell from the logs whether the feature is any good. This phase is about everything that happens after "it streams on my laptop".
You will count tokens before and after a request, enforce daily limits on the server and show them honestly in the screen, fall back to a second model and a kill switch, cache answers without leaking one person's data to another, measure speed and failures without logging what people typed, and test every state of the chat with a scripted model.
Every example runs against the scripted stand-in model, with made-up prices and limits. No real price, model name or rate limit appears anywhere in this phase: they change often, so read your provider's current price and limits pages. By the end Mitra has a usage meter, a daily limit, a backup model, a cache, a kill switch and a test suite.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.