Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add latestaiagents/agent-skills --skill model-routing-strategygit clone --depth 1 https://github.com/latestaiagents/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/latestaiagents/agent-skills/model-routing-strategy)<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/model-routing-strategy"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/model-routing-strategy/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/model-routing-strategy"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/model-routing-strategy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00048 | $0.02839 |
| Opus 5 | $0.00024 | $0.01419 |
| Sonnet 5 | $0.00010 | $0.00568 |
| Haiku 4.5 | $0.00005 | $0.00284 |
Grade A, and why
model-routing-strategy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 360 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Model Routing Strategy
Dynamically select the optimal model for each task to balance quality, cost, and latency.
When to Use
- Building applications using multiple LLM providers
- Optimizing costs while maintaining quality
- Need different model capabilities for different tasks
- Implementing fallback strategies
- A/B testing model performance
Model Comparison Matrix
Capability vs Cost
| Capability | Best Models | Cost Tier |
|---|---|---|
| Complex reasoning | Claude Opus, o1 | $$$ |
| General tasks | Claude Sonnet, GPT-4o | $$ |
| Simple tasks | Claude Haiku, GPT-4o-mini | $ |
| Code generation | Claude Sonnet, GPT-4o | $$ |
| Creative writing | Claude Opus, GPT-4 | $$$ |
| Extraction/Classification | Claude Haiku, GPT-4o-mini | $ |
Latency Comparison
| Model | Typical Latency (TTFB) |
|---|---|
| Claude Haiku | 200-400ms |
| Claude Sonnet | 400-800ms |
| Claude Opus | 800-1500ms |
| GPT-4o-mini | 200-400ms |
| GPT-4o | 400-700ms |
| GPT-4 Turbo | 500-1000ms |
Routing Strategies
Strategy 1: Complexity-Based Routing
type Complexity = 'simple' | 'medium' | 'complex';
interface Task {
prompt: string;
requirements: {
needsReasoning: boolean;
needsCreativity: boolean;
needsAccuracy: boolean;
maxLatencyMs?: number;
maxCostUSD?: number;
};
}
function assessComplexity(task: Task): Complexity {
const prompt = task.prompt.toLowerCase();
// Complex indicators
const complexPatterns = [
/analyze.*and.*compare/,
/explain.*step.*by.*step/,
/write.*comprehensive/,
/evaluate.*trade.*offs/,
/design.*architecture/,
/debug.*complex/,
/review.*security/
];
// Simple indicators
const simplePatterns = [
/summarize.*briefly/,
/extract.*from/,
/classify.*as/,
/format.*as.*json/,
/translate.*to/,
/fix.*typo/
];
if (complexPatterns.some(p => p.test(prompt)) ||
task.requirements.needsReasoning ||
task.requirements.needsCreativity) {
return 'complex';
}
if (simplePatterns.some(p => p.test(prompt))) {
return 'simple';
}
return 'medium';
}
function selectModel(complexity: Complexity): string {
const modelMap = {
simple: 'claude-haiku-4-5', // $0.25/$1.25 per 1M
medium: 'claude-sonnet-4-6', // $3/$15 per 1M
complex: 'claude-opus-4-6' // $15/$75 per 1M
};
return modelMap[complexity];
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 360 lines · 48 tokens per session scan A 82c67b41f64a
model-routing-strategy is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 48 tokens to every session and 2,839 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
ai-enterprise-ai-usecase-priority-assessment
A business-diagnosis helper for deciding which enterprise AI use cases deserve attention first. It turns supplied information into a summary, findings, recommended actions, and reusable deliverables.
mem0-integration
Mem0 memory layer integration for AI agents. Implement persistent, semantic memory for long-term context retention and personalization.
chroma-integration
Chroma local vector database setup and operations for development and production.
few-shot-example-gen
Few-shot example generation and optimization for improved LLM performance.
llm-classifier
LLM-based zero-shot and few-shot classification for flexible intent detection.
fw-review
Full Freshworks marketplace app review — iparams, frontend, serverless, FDK, security, and structured text report output — in one skill.