llm-router
Copilot instructions93 starsChanged 8 months agoMITView on GitHub
These rules apply when using llm-router MCP tools inside VS Code with GitHub Copilot. VS Code loads MCP servers from .vscode/mcp.json (workspace) or the user mcp.json. Use llm_auto for routing + cross-session savings tracking. VS Code loads MCP servers on startup. Once llm-router is registered, call tools by name: Add to .github/copilot-instructions.md for workspace-level routing guidance: Run llm_savings in Copilot Chat to see cross-session totals. Skip preamble. Lead with result. Fragments fine when meaning is clear. No trailing summaries. ≥3…
The file
We split this copilot-instructions.md into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Add to .github/copilot-instructions.md for workspace-level routing guidance:
- Very specific: line 43
Run llm_savings in Copilot Chat to see cross-session totals.
- Distinctive: line 50
No trailing summaries. ≥3 items → bullets.
- Distinctive: line 76
Call the matching tool before generating your own response.
- Distinctive: line 78
Only use native Copilot intelligence for file navigation, terminal commands, or when all LLM Router MCP servers are unavailable.
- Very specific: line 80
If llm(task="code") or similar is unavailable, proceed normally and note it.
- Very specific: line 84
Use llm(task="research") for anything time-sensitive — Ollama has a training cutoff
- Very specific: line 85
Use llm_auto when unsure which tool to call
- Very specific: line 86
Run llm_router_status to see cross-session totals
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- llm_router-rules-version: 1 -->LLM Router — VS Code / GitHub Copilot Routing Rules
These rules apply when using llm-router MCP tools inside VS Code with GitHub Copilot. VS Code loads MCP servers from .vscode/mcp.json (workspace) or the user mcp.json. Use
llm_autofor routing + cross-session savings tracking.
How to Route
VS Code loads MCP servers on startup. Once llm-router is registered, call tools by name:
Rule: for research/generate/code/analyze tasks → call llm_auto(prompt=<the task>)Add to .github/copilot-instructions.md for workspace-level routing guidance:
When a task requires live web search, call the llm_research MCP tool.
For code generation or complex analysis, call llm_code or llm_analyze.
For auto-routing with savings tracking, call llm_auto.Task Type → Tool Mapping
| Task | Tool | Notes |
| Simple factual question | llm_query | Gemini Flash / Groq |
| Research / current events | llm_research | Perplexity (web-grounded) |
| Writing / content | llm_generate | Gemini Flash / Haiku |
| Deep analysis | llm_analyze | GPT-4o / Gemini Pro |
| Code generation | llm_code | Ollama → Codex → o3 |
| Unknown / auto-detect | llm_auto | Classifies + routes |
Savings Visibility
Run llm_savings in Copilot Chat to see cross-session totals.
Token-Efficient Responses
Skip preamble. Lead with result. Fragments fine when meaning is clear. No trailing summaries. ≥3 items → bullets. Never restate the user's request.
<!-- llm_router-rules-version: 2 -->LLM Router — VS Code / GitHub Copilot Routing Rules
LLM Router routes each task to the cheapest capable model before Copilot generates its own response. Call the appropriate tool BEFORE answering.
Pull routing: Copilot uses pull routing — YOU must call the tool. The tool returns the response; relay it verbatim. Requires VS Code ≥ 1.99 in agent mode.
Task Type → Tool Mapping
| Task | Tool | Notes |
| Simple factual question | llm(task="query") | Ollama → Gemini Flash → GPT-4o-mini |
| Research / current events | llm(task="research") | Perplexity (web-grounded) |
| Writing / content | llm(task="generate") | Gemini Flash → Haiku |
| Deep analysis / review | llm(task="analyze") | Ollama → GPT-4o |
| Code generation / refactor | llm(task="code") | Ollama → Codex → o3 |
| Deep reasoning / proofs | llm(task="analyze") | Extended-thinking model |
| Unknown / auto-detect | llm_auto | Classifies + routes automatically |
Rules
- Call the matching tool before generating your own response.
- Return the tool's output to the user as-is (don't paraphrase).
- Only use native Copilot intelligence for file navigation, terminal commands, or when all LLM Router MCP servers are unavailable.
- If
llm(task="code")or similar is unavailable, proceed normally and note it.
Tips
- Use
llm(task="research")for anything time-sensitive — Ollama has a training cutoff - Use
llm_autowhen unsure which tool to call - Run
llm_router_statusto see cross-session totals
Token-Efficient Responses
Skip preamble. Lead with result. Fragments fine when meaning is clear. No trailing summaries. ≥3 items → bullets. Never restate the user's request.
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
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.

