Cost-Aware LLM Pipeline
Keep LLM API spend under control with model routing, immutable cost tracking, narrow retries, and prompt caching.
- What
- Keep LLM API spend under control with model routing, immutable cost tracking, narrow retries, and prompt caching.
- Cost
- Free
- Needs
- Use "Cost-Aware LLM Pipeline" with your Muse.
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
Curated by Skill Harbor: composable patterns for controlling LLM API costs while keeping quality. Four techniques: model routing by task complexity (cheap models for simple tasks, top tier for complex ones, with threshold examples), immutable cost tracking (frozen dataclasses, cumulative spend, budget limit that fails fast), narrow retry logic (retry only transient errors like rate limits and 5xx, fail immediately on auth or bad-request errors), and prompt caching for long system prompts. A composition section shows all four wired into a single pipeline function, plus a 2026 pricing reference table across model tiers, best practices (start cheap, log routing decisions, set explicit budgets), and anti-patterns (most expensive model for everything, retrying permanent errors, mutating cost state, ignoring caching). By @affaan-m, listed here with credit to its creator. From the affaan-m/ECC repository (MIT). Honest caveats: developer-oriented Python patterns to adapt to your own stack; the pricing table is a 2026 snapshot, always verify current provider pricing before budgeting. Skill Harbor never reviews the code, review it yourself before use.
Version:
Install
Copy the install package below, then paste it into MuseCommunity-built. Skill Harbor doesn't audit code — review the source before installing.
Use "Cost-Aware LLM Pipeline" with your Muse. Prerequisites: the Muse app (mobile or web), and an application or script that calls LLM APIs (Claude, GPT, or similar). No installation, no API key for the skill itself. 1. Open the skill: https://github.com/affaan-m/ECC/blob/main/skills/cost-aware-llm-pipeline/SKILL.md and copy the full SKILL.md text. 2. Paste it into a chat with Muse and add: "Apply the cost-aware pipeline patterns to [describe your app or batch job: models used, volumes]. Start with model routing thresholds." 3. Ask Muse to draft the CostTracker with your budget limit, the retry policy for your error types, and which prompts qualify for caching. Tip: set the budget limit before processing any batch. Failing early on budget beats discovering the overspend afterward. Safety: a skill is plain-text instructions; it runs nothing by itself. Never paste API keys into a chat, and review anything Muse proposes before it acts.
Saved to your recent installs. Find it anytime on /connect.
Questions
How do I install a build?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the build up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a build before installing it.