agentleFS
ypollak2ypollak2/llm-router/.github/copilot-instructions.md

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
  1. Very specific:

    Add to .github/copilot-instructions.md for workspace-level routing guidance:

    line 18
  2. Very specific:

    Run llm_savings in Copilot Chat to see cross-session totals.

    line 43
  3. Distinctive:

    No trailing summaries. ≥3 items → bullets.

    line 50
  4. Distinctive:

    Call the matching tool before generating your own response.

    line 76
  5. Distinctive:

    Only use native Copilot intelligence for file navigation, terminal commands, or when all LLM Router MCP servers are unavailable.

    line 78
  6. Very specific:

    If llm(task="code") or similar is unavailable, proceed normally and note it.

    line 80
  7. Very specific:

    Use llm(task="research") for anything time-sensitive — Ollama has a training cutoff

    line 84
  8. Very specific:

    Use llm_auto when unsure which tool to call

    line 85
  9. Very specific:

    Run llm_router_status to see cross-session totals

    line 86

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md
<!-- 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_auto for 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

TaskToolNotes
Simple factual questionllm_queryGemini Flash / Groq
Research / current eventsllm_researchPerplexity (web-grounded)
Writing / contentllm_generateGemini Flash / Haiku
Deep analysisllm_analyzeGPT-4o / Gemini Pro
Code generationllm_codeOllama → Codex → o3
Unknown / auto-detectllm_autoClassifies + 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

TaskToolNotes
Simple factual questionllm(task="query")Ollama → Gemini Flash → GPT-4o-mini
Research / current eventsllm(task="research")Perplexity (web-grounded)
Writing / contentllm(task="generate")Gemini Flash → Haiku
Deep analysis / reviewllm(task="analyze")Ollama → GPT-4o
Code generation / refactorllm(task="code")Ollama → Codex → o3
Deep reasoning / proofsllm(task="analyze")Extended-thinking model
Unknown / auto-detectllm_autoClassifies + routes automatically

Rules

  1. Call the matching tool before generating your own response.
  2. Return the tool's output to the user as-is (don't paraphrase).
  3. Only use native Copilot intelligence for file navigation, terminal commands, or when all LLM Router MCP servers are unavailable.
  4. 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_auto when unsure which tool to call
  • Run llm_router_status 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.

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.