Start here. This is the direct spoken answer to practice first.
Overview
Latency and cost are architectural constraints because every model, tool, retry, and context decision consumes the same user budget.
I start with an end-to-end user latency target and an acceptable cost per successful task, then allocate budgets across retrieval, tools, model generation, validation, and retries. Requests have input, output, tool-call, and attempt limits enforced by the application. The system stops or degrades when the remaining budget cannot produce a useful result.