Логотип Model Routing

Model Routing

Спільнота
frankxai
model-routing

Intelligent model selection — routes tasks to Haiku (fast/cheap), Sonnet (balanced), or Opus (complex/strategic) by analyzing task complexity. Use when deciding which model to run, optimizing cost vs quality, or building a tiered routing layer.

Огляд

Видавецьfrankxai
Репозиторійclaude-skills-library
Назва навичкиmodel-routing
Зірки
47
Форки
6
Файли в пакеті
1
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 1

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: frankxai. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Model Routing у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/frankxai/claude-skills-library/tree/main/free-skills/model-routing
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/frankxai/claude-skills-library.git /tmp/claude-skills-library
mkdir -p .claude/skills
cp -r /tmp/claude-skills-library/free-skills/model-routing .claude/skills/model-routing
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Model Routing в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Model Routing, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Model Routing не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Model Routing System

You have access to intelligent model routing. Before executing any task, analyze complexity and route to the appropriate model tier.

Current model IDs and pricing — Last verified: 2026-08-28. Re-verify at platform.claude.com before trusting these again; they have moved more than once in 2026. Haiku → claude-haiku-4-5 ($1.00 / $5.00 per 1M input/output) · Sonnet → claude-sonnet-5 ($2.00 / $10.00) · Opus → claude-opus-5 ($5.00 / $25.00, default). For the hardest long-horizon reasoning, escalate above Opus to claude-fable-5 ($10.00 / $50.00 — most capable; thinking is always on, no disabling it; reserve for genuinely demanding work). Model IDs are complete as written — never append a date suffix. The tiers below are model-agnostic.

Routing Decision Matrix

TASK COMPLEXITY ANALYSIS
────────────────────────────────────────────────────────────────

HAIKU (Fast, Cheap) - claude-haiku-4-5 - Use for:
├── Simple file operations (read, list, navigate)
├── Scaffolding and boilerplate generation
├── Deterministic transformations (format, lint, compile)
├── Status checks and health monitoring
├── SEO metadata generation
├── Deployment commands (after code is written)
├── Documentation formatting
├── Simple search and replace
│
│   Token cost: $1.00/1M input, $5.00/1M output
│   Latency: Fastest
│   Use when: Task has clear, unambiguous steps

SONNET (Balanced) - claude-sonnet-5 - Use for:
├── Feature implementation (standard complexity)
├── Bug fixes requiring analysis
├── Content writing (articles, social posts)
├── Code review and quality checks
├── Test generation
├── Refactoring with clear patterns
├── API integration work
├── Database schema design
│
│   Token cost: $2.00/1M input, $10.00/1M output
│   Latency: Medium
│   Use when: Task requires reasoning but not deep strategy

OPUS (Strategic, Complex) - claude-opus-5 - Use for:
├── Architecture decisions (system design)
├── Multi-agent coordination (council, swarm)
├── Strategic planning (business, product)
├── Complex debugging (multi-file, subtle bugs)
├── Security audits and vulnerability analysis
├── Enterprise AI system design
├── Book writing (narrative, character development)
├── Research synthesis (multiple sources)
├── Ambiguous requirements interpretation
│
│   Token cost: $5.00/1M input, $25.00/1M output
│   Latency: Slower; most capable of the routine tiers
│   Use when: Task requires deep reasoning, creativity, or strategy

FABLE (Hardest, escalation only) - claude-fable-5 - Use for:
├── Long-horizon agentic work where Opus already fell short
├── The single hardest step in an otherwise-Opus-routed task
│
│   Token cost: $10.00/1M input, $50.00/1M output
│   Latency: Slowest; thinking is always on (cannot be disabled)
│   Use when: Opus-tier reasoning wasn't enough — this is a ceiling, not a starting point

Automatic Routing Rules

When processing a request, apply these rules:

Route to HAIKU when:

  • User says: "deploy", "format", "lint", "check status", "list", "scaffold"
  • File patterns: *.config.*, package.json, tsconfig.json
  • Commands: /mcp-status, /inventory-status, /nextjs-deploy (execution phase)

Route to SONNET when:

  • User says: "write", "implement", "fix", "create", "build", "test"
  • File patterns: *.ts, *.tsx, *.py, *.md (content files)
  • Commands: /article-creator, /create-music, /spec, /generate-social

Route to OPUS when:

  • User says: "design", "architect", "strategy", "council", "analyze", "research"
  • Keywords: "enterprise", "system", "multi-agent", "complex", "strategic"
  • Commands: /starlight-architect, /council, /author-team, /research

Escalate to FABLE when:

  • Opus already ran on the task and the result fell short
  • The task is genuinely the hardest tier — long-horizon agentic work, not routine strategy
  • Never route here first; Fable is a ceiling for escalation, not a default

Cost Optimization

BEFORE (No routing):
  All tasks → Opus → $25.00/1M output tokens

AFTER (With routing):
  Simple tasks (40%) → Haiku  → $5.00/1M   = $2.00
  Medium tasks (45%) → Sonnet → $10.00/1M  = $4.50
  Complex tasks (15%) → Opus  → $25.00/1M  = $3.75
  ──────────────────────────────────────────────
  TOTAL: $10.25 vs $25.00 = 59% cost reduction

Implementation in Task Tool

When using the Task tool, specify model based on routing:

javascript
// Simple task - use haiku
Task({
  subagent_type: "Explore",
  model: "haiku",
  prompt: "List all files in src/"
})

// Medium task - use sonnet (default)
Task({
  subagent_type: "code-reviewer",
  model: "sonnet",
  prompt: "Review this PR for issues"
})

// Complex task - use opus
Task({
  subagent_type: "Plan",
  model: "opus",
  prompt: "Design the architecture for a multi-tenant SaaS platform"
})

Command-Level Routing

CommandDefault ModelRationale
/acossonnetRouter needs reasoning
/article-creatorsonnetContent creation
/create-musicsonnetCreative work
/infogeniussonnetResearch + creation
/starlight-architectopusStrategic design
/councilopusMulti-perspective
/researchsonnetInformation synthesis
/specsonnetFeature planning
/nextjs-deployhaikuExecution
/mcp-statushaikuStatus check
/inventory-statushaikuStatus check
/publishhaikuExecution
/polish-contentsonnetEditing
/review-contentsonnetQuality check

Escalation Pattern

If a haiku-routed task fails or produces poor results:

  1. Automatically escalate to sonnet
  2. If still failing, escalate to opus
  3. If opus itself falls short on a genuinely hard task, escalate to Fable — last resort, not a retry habit
  4. Log escalation for learning
haiku (attempt) → fail → sonnet (retry) → fail → opus (retry) → fail (rare) → fable (last resort)

Relationship to other routing configs

This skill is the estate's model-facts reference — current model IDs, context windows, and per-token pricing. It is not the only routing config in the estate, and on task-class routing decisions it does not have the final word:

  • starlight-evals/routing-table.json is the evidence-derived source of truth for task-class routing — which tier a task class should hit, backed by eval-round evidence and confidence scores rather than the judgment calls in this file. Where its route for a task class disagrees with the "Route to X when" rules above, the table wins.
  • agentic-ops-hub/fleet/model-routing.json and a referenced ~/.starlight/routing.toml are operational routing configs elsewhere in the estate. They route by abstract tier name (opus, sonnet, ...) and should resolve those names against this skill (or the evals table) rather than hardcoding their own model IDs or pricing.
  • This skill's job stays narrow: keep the model IDs, context windows, and pricing above correct and current. It is not merged with the other three configs here — this section exists only so the next agent knows which source to trust when they disagree.

Model Routing v1.1 - Implementing claude-flow's intelligent routing pattern. Last verified: 2026-08-28.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Model Routing?

Intelligent model selection — routes tasks to Haiku (fast/cheap), Sonnet (balanced), or Opus (complex/strategic) by analyzing task complexity. Use when deciding which model to run, optimizing cost vs quality, or building a tiered routing layer.

Навіщо використовувати Model Routing у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Model Routing — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Model Routing у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/frankxai/claude-skills-library/tree/main/free-skills/model-routing. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Model Routing?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Model Routing?

Зі скількома забажаєте. У TypingMind ви можете використовувати Model Routing із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Model Routing?

Так. На GitHub цю навичку публікує frankxai за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇