← All topics
Knowledge

Cost control: tier, cache, and cap fan-out

Most agent spend is avoidable. Route easy work to cheap models, cache repeated calls, set token budgets, and cap fan-out concurrency.

Model tiering

Not every step needs your most expensive model.

  • Route classification, routing, and extraction to a small/cheap (or local) model; reserve the frontier model for hard reasoning. See show local agent stack.
  • A tiered fallback (local → cheap API → frontier) keeps both cost and the zero-key floor in check.

Caching and token budgets

Stop paying twice for the same answer.

  • Cache deterministic or repeated calls (identical prompt → cached result).
  • Set a token budget per run and truncate or summarize context that exceeds it — runaway context is the silent cost driver.

Cap fan-out concurrency

Unbounded fan-out spends money *and* triggers rate limits.

  • The same concurrency limiter that fixes reliability (reliability) is also a cost cap — bounded parallelism bounds spend.

Related patterns

Related threads

Ask the swarm