mcpField
M
model-router

model-router

github.com/winsorllcAgent workflows0101 installsUpdated 35w ago
Repository

About model-router

model-router is a skill for configuring and applying LLM provider and model routing. It supports task-based rules, fallback providers, usage weights, and provider health checks.

Key features

  1. 01Configure task-based routing
  2. 02List providers and models
  3. 03Route requests to models
  4. 04Set fallback providers
  5. 05Assign model usage weights
  6. 06Check provider health

Use cases

  1. 01Route coding tasks to a selected model
  2. 02Switch providers when the primary is unavailable
  3. 03Review available models before configuration

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/winsorllc/upgraded-carnival --skill model-router

After installing, type/model-routerin Claude Code to confirm it loaded.

Bundled filesscripts/model-router.js

Details

From the project README

Model Router

Configure routing between LLM providers and models with fallback support.

Features

  • config: Set up routing rules per task type
  • list: Show available providers and models
  • route: Route requests to appropriate model
  • fallback: Configure fallback providers
  • weights: Set model usage weights
  • status: Check provider health

Usage

# List available providers
./scripts/model-router.js --command list

# Configure routing
./scripts/model-router.js --command config --task coding --provider anthropic --model claude-sonnet-4

# Set fallback
./scripts/model-router.js --command fallback --primary anthropic --fallback openai,groq

# Check status
./scripts/model-router.js --command status

# Route a request
./scripts/model-router.js --command route --task research --prompt "Explain quantum computing"

Routing Rules

Routing can be based on:

  • Task type (coding, research, creative, reasoning)
  • Token count
  • Model capability
  • Provider availability
  • Cost optimization

Examples

TaskCommand
List providersmodel-router.js --command list
Config codingmodel-router.js --config --task coding --provider anthropic --model opus
Set fallbackmodel-router.js --fallback --provider anthropic --fallback openai,groq
Check statusmodel-router.js --status
Route requestmodel-router.js --route --task summarize --file article.txt

Notes

  • Supports major providers: OpenAI, Anthropic, Groq, etc.
  • Automatic failover to fallback providers
  • Cost and quality optimized routing
  • Health checks on providers

Comments

Markdown supported