Borrowing it
Nothing to install: this file belongs to majiayu000/litellm-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/majiayu000/litellm-rs/main/.claude/skills/routing-architecture/SKILL.mdgit clone --depth 1 https://github.com/majiayu000/litellm-rsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/majiayu000/litellm-rs/routing-architecture)<a href="https://agentmods.dev/skills/majiayu000/litellm-rs/routing-architecture"><img src="https://agentmods.dev/badge/skills/majiayu000/litellm-rs/routing-architecture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/majiayu000/litellm-rs/routing-architecture"><img src="https://agentmods.dev/badge/skills/majiayu000/litellm-rs/routing-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00072 | $0.01733 |
| Opus 5 | $0.00036 | $0.00866 |
| Sonnet 5 | $0.00014 | $0.00347 |
| Haiku 4.5 | $0.00007 | $0.00173 |
Grade A, and why
routing-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Routing Architecture Guide
Overview
The router (src/core/router/) selects among deployments — concrete provider+model
pairs registered via Router::add_deployment / Router::set_model_list — using one of
7 strategies. There is no per-strategy router struct, no Router trait, and no
create_router factory: strategy dispatch is a match on the RoutingStrategy enum
calling free functions in src/core/router/strategy_impl.rs.
Key Design Principles
- Snapshot isolation: deployments, the model index, and aliases live in an immutable
RoutingSnapshot, published throughArcSwap(src/core/router/unified.rs:61,308). Readers load one generation lock-free; writers clone-modify-store under aparking_lot::Mutexthat only serializes writers (unified.rs:312,379-398). - Atomic deployment state: per-deployment runtime state (
DeploymentState) is plain atomics withRelaxedordering (deployment.rs:210-252); RoundRobin uses aDashMap<String, AtomicUsize>of per-model counters (unified.rs:321). - Health-aware: candidates are filtered by cooldown, health status, parallel limits, and RPM/TPM limits before a strategy picks among them.
- Fallback chains: the built-in execution path tries the model-keyed
Generalfallback list after retries are exhausted. Typed context-window, content-policy, and rate-limit lists require explicit caller lookup/wiring today.
Selection Flow
Entry point Router::select_deployment_lease (selection.rs:95) delegates to
select_deployment_matching (selection.rs:226). The real flow:
- Load the current snapshot; resolve model aliases via
resolve_model_name(maxMAX_ALIAS_HOPS = 16hops,unified.rs:26). - Look up the resolved model in
snapshot.model_indexto get candidateDeploymentIds. - One filter pass builds
Vec<RoutingContext>(strategy_impl.rs:17), skipping deployments that are in cooldown (is_in_cooldown), unhealthy (is_healthy), at theirmax_parallel_requestslimit, or at theirrpm_limit/tpm_limit(selection.rs:287-344). Each context copiesweight,priority,active_requests,tpm_current/tpm_limit,rpm_current/rpm_limit,avg_latency_us. Router::select_from_routing_contextsdispatches on the configured strategy (selection.rs:195-224):
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 144 lines · 72 tokens per session scan A 0933e737f1a8
routing-architecture is a skill published in the GitHub repository majiayu000/litellm-rs (112 stars, last pushed 3d ago), licensed MIT. It adds 72 tokens to every session and 1,733 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
omni-inference
The core OpenAI-compatible inference endpoints: chat completions, embeddings, images, audio (TTS/STT), moderations, rerank, and the Responses API. The primary integration surface for AI agents.
omni-providers
Manage provider connections, API keys, OAuth flows, and connection tests via the REST API. List, add, update, remove, and test AI provider integrations across OmniRoute's 327-provider catalog.
omni-combos-routing
Create and manage routing combos with 19 strategies (priority, weighted, round-robin, Auto-combo, and more). Configure fallback chains, test routing outcomes, and retrieve combo metrics.
omni-auth
Manage API key authentication and session tokens. Start here to authenticate requests via Bearer token, obtain session cookies, and configure login requirements for the OmniRoute API.
omni-api-keys
Create, list, rotate, and revoke OmniRoute API keys. Control per-key scopes, spending limits, and expiration. Keys gate access to all proxy and management endpoints.
omni-mcp
Connect to the OmniRoute MCP server (110 tools, 3 transports: SSE/stdio/HTTP). Covers routing, cache, compression, memory, skills, providers, and audit tools across 33 permission scopes.