|
Some checks failed
LiteLLM Rust DB / db-queries (push) Has been cancelled
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Diataxis-style docs under docs/architecture/router describing the router as the Rust core litellm-router-core runs it on nate_router_step6_rust_core_v2: deployments and model groups, name resolution, teams and access, the filter chain, strategies, routing groups and sub-routers, retries, fallbacks and cooldowns, shared state, and the core and its host. Claude-Session: https://claude.ai/code/session_013FDwtmdtKxVdjQX8WK43iK |
||
|---|---|---|
| .. | ||
| explanation | ||
| how-to | ||
| img | ||
| reference | ||
| tutorial | ||
| README.md | ||
Router
litellm.Router decides which deployment serves a request, makes the call, and
handles what happens when the call fails. It retries in the same model group,
falls back to other model groups, and puts failing deployments into cooldown so
that later requests avoid them. The proxy builds one Router from its config and
sends every model request through it. SDK users can build their own.
Concepts
Start with Router concepts, which names the ideas and shows how they fit together. Each idea then has its own page.
- Deployments and model groups, what is configured and how a deployment gets its identity
- How a name finds its deployments, aliases, wildcards, routing groups, team names, deployment ids and defaults
- Teams and access, team deployments, access groups, access windows and PTU shares
- How a deployment is picked, the filter chain and
priority with
order - Strategies, routing groups and sub-routers, how one deployment is chosen and how a request is sent to the right group
- Retries, fallbacks and cooldowns, including allowed fails, order fallbacks, weighted failover and streams
- Shared state across proxy workers
Two pages cover how the router is built.
- The core and the host, what the Rust core owns and what it asks its host for
- The life of a request, from
acompletionthrough the core to the provider
Tutorial
New to the router? Work through Route your first requests. It builds a Router with mock deployments, so it needs no API keys. It shows load balancing, retries, cooldowns and fallbacks in about fifteen minutes.
How-to guides
- Read router state from outside the router
- Change deployments or settings at runtime
- Move a caller off a deprecated Router member
- Add a custom routing strategy
- Find out why a request went where it did
Reference
- Entry points, every method on the public surface and what it replaced
- Core, config and host interfaces, the step
protocol, the Rust
Routerand theHosttrait - Configuration and defaults, constructor arguments, strategies and constants
- Routing state and cache keys, what the router stores and for how long
- Code map, which file holds what
Status
These pages describe the branch nate_router_step6_rust_core_v2 (#49513).