Examples
Cost-controlled agent
Three middleware to reduce cost on a busy agent:
# axl-config/agents/assistant/agent.toml
# Serve a repeated identical model call from a stored turn.
[middleware.llm_cache]
enabled = true
# Send short, easy requests to a cheaper model.
[middleware.model_router]
enabled = true
# Reuse a repeated lookup within one conversation.
[middleware.tool_cache]
enabled = true
ttl_secs = 300The router runs before the LLM cache, so a cached answer stays keyed to the model that actually produced it - you will not get a cheap model's answer served for an expensive model's request.
Bound the run itself as well:
[sub_agents]
enabled = true
max_budget_usd = 1.00
timeout_secs = 300Check what resolved:
axl weave print --config axl-config/agents/assistant/agent.tomlNext
- Middleware - the full stack and slot ordering.
- Model router - routing rules in detail.