ZM

zscole/model-hierarchy-skill

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

346 stars 质量 47 趋势 19MIT

zscole/model-hierarchy-skill 是从 https://github.com/zscole/model-hierarchy-skill. 导入的代理技能候选

概览

zscole/model-hierarchy-skill 是从 https://github.com/zscole/model-hierarchy-skill. 导入的代理技能候选

概述(AI 翻译)

通过根据复杂度将任务分配到合适的模型,优化AI代理运营的成本。

问题

大多数AI代理都用昂贵的模型来运行所有操作。但80%的代理任务都是例行的:文件读取、状态检查、格式化、简单的问答。你花15-75美元/百万代币做的工作,0.14美元/百万代币就能完成。

解决方案

一项技能教代理分类任务,并将其路由到最便宜且能处理这些任务的模型:

任务类型 模型层级 成本 示例
例行程序(80%) 便宜 0.14-0.50美元/分钟 文件操作、状态检查、格式化
中等(15%) 中 1-5美元/月 代码生成、摘要、草稿
复杂(5%) 高级 10-75美元/百万 调试、架构、新颖问题

结果:~成本降低10倍,且在重要任务上保持同等质量。

快速启动

开爪

克劳德密码 / 密码本

在你的CLAUDE.md或项目说明中添加:

其他代理系统

完整的分类规则和积分示例请参见 SKILL.md。

成本数学

假设每天有10万代币:

策略 月成本
纯粹的作品 ~$225
纯粹的十四行诗 ~$45

本页由 AI 翻译,技术细节请以原文为准。

README

model-hierarchy-skill

Cost-optimize AI agent operations by routing tasks to appropriate models based on complexity.

The Problem

Most AI agents run everything on expensive models. But 80% of agent tasks are routine: file reads, status checks, formatting, simple Q&A. You’re paying $15-75/M tokens for work that $0.14/M tokens handles fine.

The Solution

A skill that teaches agents to classify tasks and route them to the cheapest model that can handle them:

Task Type Model Tier Cost Examples
Routine (80%) Cheap $0.14-0.50/M File ops, status checks, formatting
Moderate (15%) Mid $1-5/M Code gen, summaries, drafts
Complex (5%) Premium $10-75/M Debugging, architecture, novel problems

Result: ~10x cost reduction with equivalent quality on the tasks that matter.

Quick Start

OpenClaw

# Copy SKILL.md to your skills directory
cp SKILL.md ~/.openclaw/skills/model-hierarchy/SKILL.md

# Restart gateway to pick up the skill
openclaw gateway restart

Claude Code / Codex

Add to your CLAUDE.md or project instructions:

## Model Routing

Before executing tasks, classify complexity:
- ROUTINE (file ops, lookups, formatting) → Use cheapest model
- MODERATE (code, summaries, analysis) → Use mid-tier model  
- COMPLEX (debugging, architecture, failures) → Use premium model

When spawning sub-agents, default to cheap models unless task requires more.

Other Agent Systems

See SKILL.md for the full classification rules and integration examples.

Cost Math

Assuming 100K tokens/day:

Strategy Monthly Cost
Pure Opus ~$225
Pure Sonnet ~$45
Hierarchy (80/15/5) ~$19

Testing

# Run classification tests
python -m pytest tests/ -v

# Test specific scenarios
python tests/test_classification.py

Files

model-hierarchy-skill/
├── SKILL.md          # The skill (install this)
├── README.md         # You're here
├── tests/
│   ├── test_classification.py
│   └── scenarios.json
└── examples/
    ├── openclaw.md
    └── claude-code.md

License

MIT

在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add zscole/model-hierarchy-skill
新手?先看 mcpskill.org 教程 →