llm_classifyLABSCO SUMMARY
The secrets rule is the part worth knowing before you route anything real.
A prompt that contains an API key, token or private key is routed to local models only, fail-closed — it cannot leak into an external provider because a cheaper tier happened to win. Around that, the useful habit is calling the classifier before the router: it shows the complexity verdict and the budget pressure that would drive the decision, so you can override rather than discover the choice after the bill.
What it is
A local-first routing layer exposed over MCP. A complexity classifier — regex heuristics for most prompts, a local Ollama or Gemini Flash call for the ambiguous ones — decides how hard a task is, then a free-first router walks up a chain of providers until one can handle it, with circuit breakers skipping providers that are failing or rate-limited. Cost is logged to a local SQLite database. There is no hosted proxy and no account.
What you get
- Routing you can call directly or inspect: classify a prompt's complexity before committing, route with full parameter control, stream, or hand it off automatically —
llm_classify,llm_route,llm_auto,llm_stream,llm_select_agent,llm_track_usage,llm_reroute - Task-shaped entry points that pick their own routing chain — factual questions, web-grounded research, long-form generation, deep analysis, code and edits —
llm_query,llm_research,llm_generate,llm_analyze,llm_code,llm_edit - Media and multi-step pipelines —
llm_image,llm_video,llm_audio,llm_orchestrate,llm_pipeline_templates - Spend and health visible while you work: usage, savings against baseline, provider health, budget and a dashboard, plus a session-end summary with tier mix, per-provider cost and latency p50/p95/p99 —
llm_usage,llm_savings,llm_health,llm_providers,llm_budget,llm_dashboard,llm_set_profile,llm_quality_guard,llm_hook_health - A fail-closed secrets rule: a prompt containing an API key, token or private key routes to local models only and cannot reach an external provider
- Setup, benchmarking and filesystem helpers, and Claude subscription usage tracking —
llm_setup,llm_benchmark,llm_quality_report,llm_save_session,llm_fs_find,llm_fs_rename,llm_fs_edit_many,llm_fs_analyze_context,llm_check_usage,llm_update_usage,llm_refresh_claude_usage
Requirements
Python 3.11+ and pip install llm-routing — the PyPI name is llm-routing while the command is llm-router; the published version is 13.0.2. llm-router install registers it with Claude Code by default, and --host codex, --host gemini-cli, --host vscode or --host cursor targets the others. No API keys are required on a Claude Pro or Max plan; LLM_ROUTER_SUBSCRIPTION_PROVIDER opts into cost-inverted routing around a paid seat. Everything runs locally — no hosted proxy, no account — and cost data stays in a local SQLite database.
Setup effort
One command — pip install llm-routing
USE CASES
Keeping a premium quota for the work that needs it
Let simple and moderate prompts fall to free or local models and reserve the paid seat for complex ones, with the seat demoted automatically when its quota is strained.
Deciding a model before you spend on it
Classify the prompt to see the complexity verdict, recommended model and budget pressure, then route deliberately.
Surviving a provider outage mid-session
A failing or rate-limited provider is skipped by the circuit breaker rather than retried into the ground; check provider health when results start looking odd.
Knowing what a working session actually cost
Read usage and savings against baseline during the session, and the end-of-session summary for tier mix, per-provider cost and latency percentiles.
44 tools
Listed in project docs. Your client may show a different list.
llm_routellm_autollm_streamllm_select_agentllm_track_usagellm_reroutellm_queryllm_researchllm_generatellm_analyzellm_codellm_editllm_imagellm_videollm_audiollm_orchestratellm_pipeline_templatesllm_set_profilellm_usagellm_savingsllm_healthllm_providersllm_dashboardllm_hook_healthllm_quality_guardllm_budgetllm_setupllm_save_sessionllm_quality_reportllm_benchmarkllm_fs_findllm_fs_renamellm_fs_edit_manyllm_fs_analyze_contextllm_check_usagellm_update_usagellm_refresh_claude_usagellm_team_reportllm_team_pushllm_codexllm_ratellm_policyllm_digestBEFORE YOU INSTALL
What to know first
Tools you get
44 tools named in the project's documentation.
Requires
pip on PATH
INSTALLATION
Connect your client
Server setup
pip install llm-routingMCP Clients
Claude Code
llm-router installCodex
llm-router install --host codexGemini CLI
llm-router install --host gemini-cliVS Code
llm-router install --host vscodeCursor
llm-router install --host cursorPi Coding Agent
llm-router install --host pi