Streaming, function calling, retries, and the UX patterns that hide latency.
Section
Stream Everything
Nobody waits 8 seconds. Stream tokens. Show progress. Reveal early.
Section
Function Calling
Give the model tools instead of asking it to guess. Deterministic parts run in code, not in text.
Section
Retries and Fallbacks
Every AI call fails eventually. Wrap in retry with backoff, cheaper fallback model on last try.
Section
UX for Uncertainty
Explain what the AI is doing. Show sources. Let the user edit the output.
Section
Cost per Feature
Log tokens on every call. Attribute cost to a feature, not the whole app.