Логотип Model Routing

Model Routing

Сообщество
nahid-sparktales
model-routing

Pick a model per job and degrade sensibly when one fails — a quality bar per call site, candidates compared on the same task set, a readable routing rule, and an explicit retry-versus-fallback path with pinned model ids. Use when cost or latency has become a problem, when adding a cheaper or larger model to an existing system, or when a fallback fires silently and quality drops without anyone noticing. Not for prompt authoring, not for retrieval tuning, and not for capacity or infrastructure planning.

Обзор

Издательnahid-sparktales
Репозиторийagent-dispatcher
Название навыкаmodel-routing
Звёзды
58
Форки
5
Файлы в комплекте
1
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

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

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

  • Открытый исходный код

    Издатель навыка на GitHub — nahid-sparktales. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Model Routing в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/nahid-sparktales/agent-dispatcher/tree/main/skills/ai/model-routing
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nahid-sparktales/agent-dispatcher.git /tmp/agent-dispatcher
mkdir -p .claude/skills
cp -r /tmp/agent-dispatcher/skills/ai/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

Routing is a claim that one job needs less than another. That claim is either measured or it is a guess with a billing line attached. The expensive mistake is not picking the wrong model — it is switching models and having no way to notice what got worse.

When this fires

A system calls more than one model, or is about to, and someone needs to decide which call goes where and what happens when a call fails. It also fires when a fallback exists and nobody can say how often it triggers. It does not fire for a single call site with no cost or latency pressure — there, one capable model and no routing layer is the correct design.

Procedure

  1. Enumerate the jobs, not the models. Each call site is a job with its own latency budget, output shape, error tolerance, and whether a human sees the output before it has an effect. Routing decisions belong per job; a single global "which model do we use" question has no answer.
  2. Write the quality bar for each job before looking at any candidate. What output counts as acceptable, and how that is checked: exact match, schema validity, a rubric, a graded sample, human spot check. Without a bar, "the cheap one is fine" is an opinion that cannot be argued with or refuted.
  3. Do not build a routing layer before there is a measured problem. One capable model everywhere, instrumented for cost and latency per job, is the right starting point. Routing added on anticipation is a permanent source of drift for a saving nobody has sized.
  4. Build a task set per job — 20–50 real inputs with known-acceptable outputs, drawn from production traffic where possible, including the awkward ones. Every candidate is judged on the identical set; a candidate evaluated on its own examples proves nothing.
  5. Run each candidate against it and compare in this order: pass rate against the bar first, then latency, then cost per accepted output. Cost per token is the wrong unit — a cheap model that fails a third of the time and needs a retry, a repair pass, or a human is not cheap.
  6. Re-tune the prompt per candidate before concluding. A prompt shaped around one model's habits can fail on another for reasons that have nothing to do with capability. If you did not re-tune, say the comparison is provisional.
  7. Route on observable properties of the request: input size, whether structured output is required, whether tools are called, whether the result is user-facing, whether a human reviews it. Keep the rule as a readable table mapping condition to model. Do not add a classifier to choose a model until the table has been measured and found wanting.
  8. Pin model identifiers explicitly and record them with every result. Moving aliases drift under you, and an evaluation whose exact model id and date were not recorded cannot be compared with anything later. Check the provider's current documentation for the id rather than recalling one.
  9. Separate retry from fallback in the failure path. A rate limit, timeout or transient overload is a retry against the same model with backoff and jitter. A refusal, a persistently failing validation, or a provider outage is a fallback to a different model. Wire the retry mechanics from the idempotency-and-retries skill; a retried call with a side effect needs an idempotency key regardless of which model answered.
  10. Validate the fallback's output the same way you validate the primary's. The common production failure is a fallback that returns quickly, passes no check, and is served.
  11. Make degradation visible. Every response records which model answered, whether it was the fallback, and whether validation failed first. Alert on fallback rate, not only on errors — a silent fallback converts a quality regression into a mystery weeks later.
  12. Cap the chain. A budget per request and per session, a maximum number of hops, and a defined behaviour when the cap is hit: refuse, queue, or ask the user. An unbounded fallback chain turns one bad request into an unbounded bill.
  13. Keep the routing rule in configuration, so a bad route is a config change rather than a deploy. One table, one place — not a per-call-site conditional scattered through the codebase.
  14. Re-measure after the routing change lands, per job: pass rate, cost per accepted output, latency, and fallback rate. An average that improves while one job's pass rate halves is a regression that the average is hiding.

Checklist

  • Jobs enumerated with their own latency, structure and review requirements
  • A written quality bar and a check method per job
  • One task set per job, used unchanged for every candidate
  • Prompts re-tuned per candidate, or the comparison labelled provisional
  • Candidates compared on pass rate, then latency, then cost per accepted output
  • Routing rule expressed as a readable table on observable request properties
  • Model ids pinned and recorded with every measurement and every response
  • Retry and fallback distinguished, with backoff and jitter on the retry path
  • Fallback output validated with the same check as the primary
  • Which model answered, and any fallback, is recorded and alertable
  • Budget and hop caps set, with a defined behaviour at the cap
  • Post-change per-job measurements taken, not just an aggregate

Failure handling

  • A candidate wins on average but loses on a subset — that subset is a job. Split it and route it separately; do not average it away.
  • The task set is too small to separate two candidates — say so and report the result as inconclusive. A five-example difference is noise, and shipping on it is how quality drifts.
  • The cheaper model passes but the outputs are subtly worse — the bar is too loose. Fix the bar before re-running; a check the bad output passes is not a check.
  • Fallback rate is high — treat it as a capacity or provider problem first. Routing more traffic to the fallback hides the signal instead of resolving it.
  • Switching a production route — that changes what users receive. Propose it with the numbers and ask; roll it out behind the config from step 13 so it can be reverted without a deploy.
  • A provider's published numbers are the only evidence — they are not comparable across vendors and were not measured on your task. Cite them as context, never as the result.

Evidence to report

The job table with each job's quality bar; the task set size and where its inputs came from; per-candidate pass rate, latency and cost per accepted output, with exact model ids and the date run; whether prompts were re-tuned per candidate; the routing rule as written; the retry and fallback paths with their caps; and, after the change, per-job before-and-after numbers plus the observed fallback rate. "We route the easy ones to the small model" with no task set and no model ids is a preference, not a measurement.

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Model Routing?

Pick a model per job and degrade sensibly when one fails — a quality bar per call site, candidates compared on the same task set, a readable routing rule, and an explicit retry-versus-fallback path with pinned model ids. Use when cost or latency has become a problem, when adding a cheaper or larger model to an existing system, or when a fallback fires silently and quality drops without anyone noticing. Not for prompt authoring, not for retrieval tuning, and not for capacity or infrastructure planning.

Зачем использовать Model Routing в TypingMind?

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

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

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/nahid-sparktales/agent-dispatcher/tree/main/skills/ai/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 по лицензии MIT. Издатель — nahid-sparktales. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все
Логотип openclaw

Claw Score

openclaw
ОрганизацияПопулярный

Проверяйте или обновляйте документацию с оценочной картой зрелости OpenClaw на основе корневой таксономии, оценок зрелости и артефактов QA, не используя данные maintainer discrawl или закоммиченные отчёты об инвентаризации.

82.2K
391K
Файлы: 51
Открыть
Логотип openclaw

Clawdtributor

openclaw
ОрганизацияПопулярный

Задачи Clawtributor PR за прошлую неделю или другой период: находите ссылки на обсуждения, перепроверяйте данные на GitHub и ранжируйте по влиянию.

82.2K
391K
Инструкции
Открыть
Логотип openclaw

Control Ui E2e

openclaw
ОрганизацияПопулярный

Используйте при проектировании, тестировании, исправлении или расширении графического интерфейса OpenClaw Control UI, включая галереи стресс-тестов интерфейса с полями для отзывов, сквозные проверки Vitest + Playwright, сценарии Gateway с заглушками…

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Discord E2e

openclaw
ОрганизацияПопулярный

Тестируйте Discord с QA-ботами, арендуемыми через Convex: проверяйте учётные данные без Gateway, тестируйте сообщения от своего имени или подтверждайте ответы OpenClaw, файлы, треды, реакции, потоковую передачу и индикатор набора текста. Различайте данные API и…

82.2K
391K
Файлы: 4
Открыть

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇