/major-ai-skills:model-tier-routingfrom major-ai-skills
Route model requests by task complexity, latency needs, and measured quality within a defined cost budget.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Routing 100% of an application's or agent's queries to a flagship frontier model (Claude 3.5 Sonnet, GPT-4o, o1) is financially and computationally wasteful.
In a typical engineering workflow, 70% of prompts consist of mechanical tasks (e.g., formatting git commit messages, parsing JSON logs, classifying error types, writing mock data, generating regex). Running mechanical tasks on flagship models costs 10x to 40x more and introduces 3x higher latency.
The Dynamic 3-Tier Routing Protocol classifies prompt complexity in 5 milliseconds and dispatches tasks to the lowest-cost model tier capable of achieving 100% technical precision.
┌─────────────────────────────────────────────────────────────┐
│ Model Tier Routing Economics │
│ │
│ Single-Model Monolith (100% Sonnet / GPT-4o): │
│ • 70% Mechanical Tasks (Commits, logs, regex) ──► Flagship │
│ • 25% Core Feature Coding ──► Flagship │
│ • 5% Deep Algorithmic Architecture ──► Flagship │
│ ↳ Total Cost (1,000 Tasks): $45.00 │
│ │
│ 3-Tier Economic Dispatch Protocol: │
│ • 70% Mechanical Tasks ──► Haiku / Flash / Mini ($0.50) │
│ • 25% Core Coding ──► Sonnet / GPT-4o ($8.00) │
│ • 5% Deep Reasoning ──► o1 / o3-mini ($2.50) │
│ ↳ Total Cost (1,000 Tasks): $11.00 (75.5% Cost Reduction!) │
└─────────────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────────────────┐
│ TIER 1: FAST / MICRO (Claude 3.5 Haiku, GPT-4o-mini, Gemini 1.5 Flash) │
│ • Tasks: Git commits, log classification, JSON formatting, 1-line edits │
│ • Pricing: $0.15 - $0.80 / M tokens | Latency: 50 - 200 ms │
│ │
│ TIER 2: CORE ENGINEERING (Claude 3.5 Sonnet, GPT-4o, DeepSeek V3) │
│ • Tasks: Full feature implementation, multi-file refactoring, API callers │
│ • Pricing: $2.50 - $3.00 / M tokens | Latency: 1.0 - 2.5 s │
│ │
│ TIER 3: DEEP REASONING (OpenAI o1 / o3-mini, DeepSeek R1) │
│ • Tasks: Concurrency race conditions, cryptographic proofs, complex math │
│ • Pricing: $10.00 - $60.00 / M tokens | Latency: 5.0 - 15.0 s │
└───────────────────────────────────────────────────────────────────────────┘
from openai import OpenAI
from typing import Dict, Any, Literal
client = OpenAI()
TierType = Literal["micro", "core", "reasoning"]
def classify_task_tier(prompt: str, files_count: int = 1) -> TierType:
"""Classifies task complexity using rule heuristics (0 ms latency)."""
lower_prompt = prompt.lower()
# 1. Check Deep Reasoning Keywords
if any(k in lower_prompt for k in ["race condition", "cryptography", "formal proof", "deadlock", "algorithm optimization"]):
return "reasoning"
# 2. Check Core Engineering Complexity
if files_count > 1 or any(k in lower_prompt for k in ["refactor", "implement feature", "build api", "architecture", "unit tests"]):
return "core"
# 3. Default to Fast Micro Tier
return "micro"
def dispatch_routed_query(prompt: str, files_count: int = 1) -> str:
"""Dispatches prompt to optimal model tier based on complexity."""
tier = classify_task_tier(prompt, files_count)
if tier == "micro":
model_name = "gpt-4o-mini"
elif tier == "core":
model_name = "gpt-4o"
else:
model_name = "o1-mini"
print(f"🚀 Dispatching to Tier [{tier.upper()}] using model: {model_name}")
response = client.chat.completions.create(
model=model_name,
messages=[{"role": "user", "content": prompt}],
temperature=0.0 if "o1" not in model_name else 1.0
)
return response.choices[0].message.content
Across an engineering organization executing 100,000 monthly agent operations:
| Routing Architecture | Monthly API Spend | Average Task Latency | Developer Feedback |
|---|---|---|---|
| All Flagship (Sonnet / GPT-4o) | $4,500 / month | 2.4 seconds | Baseline |
| 3-Tier Dynamic Dispatch | $1,120 / month | 0.8 seconds (3x Faster!) | $3,380 Monthly Savings |
MANDATORY: Agent orchestration frameworks must evaluate task complexity prior to model invocation. Mechanical triage, formatters, and single-file linters must route to Tier 1 Micro models (Haiku / Flash / Mini) rather than consuming Tier 2/3 flagship quotas.
What SKILL.md sets; muted values are Claude Code's defaults
412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills