This chapter treats cost and energy as architectural constraints of AI systems rather than as bills that arrive after the design is finished. It extends the cost optimisation discipline of Architecture as Code (Chapter 15B) (72, Nordqvist, 2025), where budgets and tagging are declared in code and enforced by pipelines, to the specific economics of models: token-based pricing, scarce accelerators, and an energy footprint now visible to regulators, investors, and citizens. It covers inference cost, GPU capacity, cost levers, FinOps, and carbon accounting with the Software Carbon Intensity specification (30, Green Software Foundation, 2024).
The response is the same as for any other characteristic: declare the constraint in a cost policy under version control, measure it through telemetry attributed to system, team, and use case, enforce it through pipeline gates and runtime controls, and design for it through the levers in Figure 22.1. Principle eight in AI Governance, Chapter 4, sustainability and cost as design constraints, is the statement of intent; this chapter is its implementation.
A hosted LLM is priced per token, with separate rates for input and output, and sometimes a reduced rate for cached input. Output tokens cost more because each requires a full forward pass, while input tokens are processed in parallel. The cost of a request is therefore roughly input tokens times the input rate plus output tokens times the output rate, multiplied by request volume for the system.
Primary topics explored
- Cost as an architectural constraint
- Token economics and inference cost models
- Capacity planning for GPUs
- Architectural levers: caching, routing, and batching
- FinOps for AI and chargeback
- Energy and carbon accounting
About AI Platform and Security
AI Platform and Security is Book 3 of The Transformed Architecture. It shows how large European enterprises and public authorities build, secure and operate the platform on which artificial intelligence runs: data, models and DevSecMLOps, retrieval and agents, infrastructure and sovereignty, AI security engineering, evaluation, observability and cost.
The companion volume AI Governance covers risk management, governance, assurance, organisation and leadership; Architecture as Code supplies the underlying discipline.
Platform engineers, security architects, MLOps teams, AI architects and technical decision-makers.
Continue with the full chapter
Chapter 22: Cost, Capacity and Sustainability of AI in AI Platform and Security gives the detailed explanations, practical examples and implementation patterns behind this summary.
This whitepaper belongs to “Delivery and Operations” and is one of 29 drawn from the manuscript.