AGENT SKILL

token-economics-architect

Architect-level token cost modelling — input versus output pricing, context growth in conversation, caching economics, reasoning-token overhead, per-tenant budgets and caps, and the unit-economics view that connects a feature to a bill. Use when AI features must be priced, capped, or made cheaper.

License 许可
MIT
最近更新
2026-11-13
Stars
★ 0
Forks
0

01 前言 Front Matter

name
token-economics-architect
license
MIT
metadata
{ "crusor-path": "ai-ml-architect/llm-architect/token-economics-architect", "crusor-domain": "ai-ml-architect", "crusor-origin": "original", "crusor-sources": "platform.openai.com/docs/pricing; docs.anthropic.com/en/docs/about-claude/pricing; ai.google.dev/gemini-api/docs/pricing", "crusor-triggers": "token cost, pricing, cost per request, context window cost, prompt caching cost, llm budget, unit economics, cost per user", "crusor-verified-on": "2026-10-30" }
description
Architect-level token cost modelling — input versus output pricing, context growth in conversation, caching economics, reasoning-token overhead, per-tenant budgets and caps, and the unit-economics view that connects a feature to a bill. Use when AI features must be priced, capped, or made cheaper.
compatibility
Any provider with per-token pricing

03 SKILL.md 正文

Token Economics Architect

Token cost is a product constraint that belongs in the design doc. A feature without a cost model is a feature whose economics are discovered by finance.

When to use

  • Pricing a feature or setting per-tenant limits.
  • Costs growing faster than usage.
  • Choosing a model, a context strategy, or a caching layer.

When NOT to use

  • Prototype with ten users — measure later, but instrument now.

Decision 1 — The arithmetic

cost/request = (input_tokens × in_price) + (output_tokens × out_price)
             + cached_input_adjustment + reasoning_tokens (if billed)
cost/user    = cost/request × requests/user/day × 30
  • Output tokens usually cost 3–5× input; verbose answers are expensive.
  • Reasoning/thinking models bill tokens you never show the user — budget them.
  • Every hop in a chain multiplies; count the hops in the design.

Decision 2 — What grows silently

Growth Fix
conversation history resent each turn summarise, window, or cache
retrieved chunks growing per query cap k, rerank, trim
system prompt bloating over time review quarterly, it is code
tool outputs pasted whole truncate + summarise
retries and repair loops bound attempts, measure the rate
multi-agent chatter fewer agents, tighter handoffs
  • A 10-turn conversation with full history is quadratic in tokens; that is the most common surprise.

Decision 3 — Caching

Cache Saves
provider prompt cache repeated prefix tokens
exact-match response cache identical requests
semantic cache near-duplicate requests (risky)
application-level summaries re-computation
  • Prompt caching pays only when the prefix repeats inside the provider's TTL.
  • Exact-match caching is safe; semantic caching trades correctness for savings and needs its own eval.
  • Log cache hit rate; a 0% hit rate usually means an unstable prefix.

Decision 4 — Budgets and caps

  • Per-request cap (max tokens) and per-tenant monthly cap, enforced in code.
  • Hard stop with a clear message, not a silent degradation.
  • Alert at 80% of budget, anomaly-detect at 3× hourly baseline.
  • Rate limits per tenant prevent one account from consuming the pool.

Decision 5 — Unit economics

  • Cost per active user, per successful task, per tenant — not just per token.
  • Compare against the value delivered (conversion, time saved, ticket deflection).
  • Fail rates matter: a retried request costs twice and delivers nothing.
  • Price tiers from measured p50 and p95 usage, not average.

Decision 6 — Reduction levers, in order

  1. Shorten outputs and constrain format.
  2. Trim context; rerank and cap retrieval.
  3. Route to a cheaper model where evals allow.
  4. Cache stable prefixes.
  5. Fine-tune a smaller model for narrow, high-volume tasks.

Do them in that order — fine-tuning first is the classic expensive mistake.

Failure modes at scale

  • Full history resent every turn; cost grows 4× by message ten.
  • No per-tenant cap; one customer's automation consumes the month's budget.
  • Semantic cache returning a stale answer after a pricing change.
  • Reasoning model in a chat feature; visible latency and invisible cost.
  • Costs tracked per provider, never per feature, so nobody knows what to cut.

Verification receipts

  1. Cost model per request with input/output split and hop count.
  2. Usage dashboard by feature and tenant, with caps configured.
  3. Cache hit rate and the savings attributed to it.
  4. Cost per successful task before and after the reduction pass.
  5. Budget alert exercised with a synthetic volume spike.

04 同仓库更多 Skills

SriAkhilSJ
SriAkhilSJ/PulseAIRepo

interaction-patterns-architect

Architect-level interaction design in code — choosing established patterns over invented ones, feedback and latency behaviour, destructive-action safeguards, navigation and overlay conventions, and the state model behind every interactive surface. Use when a screen has to behave, not just look.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

design-system-ops-architect

Architect-level operation of a design system in code — token pipelines and versioning, component API and variant policy, the catalogue as the contract, adoption metrics, and the governance that stops a system from forking into three. Use when a component library must survive several teams.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

design-handoff-architect

Architect-level design handoff — what must be specified before implementation starts, tokens over raw values, responsive and content-limit contracts, state matrices, and the review loop that catches drift between design and code. Use when a design is about to become code.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

content-microcopy-architect

Architect-level UI content — where strings live, voice and terminology consistency, error and empty-state copy as part of the interface, translation-ready authoring, and the content model a product needs before it multiplies screens. Use when the words in the interface matter as much as the pixels.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

ui-ux-implementation-architect

Architect-level direction for turning a design into working UI — the handoff contract, component ownership versus screen-level layout, interaction and state conventions, design QA gates, and the review habits that keep an implementation faithful without frozen pixels. Use before any specific UI implementation skill.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

test-strategy-architect

Architect-level test strategy — allocating assertions across unit, integration, contract and end-to-end layers, designing for testability through dependency boundaries, fixture and data strategy, and the flake and coverage policies that keep a suite trustworthy. Use when defining how a codebase is tested.

★ 0