All courses / AI Platform and Security / Module 5 / Chapter 22
Learning objectives
After the lesson the participant can:
- Explain each term of the inference cost formula as an architectural decision.
- Compare the levers of caching, routing and batching by the cost driver each acts on.
- Draft a cost policy with budget alerts, a hard cap with fallback, and a unit-economics target.
- Calculate a Software Carbon Intensity score for a use case and state its boundary and limitations.
Key concepts
- Token economics
- The cost of a request is roughly input tokens times the input rate plus output tokens times the output rate, multiplied by request volume. Input tokens come from the system prompt, retrieved context, history and the user's message.
- Routing policy
- A gateway configuration that classifies each request and sends it to the cheapest model that meets the quality objective from the evaluation suite. Each route names its evidence, and a fallback makes behaviour under budget exhaustion explicit.
- Chargeback and showback
- Attribution of tokens and GPU hours through the gateway to use case and team. Whether the consuming team pays or is merely informed is a management decision; the architecture is the same.
- Unit economics
- Cost set against a unit of work, such as a resolved enquiry or a processed claim. It relates spending to value and is the figure a steering committee can act on, unlike cost per request.
- Software Carbon Intensity (SCI)
- The specification published as ISO/IEC 21031:2024: energy consumed times the carbon intensity of the electricity, plus embodied emissions of allocated hardware, divided by the functional unit. It rewards reduction, so purchased offsets do not lower the score.
Interactive exercises
Do them here and get feedback at once. Choose a card and then where it belongs, or drag it.
Interactive exercise 1 · Sort
Which lever is it?
Sort each measure under the serving-layer lever it belongs to.
Interactive exercise 2 · Scenario
The budget runs out in the third quarter
Apply the chapter's cost policy to a successful service at Nordvik Region.
Teaching plan
| 10 min | The teacher writes the token formula on the board and participants name who in their organisation controls each term. |
| 20 min | Cover capacity planning with Nordvik Region's GPU plan, then the three levers and the routing policy, asking what each route's rationale rests on. |
| 15 min | Present the cost policy figures and the showback finding on the eligibility-explanation route, then walk the SCI calculation line by line. |
| 25 min | Exercise: participants draft a cost policy and compute an SCI score for one use case from given or estimated figures. |
| 5 min | Close with the fit between consumption pricing and annual appropriations in public authorities. |
Discussion
- A two-thousand-token system prompt sent with every request is called a fixed cost nobody chose deliberately. Which costs in your AI services did nobody choose?
- The fallback on budget exhaustion is the difference between a cost policy and a cost surprise. What should your most used AI service do when its budget is exhausted?
- Which functional unit would make cost and carbon comparable across your AI use cases, and who would have to agree to it?
Written exercise
Exercise · 25 minutes
A cost policy and an SCI calculation
For one AI use case of your own, or for Nordvik Region's citizen FAQ service, draft a cost policy: the monthly budget, alert levels, a hard cap and what the gateway falls back to when it is reached, the pipeline threshold for a cost increase that needs the cost owner's approval, and a target cost per unit of work. Then calculate an SCI score using the chapter's formula: state the functional unit, the boundary with what is included and excluded, the energy and how it was measured or estimated, the carbon intensity and its source, the embodied emissions allocated, and the number of functional units. Add one sensitivity line and the known limitations.
Deliverable: A cost policy of about ten lines and an SCI record with boundary, method, result against a target, a sensitivity line and limitations.
Self-test
Choose an answer to see whether it is right, or open the answer below each question.
What did the weekly showback report at Nordvik Region reveal about the eligibility-explanation route?
Show the answer
D. With the fewest requests it carried 40 per cent of spend for 13 per cent of resolved enquiries
The finding only becomes visible when cost is set against a unit of work, which is why the chapter calls unit economics the most useful line in a cost policy.What does the chapter call the most common mistake in GPU capacity planning?
Show the answer
B. Sizing for the interactive peak and leaving capacity idle at night
Scheduling batch work into the troughs raises utilisation, and utilisation is the largest determinant of cost per request for self-hosted models.How can a Software Carbon Intensity score be improved, according to the chapter?
Show the answer
A. Only by less energy per unit, cleaner energy or less allocated hardware; offsets do not lower it
SCI rewards reduction, and each way of improving it maps to a lever: routing to a smaller model, a low-carbon grid, and batching.