Install any skill in seconds. Free to start, no credit card required.
Get Started Free →borghei/llm-cost-optimizer
This skill should be used when the user asks to "estimate LLM costs", "count tokens in prompts", "optimize prompt token usage", "compare model pricing", or "reduce LLM API costs".
Passed 21 of 22 test cases with the skill, and 12 of 22 without it.
and 10 more in the full report
9 fixed13 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 8 test cases the skill fixed. Same model, same prompt, with and without the skill.
We want to run our prompt optimization tool on `rag_context.txt` with an explicit target token reduction of 30 percent. Provide the exact python shell command to invoke.
| Checked | Without skill | With skill |
|---|---|---|
| Includes --file rag_context.txt in the command. | Missed | Passed |
| Includes --target-reduction 30 in the command. | Missed | Passed |
The instructions your model reads when the skill loads.
Category: Engineering Domain: AI Cost Management
The LLM Cost Optimizer skill provides tools for counting tokens, estimating costs across different LLM providers, and optimizing prompts to reduce token usage without sacrificing quality. Essential for teams managing LLM API budgets at scale.
Before estimating or optimizing, confirm these inputs. If any is unknown or vague, ASK — do not assume:
--file/--text/--stdin)--models and the pricing comparison)token_counter.py vs prompt_optimizer.py and sets --target-reduction)Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
# Count tokens in a prompt file and estimate costs
python scripts/token_counter.py --file prompt.txt --models gpt-4o claude-sonnet
# Count tokens from stdin
echo "Hello world" | python scripts/token_counter.py --stdin --models all
# Analyze a prompt for optimization opportunities
python scripts/prompt_optimizer.py --file system_prompt.txt
# Optimize with target reduction
python scripts/prompt_optimizer.py --file prompt.txt --target-reduction 30
| Tool | Purpose | Key Flags |
|---|---|---|
token_counter.py | Count tokens and estimate costs across models | --file, --text, --stdin, --models |
test cases passed, vs 12 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.