AWS Machine Learning · Nov 17, 2026
Cut generative AI costs: Code for rules, models for judgment
The biggest cost lever in a generative AI system is whether you call a model at all. Learn how to decide whether each workflow step needs a model, and map each option to AWS: deterministic code, a constrained decision call, or a right-sized
Read moreShow less about Cut generative AI costs: Code for rules, models for judgment
The biggest cost lever in a generative AI system is whether you call a model at all. Learn how to decide whether each workflow step needs a model, and map each option to AWS: deterministic code, a constrained decision call, or a right-sized model on Amazon Bedrock.
AWS recommends using code for checks such as formats, schemas, keywords and ranges. Those checks typically take milliseconds, while model calls can add hundreds of milliseconds apiece, along with recurring cost and variable answers.
Run rules first and send unresolved requests onward. A model can draft a regex or schema once for review and testing. If rules handle 95% of traffic, only one request in 20 reaches a model, AWS’s illustrative calculation shows.
For routing or classification, limit answers to fixed choices and escalate uncertain cases. AWS lists structured outputs, embedding similarity, experimental Strands Decider and trained classifiers. It recommends checking escalation signals against labeled data and keeping authorization in code.
For open-ended work, measure cost per successful outcome and choose the cheapest, fastest model that meets quality, latency and compliance requirements. Test swaps on labeled examples, keep them reversible and sample rule-handled traffic for drift.
Read at AWS Machine Learning (opens in a new tab)