skills/ai-model-router-v2/skill/SKILL.md
--- name: ai-model-router description: Intelligent AI model router that automatically switches between two configured models (local for simple tasks, cloud for complex ones). Detects local models (Ollama, LM Studio) automatically, routes based on task complexity and privacy. Use when users ask to "switch model", "use local/cloud model", or mention API keys/passwords (triggers privacy mode). Trigger on: sensitive data detection (forces local), complex tasks like "design architecture" (uses cloud)
npx skillsauth add leoyeai/openclaw-master-skills skills/ai-model-router-v2/skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Compact, intelligent model routing that just works.
# Install
npx clawhub@latest install ai-model-router
# First run - auto-detects your models
python3 skill/core/router.py "What is Python?"
# List available models
python3 skill/core/router.py --list
Your Request → Analyze → Select Model
↓
Simple? → Primary (fast/cheap)
Complex? → Secondary (capable)
Private? → Primary (forced)
| Pattern | Points | |---------|--------| | Microservices, architecture | +10 | | Design, implement, optimize | +5 | | Explain, analyze, compare | +3 | | Syntax, example, "what is" | -3 |
Threshold: 5 (simple vs complex)
| Feature | Status | |---------|--------| | Auto-detect local models | ✓ (Ollama, LM Studio) | | Cloud model registry | ✓ (7 built-in) | | Privacy detection | ✓ (API keys, passwords) | | Context tracking | ✓ (conversations) | | JSON config | ✓ (optional) | | CLI interface | ✓ | | Core code size | ~200 lines |
# Route a task
python3 skill/core/router.py "Design a system"
python3 skill/core/router.py "What is a for loop?"
# Options
--json # JSON output
--force primary # Force primary model
--list # List all models
--status # Show status
from skill.core.router import RouterCore
router = RouterCore()
result = router.route("Design microservices")
print(result.model_name) # "Claude Opus 4"
print(result.reason) # "complex_task(score=15)"
print(result.confidence) # 0.75
Create ~/.model-router/models.json:
{
"primary_model": {"id": "ollama:llama3:8b"},
"secondary_model": {"id": "anthropic:claude-opus-4"},
"models": [...]
}
Without config: Auto-detects local + uses cloud registry.
Automatically forces primary (local) when sensitive data detected:
sk-..., api_key)password, passwd)bearer, secret)core/router.py - Core routing engine (~200 lines)modules/detector.py - Auto-detection (optional)modules/context.py - Context tracking (optional)This version combines:
testing
AI-powered diary generation for agents - creates rich, reflective journal entries (400-600 words) with Quote Hall of Fame, Curiosity Backlog, Decision Archaeology, Relationship Evolution, mood analytics, weekly digests, "On This Day" resurfacing, and cron auto-generation. Works best with Claude models (Haiku, Sonnet, Opus).
development
Multi-agent UX for OpenClaw Control UI — agent selector, per-agent sessions, session history viewer with search, agent-filtered Sessions tab with friendly names, Create Agent wizard, emoji picker, and backend agent CRUD.
tools
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
tools
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.