- Home
- Skills
- Hoodini
- Ai Agents Skills
- Local Llm Router
local-llm-router_skill
74
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill hoodini/ai-agents-skills --skill local-llm-router- SKILL.md78.6 KB
Overview
This skill routes developer coding queries to local LLMs inside air-gapped or secure networks. It integrates Serena MCP as the primary semantic code understanding layer, then selects and forwards enriched prompts to local inference services like Ollama, LM Studio, Jan, OpenWebUI and others. Use it to keep code-sensitive workflows offline while benefiting from model routing and code-aware context.
How this skill works
On each code-related request the skill invokes Serena MCP first to extract symbol-level context, diagnostics, references and type information. It classifies the task (coding, analysis, documentation, reasoning), discovers available local LLM services, selects the best model for the task and enriches the prompt with Serena context. Finally it routes the enriched prompt to the chosen local service, and when edits are returned it applies them back through Serena for precise, symbol-aware changes.
When to use it
- Working in air-gapped or closed networks with no external API access
- When you require semantic code context before contacting an LLM (Serena-first workflows)
- Routing queries to multiple local model hosts (Ollama, LM Studio, Jan, OpenWebUI, LocalAI, vLLM, etc.)
- Performing refactors, diagnostics, or edits that must be applied precisely to a repository
- Maximizing token efficiency and accuracy for code tasks by limiting prompt context to relevant symbols
Best practices
- Always run Serena MCP server and verify it is reachable before routing code tasks
- Provide file and cursor context for best semantic results (file path + position)
- Prefer symbol-level operations from Serena (hover, references, diagnostics) before free-text search
- Limit the number of references and diagnostics included in prompts to prevent oversized requests
- Validate model endpoints with the built-in health checks and adjust endpoints for WSL/container environments
Example use cases
- Safely refactor a large codebase offline: Serena gathers references and the router picks a model suited for code edits
- Generate or fix a function locally without sending source to external APIs
- Run diagnostics and get suggested fixes, then apply edits via Serena MCP to maintain symbol integrity
- Route documentation or analysis tasks to smaller local models while reserving larger models for complex reasoning
- Operate an AI-powered dev assistant inside a secured defense or corporate environment with strict network isolation
FAQ
Yes. Serena MCP must be invoked first for all code tasks to provide semantic context and enable precise edits.
Which local LLMs are supported?
Common local services are supported: Ollama, LM Studio, Jan, OpenWebUI, LocalAI, vLLM, llama.cpp, GPT4All and similar OpenAI-style endpoints.
How does service discovery work?
The router performs health and models endpoint checks against default ports, adjusts endpoints for WSL/containers, and builds a list of DiscoveredModel entries to choose from.