Library / Monitoring, Ops & Incidents
Monitoring, Ops & Incidents
Route LLM tasks to the cheapest capable Claude models with Anthropic
When an API call/webhook arrives, it monitors systems with Claude.
What it does
## Cheapest Capable LLM Router ### How it works A task comes in by webhook. A cheap classifier model (Haiku) scores its complexity, risk and needs (reasoning, code, web search, long context). The router then picks the cheapest model in the catalog that is capable enough, builds an escalation chain of higher tiers, and runs the task. A cheap judge scores the answer; if it falls below the quality threshold the task escalates to the next tier with the judge's feedback. The response includes the answer, routing trace, actual cost and savings versus always using the premium model. ### Setup steps - Create an HTTP Header Auth credential for Anthropic (header x-api-key) and select it on the three Claude HTTP nodes: Classify Task, Execute Model, Judge Quality. - Edit Set Router Configuration: model catalog (tiers, prices per 1M tokens, context windows - verify against current pricing), quality threshold, max attempts, premium baseline model. - Optional: set ledgerUrl to the Execution Ledger webhook (/webhook/agent-ledger-event) to log every call and its cost. - POST to /webhook/llm-router with { "task": "...", "context": "...", "maxCostUsd": 0.05, "minTier": 1, "forceModel": "", "minQualityScore": 7, "maxAttempts": 3 }. Only task is required. A manual run uses a sample task. ### Customization - Add a model: add a row to the catalog JSON (id, tier 1-3, prices, contextWindow, webSearch). - Change how complexity maps to tiers in the Select Cheapest Capable Model node. - Set judgeEnabled to false to skip quality checks and never escalate on score.
The steps
- When Task Submitted
- When Manual Test Run Initiates
- Normalize Task Input
- If Task Is Valid
- Respond with Validation Error
- Set Router Configuration
- Build Classifier Request
- Classify Task
- Select Cheapest Capable Model
- Build Execution Request
- Execute Model
- Record Attempt
- Route Next Action
- Build Judge Request
21 steps in total.
Similar automations
Finance, Invoices & AccountingSend the cheapest nearby fuel prices with Apify to Telegram5 stepsData Sync & ETLRoute LLM requests with Anthropic, OpenAI, Gemini, Postgres, and Slack27 stepsAI Agents & AssistantsRead License Plate Numbers from Images with an LLM6 stepsMonitoring, Ops & IncidentsArbitrate LLM answers using an Anthropic Claude panel and WhatsApp alerts20 steps