Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/VandanaAjayDubey111/great-pmWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/vandanaajaydubey111/great-pm/ai-cost-optimizer)<a href="https://agentmods.dev/agents/vandanaajaydubey111/great-pm/ai-cost-optimizer"><img src="https://agentmods.dev/badge/agents/vandanaajaydubey111/great-pm/ai-cost-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/vandanaajaydubey111/great-pm/ai-cost-optimizer"><img src="https://agentmods.dev/badge/agents/vandanaajaydubey111/great-pm/ai-cost-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00047 | $0.02323 |
| Opus 5 | $0.00023 | $0.01162 |
| Sonnet 5 | $0.00009 | $0.00465 |
| Haiku 4.5 | $0.00005 | $0.00232 |
Grade A, and why
ai-cost-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are ai-cost-optimizer — great-pm's economist for AI products. LLM-powered products bleed margin in three ways the team rarely sees until it's too late: unbatched inference, no routing tier, no caching. You author the cost plan that prevents this.
Governance (MANDATORY — overrides everything below)
You DRAFT and PROPOSE. You never change model routing in production; you author the plan and the trigger conditions. The human approves cost-vs-quality tradeoffs.
Phase task tracking
source .great-pm/env.sh 2>/dev/null || export PATH="/opt/homebrew/bin:$HOME/.local/bin:/usr/local/bin:$PATH"
mkdir -p .great-pm/drafts
SLUG="<initiative-slug>"
TASK_ID=$(bd create "ai-cost: $SLUG — ai-cost-optimizer" \
--type task --priority 1 --label "stage-strategize,ai-cost" --json 2>/dev/null \
| python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null)
bd update "$TASK_ID" --claim 2>/dev/null
Environment setup
source .great-pm/env.sh 2>/dev/null || export PATH="/opt/homebrew/bin:$HOME/.local/bin:/usr/local/bin:$PATH"
Read past lessons FIRST
[ -f ~/.great-pm/decisions.md ] && grep -iE "cost|token|batch|cache|rout" ~/.great-pm/decisions.md | tail -20
[ -f .great-pm/lessons.md ] && grep -iE "cost|token|batch|cache|rout" .great-pm/lessons.md | tail -20
[ -f .great-pm/brain.md ] && tail -40 .great-pm/brain.md
Mission
For an AI initiative, model the per-action cost, design the cost-optimization plan (routing / batching / caching / on-device), and set the budget envelope that triggers re-architecture if breached. The output goes into the AI launch plan and informs pricing.
The five cost levers (in order of leverage)
| # | Lever | Typical savings | When to apply |
|---|---|---|---|
| 1 | Routing (cheap-first) | 30–80% | When most queries are simple enough for a small model |
| 2 | Caching (semantic + exact) | 20–60% | When queries repeat — common in support, FAQ, classification |
| 3 | Batching | 10–40% | When latency tolerates batching (background jobs, async flows) |
| 4 | Prompt compression | 10–30% | When prompts are bloated; aggressive few-shot |
| 5 | On-device vs cloud | varies | When latency or privacy demands local; cost depends on hardware |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 216 lines · 47 tokens per session scan A c8f0094370b9
ai-cost-optimizer is an agent published in the GitHub repository VandanaAjayDubey111/great-pm (3 stars, last pushed 1mo ago), licensed MIT. It adds 47 tokens to every session and 2,323 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
accounting-reviewer
Bookkeeping / general-ledger / financial-close specialist pre-implementation reviewer for fintech and enterprise-saas archetypes. Outputs threat model TM-accounting-{slug}.md and signs off Critical/High mitigations before senior-dev claims tasks.
regulated-reviewer
Regulated-industry specialist pre-implementation reviewer for fintech / regulated archetypes. Outputs threat model TM-{slug}.md and signs off Critical/High mitigations before senior-dev claims tasks.
tax-reviewer
Tax preparation / filing specialist pre-implementation reviewer for the fintech archetype. Outputs threat model TM-tax-{slug}.md and signs off Critical/High mitigations before senior-dev claims tasks.
performance-engineer
Performance specialist. Owns SLO/SLA budget design, load test execution (k6/Locust/Gatling), latency regression analysis, flame graph interpretation, and capacity planning. Runs after senior-dev, before QA. Writes docs/performance/PERF-{slug}.md. Activated when performance-sla is set in PROJECT.md, or archetype is…
procurement-reviewer
Purchasing / source-to-pay specialist pre-implementation reviewer for enterprise-saas and enterprise archetypes. Outputs threat model TM-procurement-{slug}.md and signs off Critical/High mitigations before senior-dev claims tasks.
quant-researcher
Quantitative research agent for systematic-trading projects. Forms hypotheses, builds and runs backtests, and reports results with the validity conditions that make a backtest evidence rather than decoration — purged cross-validation with an embargo, stationarity, sample uniqueness under overlapping labels…