8 min read
Spend is the product of request volume, tokens per request by type (uncached input, cached input, output) and the price of the model handling each request, multiplied by retries and agent loops. Start by attributing spend per feature and token type, then test the lowest-risk levers first: stable prompt prefixes for caching, context and output budgets, batch for offline work, and only then routing to cheaper models against an eval set.
8 min read
Sum every cost incurred to attempt a task (all model calls by token type, retries, failed runs, tool and retrieval costs, and human review time), then divide by the number of tasks that met predefined success criteria. Compute it per feature and per release from your own usage logs, so model, prompt and routing changes can be compared on outcome, not on token price.
8 min read
Use RAG when the model needs knowledge that changes, is large, must be cited or is access-controlled. Consider fine-tuning when the gap is behavior: a consistent output format, a narrow classification or extraction task, a style, or moving a high-volume task to a smaller model. Decide with a held-out eval set, after a strong prompt-only baseline, because many apparent RAG-versus-fine-tuning questions are actually task design problems.