Concept · Builds on AIF-C01
FM inference costs and token monitoring
Work out cost from tokens, choose the model tier and buying mode by traffic shape, and count tokens by tag.
You know from AI Practitioner
- You pay for input tokens and output tokens, and output usually costs more.
- Longer prompts, longer answers and larger models cost more.
- Shorter prompts, capped answers and a smaller model that is good enough cut cost.
On-demand
- Pay
- Per input and output token
- Best for
- Spiky or unknown traffic
Provisioned, no commitment
- Pay
- Hourly per model unit
- Best for
- Short, steady peaks
Provisioned, 1 or 6 months
- Pay
- Lower hourly rate
- Best for
- Long, steady traffic
Batch inference
- Pay
- Lower per-token price
- Best for
- Work that can wait
| Mode | Pay | Best for |
|---|---|---|
| On-demand | Per input and output token | Spiky or unknown traffic |
| Provisioned, no commitment | Hourly per model unit | Short, steady peaks |
| Provisioned, 1 or 6 months | Lower hourly rate | Long, steady traffic |
| Batch inference | Lower per-token price | Work that can wait |
Model tokens
- What drives it
- Prompt, answer and model tier
- Watch with
- InputTokenCount, OutputTokenCount
Embeddings
- What drives it
- Documents, updates, queries
- Watch with
- Embedding call counts
Vector store
- What drives it
- Vectors, dimensions, compute
- Watch with
- Store storage and compute metrics
Per team or app
- What drives it
- Who calls the model
- Watch with
- Tags, invocation logs
| Cost source | What drives it | Watch with |
|---|---|---|
| Model tokens | Prompt, answer and model tier | InputTokenCount, OutputTokenCount |
| Embeddings | Documents, updates, queries | Embedding call counts |
| Vector store | Vectors, dimensions, compute | Store storage and compute metrics |
| Per team or app | Who calls the model | Tags, invocation logs |
1 / 2
Model tokens
- What drives it
- Prompt, answer and model tier
- Watch with
- InputTokenCount, OutputTokenCount
Embeddings
- What drives it
- Documents, updates, queries
- Watch with
- Embedding call counts
Vector store
- What drives it
- Vectors, dimensions, compute
- Watch with
- Store storage and compute metrics
| Cost source | What drives it | Watch with |
|---|---|---|
| Model tokens | Prompt, answer and model tier | InputTokenCount, OutputTokenCount |
| Embeddings | Documents, updates, queries | Embedding call counts |
| Vector store | Vectors, dimensions, compute | Store storage and compute metrics |
2 / 2
Per team or app
- What drives it
- Who calls the model
- Watch with
- Tags, invocation logs
| Cost source | What drives it | Watch with |
|---|---|---|
| Per team or app | Who calls the model | Tags, invocation logs |
What it is
Cost per request is input tokens times the input price plus output tokens times the output price. Multiply by requests per month. Model tier is the biggest lever: a small model can cost a fraction of a large one per token, so test it against your quality bar first.
What it is
On-demand billing suits spiky or unknown traffic. Provisioned Throughput reserves model units at an hourly price, with no commitment or a 1-month or 6-month commitment at a lower rate. Break-even is where the on-demand bill for steady traffic passes the hourly price of the units you need. For example, 3,000 dollars on demand against 2,000 dollars for units favors provisioned, but only if traffic stays high all day. Unused hours are still billed.
What it is
RAG adds costs. Embedding models bill by input tokens: once to index, again when documents or the embedding model change, and for each query. The vector store bills for storage and, for some stores, always-on compute. Storage grows with dimensions: 1 million vectors of 1,024 float32 values take about 4 GB before index overhead. Track tokens with the InputTokenCount and OutputTokenCount metrics, invocation logs, and tags on profiles or requests, so each application and team has its own count. Alarm on token metrics to catch a runaway loop.
Remember
- Provisioned Throughput pays by the hour, used or not. On-demand pays per token.
- Provisioned wins only for steady, high traffic.
- Track tokens by metric, log and tag. Alarm on spikes.
On the exam
- “Steady, predictable, high-volume traffic” points to Provisioned Throughput.
- “Unpredictable or low traffic” points to on-demand pricing.
- “Cost of one app is rising, find which one” points to application inference profiles and token metrics.
- “Cheapest option that still passes quality tests” points to a smaller model tier.
Do not mix it up with
- Reducing FM usage costSpend fewer tokens, send each token to the cheapest place that works, and avoid repeat calls.
- Cost tools, tags and spending limitsTag everything, activate the tags, then watch spend with Cost Explorer and Budgets. Use inference profiles to split Bedrock costs.
- Provisioned vs on-demand resourcesPay per use or reserve capacity: when each wins for Bedrock, SageMaker AI, Lambda and training.
In this task · 4.2
- Inference instance families
- Inference Recommender and right-sizing
- CloudWatch metrics and dashboards for ML
- Logs and tracing to troubleshoot ML systems
- Capacity, quotas and throttling
- Cost tools, tags and spending limits
- Purchasing options for ML infrastructure
- FM inference costs and token monitoring
- Reducing FM usage cost