Building AI Apps with LLMs
LESSON 4.2

Managing cost and latency

Learn key techniques and workflows in Building AI Apps with LLMs.

13m
intermediate
12,750 students

Overview

Cost is prompt design, model choice, and how often you call. Measure per-request tokens before you try to optimise anything.

In this lesson you will:

  • Attribute spend to specific calls and prompts
  • Trim prompts and route by difficulty
  • Set timeouts and fall back gracefully

Pro Tip

Use caching and revalidation wisely to ensure your app stays fast and data remains fresh without unnecessary requests.

Resources