LearnAI
Module 6 · AI Application Production (Pro) · Lesson 1/5
← Back to catalog
Task

AI cost control

How to reduce costs without killing quality? Return JSON {"tactics": [list of 2+ techniques], "why": "briefly"}.

Unlock access to submit solutions for instant AI review.Start for free
The first thing a business asks
💡 A bit of theory

AI calls cost money for each token—on a stream, this is the main expense item of the product. The naive scheme “we drive everything through the most powerful model” ruins. Saving levers: direct simple tasks to a cheap/fast model, and save the flagship for complex ones (routing); cache duplicate responses and prompts; limit max_tokens so that the model does not spread; cut extra context in the prompt (each extra token is money for each request); group requests (batch) where possible. Rule: 80% of requests are usually simple - sending them through the flagship is wasteful. Calculate the cost per 1000 requests before launch.

How it's graded · passing score 70

  • 1Valid JSON without text around it30%
  • 2There is an array tactics and why35%
  • 32+ levers: cheap model/routing, cache, token limit, context pruning35%
Your promptClaude ⌄