Skill 7.4.3
Optimize the cost of AI and GPU workloads
Key Concepts
Generative AI services are usually priced per token: input tokens (the prompt and context), output tokens (the response), and often discounted cached input tokens. Output tokens usually cost several times more than input tokens, and larger models cost more per token. Some services offer provisioned throughput at a fixed hourly price for guaranteed capacity, and batch inference at a discount for requests that can wait. Self-hosted models and training are priced by GPU or accelerator hours.
Optimization levers include choosing the smallest model that meets quality requirements, routing simple requests to cheaper models, prompt caching for repeated context, shortening prompts with retrieval of only relevant content, limiting output length, using batch inference for offline work, and shutting down idle GPU endpoints and notebooks, which charge by the hour whether used or not.
AI cost should be measured per unit of value, such as cost per conversation, per document processed or per successful task, because token volumes grow with adoption and total spend alone does not show efficiency.