The compute and pricing drivers of serving a trained model, from prefill and decode through model size, asymmetric token pricing, context length, the KV cache, batching and utilization, hosted API pricing, per-request cost estimation, retries and agent loops, self-hosting economics, and production cost measurement. Splits inference into its two cost phases; works the FLOPs and memory-bandwidth math behind model-size cost; explains why input and output tokens are priced asymmetrically with real current provider rates; derives the KV cache memory bill; shows how batching and utilization set unit economics; builds a full worked pricing example; gives a general per-request cost estimator; prices failure paths and agent loops; refreshes the self-hosting break-even in terms of utilization; and ends with what to instrument in production.
Want me to explain it differently?
AI concepts can be dense. Tell me what's confusing and I'll find a new analogy.