cost-aware-llm-pipeline
Skill0 starsChanged 2 months agoMITView on GitHub
Design and optimize cost-efficient LLM application architectures. Covers model tiering, task complexity routing, prompt caching strategies, token budget fences, and retry backoff. Use when reducing API spend, establishing token budgets, or architecting multi-model fallback cascades. Not for client runtime latency/bundle audits (full-performance-audit) or prompt phrasing refinement (prompt-optimizer).
21 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- pankaj-mahaur/Agent-Daemontheir own version, first seen Nov 6, 2026
- TsinHzl/claude-code-configtheir own version, first seen Nov 1, 2026
- renepf/claude-skillstheir own version, first seen Oct 25, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- gongyijie85/dsh-ecctheir own version, first seen Oct 13, 2026
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- loulanyue/awesome-claude-notes★ 272same name
- Fmarzochi/EGC★ 61same name
- gongyijie85/dsh-ecc★ 8same name
- Puen2001/aether-os★ 2same name
- TsinHzl/claude-code-config★ 2same name
- get-proofpilot/claude-skills-catalog★ 1same name
- junimnjw/everything-claude-code★ 1same name
- NISTALTALSON/essential-claude-skills★ 1same name
- Rojios/everything-claude-code★ 1same name
- royaluniondesign-sys/claude-os★ 1same name
11 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository47 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- academicSkill
- adhdSkill
- agent-architecture-auditSkill
- api-designSkill
- automation-audit-opsSkill
- browser-actSkill
- chrome-devtools-axiSkill
- click-path-auditSkill
- codebase-designSkill
- code-tourSkill
- contract-firstSkill
- diagnosing-bugsSkill
- diagram-designSkill
- domain-modelingSkill
- emil-design-engSkill
- eval-harnessSkill
- found-this-designSkill
- full-audit-keamananSkill
- full-performance-auditSkill
- gh-axiSkill
- grill-with-docsSkill
- humanizerSkill
- hyperframesSkill
- id-demo-videoSkill
- img2threejsSkill
- impeccableSkill
- install-anti-slopSkill
- markitdownSkill
- matt-code-reviewSkill
- mongodb-opsSkill
- playwright-qaSkill
- prompt-optimizerSkill
- prototypeSkill
- researchSkill
- scroll-craftSkill
- scroll-worldSkill
- skill-stocktakeSkill
- smartbook-ingestSkill
- smartdocSkill
- supabase-opsSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- vercel-opsSkill
- visual-studioSkill
- writing-for-agentsSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Place volatile per-request dynamic data, user queries, and timestamps strictly at the end of the prompt buffer.
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cost-Aware LLM Pipeline
Specialist for architecting cost-disciplined LLM applications and API integrations.
This skill balances output quality against token expenditure using complexity-based model routing, aggressive prompt caching, token budget ceilings, and graceful degradation cascades.
Boundaries & Handoffs
| Need | Route |
| Application bundle size, page latency, web vitals, database query profiling | full-performance-audit |
| Refining individual prompt wording, instructions, or negative constraints | prompt-optimizer |
| Benchmarking accuracy tradeoffs across cheaper models or prompt versions | eval-harness |
| Investigating failure loops or context pollution in an agent loop | agent-architecture-audit |
| Engineering cost-optimized LLM architectures, routing, and token budgets | cost-aware-llm-pipeline |
Core Patterns
Consult references/patterns.md for concrete implementation patterns:
- Complexity-Based Model Tiering:
- Tier 1 (Fast/Cheap): Simple classification, routing, entity extraction, straightforward summarization, unit-test parsing.
- Tier 2 (Balanced): Standard code generation, multi-file refactoring, initial technical writing, triage.
- Tier 3 (Frontier Reasoning): Architectural synthesis, deep multi-hop debugging, security threat modeling, formal verification.
- Rule: Always route to the lowest sufficient tier; escalate only on detected ambiguity or failed evaluation checks.
- Prompt Caching Structure:
- Organize prompts with invariant static prefixes (system instructions, tool definitions, reference schemas) at the top to maximize prefix-cache hits.
- Place volatile per-request dynamic data, user queries, and timestamps strictly at the end of the prompt buffer.
- Token Budget Fences:
- Establish hard limits on max completion tokens per turn.
- Enforce sliding context compaction thresholds (e.g. compact conversation at 60% of window capacity rather than overflowing at 95%).
- Retry Backoff & Fallback Cascades:
- Implement exponential backoff with full jitter for rate limits (
429) and server errors (5xx). - Cascade down to smaller models or cached responses when upstream limits are encountered.
- Implement exponential backoff with full jitter for rate limits (
- Cost Telemetry:
- Log input tokens, output tokens, cache-read tokens, and calculated cost per transaction.
- Set automated circuit breakers that halt autonomous loops when a cost threshold is exceeded.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

