Model routing
Send each model call to the model that fits it, limit which models a group may use, cap spend, and see what every call cost. Where to start, and which page covers what.
Model routing lets the gateway pick the model for a call after it reads the request and before it forwards it. A classifier names the kind of work, for example coding or summarize, and the model you mapped to that kind answers. The guardrail, administrator rules and budgets still apply to the model that is picked. If the classifier fails, the original request goes through unchanged.
Routing is off until you turn it on.
Start here
| You want to | Page |
|---|---|
| Send each call to the model that fits it, with the built-in rules classifier, System One or the vLLM Semantic Router | Semantic model routing |
| Route the model calls of Claude Code or Codex, which have hooks but do not send model traffic through the guardrail proxy | Route-only mode |
| Limit which models a user, group or connector may use, or cap spend | Routing rules and budgets |
| See what every model call used and cost | Tokenomics |
| Set the model key that the router, the judge and the scanners share | LLM key and providers |
| Use a decision model as the classifier | Decision model |
| See how well routing works | Benchmarks: model routing |
The commands
defenseclaw routing setup # choose a classifier and map kinds of work to models
defenseclaw routing test "refactor this function" # a dry run: no model is called
defenseclaw routing status # what routing is doing now
defenseclaw routing usage # what calls used (needs observability.tokenomics)defenseclaw routing enable --connector claudecode (or codex) turns on route-only mode for that agent. defenseclaw routing disable --connector NAME puts the agent's own settings back. See Semantic model routing for the flags.
Guardrail benchmarks
What DefenseClaw measured for its guardrail in 1.0.10 - rule detection, the full rules, decision model and judge cascade, the LLM judge, model routing, and hook speed - with the build, the data and how to reproduce each result.
Semantic model routing
Send each model call to the model that fits it. A built-in rules classifier (or System One, or the vLLM Semantic Router) picks the model, for proxy agents and, through route-only mode, for Claude Code and Codex.