Skip to main content
An agentic pipeline might call an LLM 30–50 times per task: planning, tool selection, web browsing, reasoning, summarization, code review, final synthesis. If all 50 calls hit a frontier model at 1521/MTok,asingleagentruncosts15–21/MTok, a single agent run costs 0.30–$1.00+. Most of those calls don’t need a frontier model. A call that checks whether a tool invocation succeeded is a simple classification task. A call that summarizes a fetched web page is a summarization task. Routing them to budget models reduces cost while keeping quality where it matters.

Routing inside an agent loop

Using AgentGuard for cost-bounded runs

PRYSM’s AgentGuard stops agent runs before they exceed a cost ceiling:
AgentGuard tracks cumulative cost across every LLM call in the run. If the next call would exceed max_cost_usd, the agent stops cleanly and returns what it has so far.

BRAIN.md: declare routing rules for your repo

Create a BRAIN.md at your repo root to set routing rules that apply automatically:

Dry-run: preview without spending tokens

Measuring savings over a run

The key insight: most agent steps are routine — tool invocations, parsing, formatting, classification. Only planning and final synthesis need frontier reasoning. Route accordingly.