prompt-engineering-cost
Installation
SKILL.md
Prompt Cost & Latency Engineering
Disclaimer. Cache mechanics, batch discounts, and per-token pricing change frequently. Provider documentation is authoritative. The patterns below are stable; the numbers aren't.
The two production constraints are dollars per request and wall-clock latency. Both are knobs, not constants. This skill lays out the levers in priority order — start at the top.
Lever 1 — Model routing
The single highest-leverage cost optimization: stop using the frontier model for tasks that don't need it.
| Task | Tier | Why |
|---|---|---|
| Classification, intent detection | cheap | Small, well-trained models match frontier on classification. |
| Extraction with a tight schema | cheap | Schema does the work. |
| Summarization (short → short) | cheap to mid | Match volume, not quality. |
| Drafting prose, code generation | mid | Quality matters but not frontier-level. |
| Multi-step reasoning, planning | frontier | Where the gap is largest. |
| Ambiguous synthesis, novel problems | frontier | Same. |
| Adversarial / safety-critical | frontier (with eval) | Wrong answers expensive. |