Lesson 2 of 4 Cost Optimization for GenAI

Selecting Cost-Effective Models

This lesson covers a selection framework that chooses, for each task, the cheapest configuration that meets the quality target, and efficient inference patterns, since model choice is the largest cost lever.

Learning outcomes

After completing this lesson, you will be able to:

  • Evaluate the cost-capability trade-off for each task.
  • Assign models by query complexity.
  • Use batch inference, service tiers and other efficient patterns.
  • Choose models by cost per outcome.

Cost-capability trade-off evaluation

For each task, candidate models are evaluated on the task's evaluation set, recording quality, latency and cost per request. Plotting quality against cost shows the efficient choices: models that no other model beats on both. The price-to-performance ratio is often best expressed as cost per successful outcome: a cheaper model that fails more often may need retries, human correction or escalation that make it more expensive overall. The decision balances inference cost against the business cost of lower quality.

The following diagram compares the expected cost per ticket of two classification models, including the cost of their errors.

Cost per ticket including errors. Model A costs USD 0.002 per ticket and misclassifies 3%; model B costs USD 0.0004 and misclassifies 10%. At about USD 0.50 of agent time per error, the expected cost is about USD 0.017 for A and USD 0.050 for B, so the cheaper model is the more expensive choice.
Bar lengths are proportional to cost.
Fill in the number

Cost per successful outcome

Exam skills 4.1.2 · 5.1.2

Compare models by what each successful outcome costs, not by price per request.

Log in to try this activity Interactive activities are free with an account.

Tiered usage by query complexity

Most applications receive a mix of simple and complex requests, and sending all of them to the most capable model pays the highest price for work that a smaller model could do equally well. Tiered usage routes simple requests, such as greetings, frequently asked questions and short extractions, to small models or to a cache, and reserves large models for complex requests.

The tier can be chosen by a classifier, by rules, by a cascade that escalates only when a small model's answer is not good enough, or by Amazon Bedrock Intelligent Prompt Routing, which predicts each request's difficulty within a model family. The Model Routing and Cascading module covers these implementations. For cost management, the key metrics are the share of traffic handled by each tier and the quality achieved in each, because savings matter only if quality stays at the target.

Efficient inference patterns

Several pricing options lower cost for suitable workloads. Batch inference processes large offline jobs at about half the on-demand price. The Flex service tier discounts latency-tolerant traffic such as evaluations and background agents. Prompt caching reduces the price of repeated prompt prefixes. Provisioned Throughput or the Reserved tier can be cheaper than on-demand for steady, high utilisation. Distillation creates a smaller model that matches a large model on one task. Pre-computing predictable answers with batch inference avoids real-time calls altogether.

The following table summarises cost levers and when they apply.

LeverApplies when
Smaller modelEvaluation shows it meets the quality bar
Tiered usage or cascadingTraffic mixes simple and complex requests
Batch inferenceResults can wait hours
Flex tierRequests tolerate longer processing
Prompt cachingLong prompt prefixes repeat across requests
Provisioned Throughput or Reserved tierSteady, high utilisation
DistillationOne high-volume task needs large-model quality
Match the pairs

Pricing options

Exam skills 4.1.2 · 4.1.3

Match each workload with the pricing option that lowers its cost.

Log in to try this activity Interactive activities are free with an account.
Worked example

Choosing by cost per outcome

For ticket classification, model A costs USD 0.002 per ticket with 97% accuracy; model B costs USD 0.0004 with 90% accuracy. Each misclassified ticket costs about USD 0.50 in agent time.

Expected cost per ticket is about 0.002 + 0.03 x 0.50 = USD 0.017 for A and 0.0004 + 0.10 x 0.50 = USD 0.050 for B. Despite its lower price, B is more expensive overall. A cascade (B first, escalating uncertain tickets to A) might beat both and should be evaluated.

Check yourself

Which Bedrock options discount latency-tolerant work?

Show answer

Batch inference and the Flex tier.

Exam Tips

Remember for the exam

  • Compare models on cost per successful outcome, not price per token.
  • Route simple requests to small models; reserve large models for complex ones.
  • Batch inference and the Flex tier discount latency-tolerant work.
  • Re-run the selection when prices or models change.