LLM Inference Economics from First Principles