jpeetz/agent-skills

model-routing-cost-optimizer

Use when routing tasks to the cheapest fitting model tier.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/jpeetz/agent-skills --skill model-routing-cost-optimizer

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Model Routing Cost Optimizer

Route every agent task to the cheapest model that can still do it well. This skill establishes a three-tier model hierarchy (cheap / mid / premium), a task classifier that buckets work into ROUTINE / MODERATE / COMPLEX, and the decision rules that turn a description into a model pick. It does not enforce any one provider — the tier prices live in references/model-pricing.md so the body stays provider- neutral — and it does not cover local quantized inference.

The core belief is blunt: most agent work is routine, and routing routine work to a premium model is pure waste. Down-tier by default; escalate on evidence, never on habit.

When to Use

Use this skill when you want to:

  • Choose which model should handle a task, a sub-agent, or a cron job.
  • Decide whether the current model is overkill for what you are about to run.
  • Spawn sub-agents at a cost that matches the work.
  • Keep heartbeat, monitoring, and scheduled-report traffic off premium models.
  • Explain to a teammate why one model is running a task instead of another.
  • Classify a batch of tasks into ROUTINE / MODERATE / COMPLEX for tiering.

Don't use for: fine-tuning a model, model evaluation or benchmarking, serving infrastructure (vLLM / TGI), or any task where correctness risk is high and you need the best possible reasoning regardless of price. If the work is irrecoverable or safety-critical, stop tiering and use the premium model.

Prerequisites

  • Visibility into the models your agent or gateway exposes (OpenRouter catalog,

a provider console, or the model config of OpenClaw / Claude Code / Codex).

  • No secret is required to operate this skill; the pricing table in

references/model-pricing.md is illustrative, so refresh it against provider docs before relying on a number.

  • If you run the classifier, scripts/classify_task.py is stdlib-only.

Decision Rules (read these before you pick a model)

  • Rule 1 — vision. If the task needs images (screenshots, photos, charts,

image generation), pick a vision-capable model. Never route vision work to a text-only model just because it is the cheap tier — the cheapest viable model is the cheapest one that can actually see.

  • Rule 2 — escalation. If a cheaper model already failed the same task, move

one tier up, not down; re-trying the same failed tier burns more than one upgrade.

  • Rule 3 — explicit signals. Complex words like debug, architect,

design, security, adversarial, ambiguous push to Tier 3. Routine words like read, fetch, check, format, status, list push to Tier 1.

  • Rule 4 — classify by default. Otherwise classify the task with the procedure

and pick the tier that matches.

Task Classification

BucketHeuristicTypical Examples
ROUTINE → Tier 1Single-step, deterministic, no judgmentfile I/O, heartbeat, status check, lookup, formatting, URL fetch
MODERATE → Tier 2Multi-step but well-scopedcode-gen on known patterns, summarization, draft writing, data transforms
COMPLEX → Tier 3Ambiguous, multi-approach, high-stakesmulti-step debugging, architecture, security review, long-context reasoning

Quick Reference

ConcernMove
Task is routineTier 1
Task is moderateTier 2
Task needs image / visionvision-capable model (never a text-only tier-1)
Task already failed on cheapmove up (escalation), never down
Heartbeat / cron / monitoringalways Tier 1
Sub-agent spawndefault Tier 1 unless clearly moderate+

Procedure

Each step ends with a checkable completion criterion.

  1. State the task. Write the task in one line, including whether it needs

images and whether a cheaper model already tried. Completion: you have a task statement with its vision and prior-failure flags.

  1. Classify. Run python3 scripts/classify_task.py "<task>" in the terminal,

or read the bucket heuristics above by hand. Completion: you have a label of `ROUTINE`, `MODERATE`, or `COMPLEX`.

  1. Apply the vision override. If the task is vision-requiring, restrict the

model choice to vision-capable options, ignoring any text-only option entirely — a text-only model cannot take image input at any price. Completion: the chosen model can actually accept image input.

  1. Apply escalation and signal overrides. If a prior failure exists, go one

tier up from the classifier result. If explicit complex signals appear, go to Tier 3. Completion: the final tier is never lower than the classifier would have produced.

  1. Name a concrete model. From the provider's resolvable list, pick the

cheapest model of the final tier that meets that tier's bar. Completion: you can name a concrete model, or a route to find one.

  1. Run the anti-pattern sweep. If this is a sub-agent, heartbeat, cron, file

I/O, or routine batch, drop it to Tier 1 unless the classifier returned MODERATE or above. Completion: no heartbeat/cron work remains on a premium tier.

Anti-Patterns

  • Feeding heartbeats / cron to premium models. A two-token status ping on a

flagship model is pure waste.

  • Spawning sub-agents at the parent's tier. Daemon children should be one tier

down unless the work is provably complex.

  • Refusing to upgrade when stuck. A cheap model that already failed costs more

if you keep retrying it; one step up is the cheaper path.

  • Routing vision to a text-only model. GLM-5 (and other cheap text-only tier-1/2

models) must never see image input. Send vision to a vision-capable model.

  • Tiering on habit. Do not stay on a new flagship model just because it is the

default; escalate on evidence only.

Verification

  • The classifier scripts/classify_task.py returns Tier 1 for a routine phrase,

Tier 2 for a moderate phrase, and Tier 3 for a complex phrase.

  • A vision phrase (screenshot / photo / chart) routes to a vision-capable model,

and a text-only model is never selected for it.

  • A failed-task phrase routes one tier up from baseline, never down.
  • The heartbeat / cron phrase never lands on a premium tier.
  • references/model-pricing.md exists and contains the pricing table and the

"prices change, check provider docs" caveat.

같은 저장소의 Skills

더 많은 Skills

모든 Skills
jpeetz
커뮤니티

accessibility-compliance-audit

Comprehensive web accessibility (a11y) audit and compliance skill. Audits HTML, React, Vue, and Angular codebases against WCAG 2.2 AA standards. Activates when users ask for "accessibility audit", "a11y check", "WCAG compliance", "ADA compliance", "screen reader testing", "keyboard navigation audit", "color contrast check", "accessibility fix", or "make this accessible". Detects violations, explains impact, and generates fix-ready code. Covers semantic HTML, ARIA authoring, focus management, col

설치 수
1
GitHub Stars
14
업데이트
10월 21일
jpeetz
커뮤니티

agent-n-video-pipeline

Use this skill when producing a fully-local "Agent N presents a message" video on the 16GB Apple-Silicon M5 executor: Kokoro mature TTS → LTX-2.3 MLX A2V talking render with native lip sync → karaoke captions → trim → QA → X caption. Replaces the old cloud Herald pipeline (grok-imagine + volcengine) with zero cloud cost. Activates for Herald release videos, Agent N announcements, and newsletter video messages.

설치 수
1
GitHub Stars
14
업데이트
10월 21일
jpeetz
커뮤니티

anti-over-engineering

Use when AI agents over-engineer code beyond user requests.

설치 수
1
GitHub Stars
14
업데이트
10월 21일
jpeetz
커뮤니티

api-and-interface-design

Use this skill when designing APIs, module boundaries, or any public interface. Create stable, well-documented interfaces that are hard to misuse — REST endpoints, GraphQL schemas, module contracts, component props. Covers contract-first design, error semantics, validation boundaries, idempotency, and consistent naming.

설치 수
1
GitHub Stars
14
업데이트
10월 21일