agentsop-cost-tiered-models

A guide for splitting a multi-step language-model workflow between a strong model for planning and decisions and a cheaper model for repetitive execution.

In plain words
What is it for?
Use it to design lower-cost model assignments in agent workflows, code editing, optimization pipelines, speculative generation, and supervisor-worker systems.
Why use it?
It avoids using the most expensive model for every step when many steps only require rewriting, extracting, formatting, or applying an existing decision.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/agentsope/skillalchemy/agentsop-cost-tiered-models
Any agent
npx skills add agentsope/SkillAlchemy --skill agentsop-cost-tiered-models
Clone the repo
git clone --depth 1 https://github.com/agentsope/SkillAlchemy

Made for: Claude Code, Codex.

Per session 154 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,232 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00154 $0.06232
Opus 5 $0.00077 $0.03116
Sonnet 5 $0.00031 $0.01246
Haiku 4.5 $0.00015 $0.00623

Measured yesterday against content hash 1503eee192f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agentsop-cost-tiered-models 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 yesterday.

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.

skills/agentsop-cost-tiered-models/SKILL.md · 297 lines

How it starts

The opening of the file, as written. The whole thing — 297 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cost-aware Model/Role Split — "强推理者 + 廉价执行者"

一句话:一条多次调用 LM 的工作流里,少数调用需要推理,多数调用是机械执行。让一个强模型做决策,让一个便宜模型干活——按认知负荷拆分,不是按"哪个更准"拆分。

统一声明:Phase B 发现这个模式在 4 个 SOP 里以 4 个名字反复出现——DSPy 的 optimizer-LM vs task-LM、Aider 的 architect+editor、vLLM 的 speculative draft+target、LangGraph 的 supervisor+worker。它们是同一个形状。本技能把这个形状抽出来,命名为 cost-tiered models。详见 §7 跨框架对照。


1. 何时激活 (When to activate)

任一情形成立时激活本技能:

  • 工作流会对 LM 发起多次调用,且这些调用认知负荷不均——有的需要规划/推理/判断,有的只是改写、抽取、格式化、应用一个已定好的决定。
  • 你正在为一条 LM 流水线选模型,并且默认想"全程用同一个最强模型"——这是本技能要挑战的反射。
  • 你有一个强 reasoner 但执行差的模型(典型:o1/o3 推理强但编辑代码格式脏),需要给它配一个干净的执行者。
  • 你在成本/延迟压力下,想知道哪些调用可以降级到便宜模型而不掉质量。
  • 你在设计 agent 编排(supervisor 路由 + worker 执行),或 推理加速(speculative draft + target verify),意识到这和上面是同一个决策。

不应激活(见 §6):

  • 单次调用、无内部步骤的工作流——没有可拆分的角色。
  • 微型工作流(2–3 次调用、总成本可忽略)——拆分的协调开销 > 节省。
  • 质量是唯一目标、成本无关紧要的场景——直接全程用最强模型。

2. 核心心智模型 (Core Mental Model)

按认知负荷拆分:一个强模型做决策,一个便宜模型执行——而且绝大多数调用是执行。

2.1 两层,不是一层

绝大多数团队的默认是"全程一个模型"。这把两种本质不同的工作混在了一个价位上:

工作性质 调用频率 模型要求 选谁
Tier-S(决策层) 规划、推理、路由、判断、提案 (每任务 1–N 次) 推理强;执行干不干净不重要 最强 reasoner
Tier-E(执行层) 改写、抽取、格式化、应用决定、生成草稿 (占总调用 80%+) 听话、格式干净、便宜、快 便宜/快模型

关键洞察:成本由调用次数主导,调用次数由执行层主导。所以把执行层降级到便宜模型,省下大部分成本,却几乎不碰决策质量——因为决策层调用次数少,仍然用最强模型。

2.2 为什么"强 reasoner 执行差"是常态而非例外

推理能力和指令依从(产出干净的 diff/JSON/格式)是两种不同的能力,不总同向。Aider 的 Polyglot 数据是最干净的证据:o1-preview 单独跑 79.7%,但它当 architect 配一个便宜 editor 后,整体到 82.7%–85%——两次便宜的专门调用胜过一次又贵又全能的调用 [aider.chat/2024/09/26/architect.html]。强模型负责"想",便宜模型负责"把想法落成格式正确的编辑"。

2.3 三种省钱方向,同一个形状

  • 省钱:执行层从 GPT-4o 降到 mini/Llama,决策层不动。
  • 提质:把"想"和"做"解耦,强模型不再被格式约束分心(JSON-wrapping 实测会降低模型推理能力 [aider.chat/2024/08/14])。
  • 提速:便宜模型先草拟(draft),强模型只做验证(vLLM speculative decoding 的本质就是这个 [docs.vllm.ai speculative_decoding])。

三者都是"强决策 + 廉价执行"的拆分,只是优化目标不同。

2.4 升级阀门(escalation valve)

拆分不是单向的。便宜执行者会在某些输入上失败或退化(格式错、跑题、质量塌)。正确的设计带一个回退-升级阀门:检测到执行层失败 → 把这一步升级到强模型重试。便宜执行者覆盖 80–95% 的常规输入,强模型兜底长尾。这把"省钱"和"不掉质量"同时拿到。

Read the full file on GitHub · 297 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. yesterday First seen · 297 lines · 154 tokens per session scan A 1503eee192f3

Subscribe to this mod's changes

agentsop-cost-tiered-models is a skill published in the GitHub repository agentsope/SkillAlchemy (342 stars, last pushed 7d ago), licensed MIT. It adds 154 tokens to every session and 6,232 once invoked, about $0.0008 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-08-30.

Related

Other skills, from other repositories

shellgames

Play board games on ShellGames.ai — Chess, Poker, Ludo, Tycoon, Memory, and Spymaster. Use when the agent wants to play games against humans or other AI agents, join tournaments, chat with players, check leaderboards, or manage a ShellGames account. Triggers on "play chess/poker/ludo/memory", "shellgames", "join…

MemTensor/skills-vote · 103 tokens

curl-search

Web search using curl + multiple search engines (Baidu, Google, Bing, DuckDuckGo). Activates when user asks to search, look up, or query something online. Includes security enhancements: input sanitization, command injection protection, and URL encoding.

MemTensor/skills-vote · 55 tokens

skills-vote-local

Use when retrieving the most relevant skills from a local or private skill library instead of relying on network-based skill discovery.

MemTensor/skills-vote · 28 tokens

skills-vote

Find the most relevant external agent skills for the current task, then submit grounded feedback about which skills were actually used and useful in the same session. Whenever you start a task, use this skill first.

MemTensor/skills-vote · 44 tokens

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and…

MemTensor/skills-vote · 92 tokens

xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or…

MemTensor/skills-vote · 201 tokens