agentleFS
ypollak2ypollak2/llm-router/skills/route/SKILL.md

route

Skill123 starsChanged 31 days agoMITView on GitHub

Route a task to the best LLM based on task type and complexity

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use learn and prototype.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • genomewalkerSkill

    learn

    Learn from web sources, generate SKILL.md, and store key patterns in soul memory. Trigger keywords: learn, skill-gen, web-learn, documentation, tutorial.

    Also in 3 projects that use this

  • GoogleSkill

    prototype

    Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every 5th routed task, the system shows estimated savings: Claude API costs avoided and rate limit capacity preserved.

    line 57

“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/route — Smart LLM Task Router

Route any task to the optimal LLM automatically.

Usage

/route <task description>

Auto-Classification

Most prompts are classified automatically by the UserPromptSubmit hook — no /route needed. The hook uses a multi-layer classification chain:

  1. Heuristic scoring (instant, free) — Three signal layers accumulate evidence:
    • Intent patterns (+3) — action verbs and task markers
    • Topic patterns (+2) — domain-specific nouns
    • Format patterns (+1) — structural and temporal cues
    • High-confidence match (score >= 4) routes immediately
  2. Ollama local LLM (~1s, free) — When heuristics are uncertain, qwen3.5 classifies locally via the chat API with thinking disabled
  3. Cheap API model (~$0.0001) — If Ollama is unavailable, Gemini Flash or GPT-4o-mini classifies
  4. Weak heuristic / auto fallback — Last resort: low-confidence heuristic match or llm_route (full LLM classifier)

Task Categories

The consolidated llm(prompt=..., task=..., tier=...) tool is the front door for all of these — task= picks the specialization, tier= (fast/balanced/best) picks the cost tier:

CategoryCallSignals
Researchllm(task="research")Current events, news, funding, trends, market data, rankings
Generatellm(task="generate")Writing, drafting, brainstorming, emails, articles, translations
Analyzellm(task="analyze")Evaluation, debugging, comparison, trade-offs, code review
Codellm(task="code")Implementation, refactoring, building, bug fixes
Queryllm(task="query") (or task="auto")Simple questions, definitions, explanations
Imagellm_imageVisual generation, design, artwork

Complexity & Profiles

ComplexityProfileModel Tier
SimplebudgetGemini Flash, GPT-4o-mini
ModeratebalancedGPT-4o, Gemini 2.5 Pro
Complexpremiumo3, Gemini 2.5 Pro

Savings Awareness

Every 5th routed task, the system shows estimated savings: Claude API costs avoided and rate limit capacity preserved. Run llm_router_status(view="usage") for a detailed breakdown.

Examples

What are the top 3 AI startups that raised funding?
→ research (heuristic, score=8) → llm(task="research") → Perplexity Sonar

Write me a blog post about productivity tips
→ generate (heuristic, score=5) → llm(task="generate", tier="balanced") → Gemini 2.5 Pro

Compare React vs Vue for our new project
→ analyze (ollama, qwen3.5) → llm(task="analyze", tier="balanced") → GPT-4o

Implement a rate limiter in Python using sliding window
→ code (heuristic, score=4) → llm(task="code", tier="balanced") → GPT-4o

What is a monad?
→ query (ollama, qwen3.5) → llm(task="query", tier="fast") → Gemini Flash

Configuration

Environment variables:

  • LLM_ROUTER_OLLAMA_MODEL — Ollama model (default: qwen3.5:latest)
  • LLM_ROUTER_OLLAMA_URL — Ollama server (default: http://localhost:11434)
  • LLM_ROUTER_OLLAMA_TIMEOUT — Timeout in seconds (default: 5)
  • LLM_ROUTER_CONFIDENCE_THRESHOLD — Heuristic score cutoff (default: 4)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.