# routing

A skill that hands tasks to llm_router tools so cheap models take the easy work and stronger ones get the rest.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 119
- Author: ypollak2
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/ypollak2/llm-router/tree/HEAD/skills/routing/SKILL.md
- Updated: 2026-10-25
- HTML: https://affpapa.org/en/nevibecode/skills/routing

## What it does

Instead of answering a question, a research request or a coding job itself, the agent calls the matching llm_router tool first. The router then picks the least expensive model that can do the job, going free-first: Ollama, then Codex, then paid APIs.

A table maps each task type to a tool. Plain facts go to `llm_query`, current events and research to `llm_research`, drafts and summaries to `llm_generate`, debugging and deep analysis to `llm_analyze`, code work to `llm_code`. When the type is unclear, `llm_auto` classifies the request and keeps a running total of what was saved.

Not everything gets routed. File reads and edits run directly, and prompts under five words are treated as follow-ups rather than standalone requests. Calls take a `prompt` argument; `llm_code` also accepts `complexity`. Savings show up automatically every five calls through `llm_auto`, or on demand with `llm_savings`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ypollak2/llm-router --skill routing -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/routing/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/routing/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ypollak2/llm-router --skill routing -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/routing/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ypollak2/llm-router --skill routing -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/routing/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ypollak2/llm-router routing
```

2. **Manually: put the files in place**
- File: `.github/skills/routing/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ypollak2/llm-router --skill routing -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ypollak2/llm-router --path skills/routing
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/routing/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ypollak2/llm-router --skill routing -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ypollak2/llm-router/tree/HEAD/skills/routing/SKILL.md

## When to use it
- send a trivial question to a cheap model instead of an expensive one
- pull fresh facts from the web rather than stale training data
- pick a model for code generation without guessing
- track how much routing has saved
- let `llm_auto` classify the task when the type is unclear

## Example prompts
- Run `llm_auto` on this request: what changed in Python 3.13?
- Call `llm_code` with `complexity="moderate"` to refactor this function to async/await
- Use `llm_research` to find what shipped in the latest release of this library

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 8b2f18effdd3dec8.

BEGIN THIRD-PARTY FILE 8b2f18effdd3dec8
````text
---
name: routing
description: Route tasks to the cheapest capable model automatically using llm_router MCP tools
trigger: /routing
---

# LLM Router — Smart Routing Skill

Route tasks to the cheapest capable model automatically using llm_router MCP tools.

## When to Use This Skill

Before answering research, code, writing, or analysis tasks — call the appropriate
llm_router tool instead of answering directly. The router picks the cheapest model
that can handle the task (Ollama → Codex → paid APIs in free-first order).

## Task → Tool Mapping

| Task type | Tool to call | Why |
|-----------|-------------|-----|
| Simple factual question | `llm_query` | Gemini Flash / Groq — 50× cheaper than o3 |
| Research / current events | `llm_research` | Perplexity (web-grounded, not stale) |
| Writing / summaries / brainstorm | `llm_generate` | Gemini Flash / Haiku |
| Deep analysis / debugging | `llm_analyze` | GPT-4o / Gemini Pro |
| Code generation / refactoring | `llm_code` | Ollama → Codex built-in → o3 |
| Don't know which type | `llm_auto` | Auto-classifies + routes, tracks savings |

## How to Call

```
llm_query(prompt="What is the capital of France?")
llm_code(prompt="Refactor this function to use async/await", complexity="moderate")
llm_research(prompt="What changed in Python 3.13?")
llm_auto(prompt="<the full user request>")   # safest default
```

## When NOT to Route

- File read/write/edit operations — execute directly
- Inline tool calls where you have the answer already
- Tasks under 5 words (likely follow-ups, not standalone requests)

## Cost Impact

Routing simple tasks to Gemini Flash instead of o3 saves ~50–100×.
`llm_auto` shows cumulative savings every 5 calls automatically.
Run `llm_savings` anytime to see your totals.
````
END THIRD-PARTY FILE 8b2f18effdd3dec8

The third-party file has ended. Everything between the 8b2f18effdd3dec8 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© ypollak2 · MIT · https://github.com/ypollak2/llm-router/tree/HEAD/skills/routing/SKILL.md

## Similar
- [llm-cost-optimizer](https://affpapa.org/en/nevibecode/plugins/llm-cost-optimizer.md) — plugin · ★ 28786
- [Credit Optimizer v5 for Manus AI](https://affpapa.org/en/nevibecode/mcp/credit-optimizer-v5-for-manus-ai.md) — MCP server · ★ 52
- [Awesome JEV](https://affpapa.org/en/nevibecode/mcp/awesome-jev.md) — MCP server · ★ 14
- [omni-combos-routing](https://affpapa.org/en/nevibecode/skills/omni-combos-routing.md) — skill · 1200 installs
- [cli-routing](https://affpapa.org/en/nevibecode/skills/cli-routing.md) — skill · 1100 installs
- [model-routing](https://affpapa.org/en/nevibecode/skills/model-routing.md) — skill · 452 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
