← Table of Contents · Page 557 of 868

COST OPTIMIZATION TECHNIQUES

Part 1 of 10

LEARNING GOALS By the end of this chapter you will be able to name the main techniques that lower the cost of an agent without hurting its quality. You will be able to explain prompt compression, model routing, and prompt caching in plain language. You will know how to cut wasted tokens that come from loops, retries, and repeated calls. FROM MEASURING TO SAVING In Chapter 53 you learned where the money goes. Now you learn how to spend less without making the agent worse. The key phrase is "without making the agent worse." Anyone can cut cost by using a weaker model or deleting instructions, but the result may be an agent that fails. A good harness engineer saves money while protecting quality, and proves it by testing. This chapter covers four techniques: prompt compression, model routing, prompt caching, and cutting wasted tokens from loops, retries, and redundant calls.
Advertisement
Read Aloud:
0:00 / 0:00