llm-cost-latency-budget

llm-cost-latency-budget is a cursor rule for Cursor from mohitagw15856/pm-claude-skills. It costs 92 tokens per session (879 once invoked), scanned A, original, MIT.

A planning document for estimating the token cost and response speed of an LLM feature. Tokens are the chunks of text models process, and latency is how long a response takes.

In plain words
What is it for?
Use it to budget AI API usage, compare model tiers, estimate costs at different volumes, set p50 and p95 response targets, and reduce unnecessary tokens.
Why use it?
It exposes per-request and monthly costs, slow parts of the request, and the trade-offs between model choice, prompt size, caching, and response targets.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to budget AI API usage, compare model tiers, estimate costs at different volumes, set p50 and p95 response targets, and reduce unnecessary tokens.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mohitagw15856/pm-claude-skills/llm-cost-latency-budget
About the project

PM Skills is a collection of plain-Markdown instructions that teach AI assistants structured methods for handling professional, personal, and life-admin tasks. People use it with Claude, ChatGPT, Gemini, Cursor, Codex, and other supported agents for work such as writing product requirements, reviewing documents, or planning difficult situations.

mohitagw15856/pm-claude-skills · 1,357 stars · on GitHub · mohitagw15856.github.io

Install

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.

Clone the repo
git clone --depth 1 https://github.com/mohitagw15856/pm-claude-skills

Made for: Cursor.

Wrote 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.

agentmods badge for llm-cost-latency-budget

README.md
[![agentmods](https://agentmods.dev/badge/rules/mohitagw15856/pm-claude-skills/llm-cost-latency-budget/github.svg)](https://agentmods.dev/rules/mohitagw15856/pm-claude-skills/llm-cost-latency-budget)
Your own site
<a href="https://agentmods.dev/rules/mohitagw15856/pm-claude-skills/llm-cost-latency-budget"><img src="https://agentmods.dev/badge/rules/mohitagw15856/pm-claude-skills/llm-cost-latency-budget/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.

agentmods 80×15 button for llm-cost-latency-budget

Your own site · 80×15
<a href="https://agentmods.dev/rules/mohitagw15856/pm-claude-skills/llm-cost-latency-budget"><img src="https://agentmods.dev/badge/rules/mohitagw15856/pm-claude-skills/llm-cost-latency-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 879 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00092 $0.00879
Opus 5 $0.00046 $0.00439
Sonnet 5 $0.00018 $0.00176
Haiku 4.5 $0.00009 $0.00088

Measured 9d ago against content hash a30a063a4601, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

llm-cost-latency-budget 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 9d 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.

exports/cursor/pm-ai/llm-cost-latency-budget/llm-cost-latency-budget.mdc · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LLM Cost & Latency Budget Skill

LLM features have a unit cost and a tail latency that demos hide and production exposes. This skill does the token math up front — what one request costs, what a million cost, where the p95 latency comes from — and lays out the levers (model tiering, caching, prompt trimming) so cost and speed are designed, not discovered.

Required Inputs

Ask for these only if they aren't already provided:

  • The request shape — typical system prompt, user input, retrieved context, and output sizes (in rough tokens).
  • Volume — requests/day now and at target scale; peak concurrency.
  • Models in play — candidate model(s) and their per-token input/output prices.
  • Targets — acceptable cost per request (or per user/month) and the latency users will tolerate (p50 / p95).

Output Format

Cost & Latency Budget: [feature]

1. Per-request token math — a table estimating tokens in/out per call, and the resulting cost at each candidate model's price.

Component Tokens $ in $ out
System prompt
Retrieved context
User input
Output
Per request $x

2. Monthly projection — per-request cost × volume, at current and target scale; the headline number leadership will ask for.

3. Model tiering — route easy requests to a cheaper/faster model and only escalate hard ones (cascade); show the blended cost. Often the single biggest saving.

4. Latency — where the p95 comes from (model TTFT + output length + retrieval + network), the target, and how streaming changes perceived latency even when total time is unchanged.

5. Cost levers — ranked by impact: prompt/context trimming, caching (prompt cache + response cache for repeats), shorter outputs (max_tokens), batching, tiering, and "do you need the model at all for this path."

6. Guardrails — per-user / per-day rate limits, a max-tokens cap, a spend alert threshold, and a kill switch — so a bug or abuse can't produce a surprise invoice.

Read the full file on GitHub · 66 lines

Changes

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.

  1. 9d ago First seen · 66 lines · 92 tokens per session scan A a30a063a4601

Subscribe to this mod's changes

llm-cost-latency-budget is a cursor rule published in the GitHub repository mohitagw15856/pm-claude-skills (1,357 stars, last pushed yesterday), licensed MIT. It adds 92 tokens to every session and 879 once invoked, about $0.0005 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-09-03.