- Home
- Skills
- Code Quality & Review
- Spring Boot LLM Cost Audit
Works with the AI Agents you already use
Spring Boot LLM Cost Audit
No made-up percentages: every estimate shows its traffic assumptions so you can sanity-check it.
$9
What it does
- Scans Spring AI / LangChain4j code for nine LLM waste patterns (L1–L9) with a bundled read-only scanner
- Scores LLM cost efficiency 0–100 with HIGH-to-INFO findings, each with file, line, and tokens saved
- Estimates savings token-first at your verified provider rate — CNY supported, DeepSeek/Qwen/Doubao first-class
- Writes concrete diff fixes: static system prompt, sliding-window history, batched requests, small-model routin
- Adds usage logging so you can prove the savings after deploy
- Re-scans after fixes and shows the score before → after
Who it's for
Founders with high API bills
Stop wasting money on tokens by finding and fixing inefficient code in your AI features.
Try asking: “Our OpenAI bill is way too high. Can you audit our project and tell us how to cut costs?”
Java and Spring Boot developers
Identify exactly which lines of code are causing token waste and get the fixes to lower costs.
Try asking: “Run a cost audit on this Spring Boot project and show me the token waste report.”
Tech leads reviewing new features
Ensure your AI release won't break the bank by checking prompt efficiency before you go live.
Try asking: “Review our LLM usage before we release this update to make sure it is cost-effective.”
Teams running Spring AI customer-facing chatbots
The exact lines where their bot burns tokens, with fixes and a monthly savings estimate
Try asking: “Our support bot's token bill keeps climbing — audit it and fix the waste”
Spring Boot LLM Cost Audit
Example session with this skill installed
Audit our Spring AI customer-service chatbot for LLM cost waste. Our DeepSeek bill keeps climbing even though traffic is flat. Find what's wasting tokens, fix it, and tell me how much we'd save each month.
- Read your context and instructions
- Compiled the spring boot llm
LLM cost audit — score: 30/100
I scanned your Spring AI customer-service bot for the nine waste patterns (L1–L9). Eleven findings in total — the five that matter most:
HIGH
- Cache-breaking timestamp (L1) —
SupportChatService.java:38builds the system prompt withLocalDateTime.now(). Every request has a unique prefix, so the provider's prompt cache never hits. Fix: make the system prompt static and pass the current time as a separate note only when a reply actually needs it. - Unbounded chat history (L2) —
SupportChatService.java:52resends the entire conversation on every turn. A 40-turn support thread bills roughly 9,000 history tokens per reply. Fix: sliding window of the last 10 turns plus a running summary. - Frontier model for classification (L3) —
IntentRouter.java:21uses your largest model to pick one of three intents. Fix: route classification to the small model behind an eval gate (99.2% agreement on your labeled set).
MEDIUM
- Per-item loop calls (L5) —
TicketTagger.java:64calls the model once per ticket. Fix: batch 20 tickets per request. - No output limit (L6) —
maxTokensis unset, so rambling replies bill at full length. Fix:maxTokens: 512for support replies.
Estimated savings (your numbers)
Assumptions: 1,000 conversations/day, 8 turns average, at the DeepSeek rate you verified.
- Prompt cache restored: ~62% of system-prompt tokens become cache hits
- History window: ~55% fewer input tokens on long threads
- Small-model routing: classification cost down ~85%
Estimated total: ~18.4M tokens/month saved at your rate, before the batching win. Usage logging is included in the fixes so you can verify the number against your next bill.
Re-scan result
Score: 30/100 → 100/100. All 11 findings resolved; zero waste patterns remain.
Connects securely to your tools. The creator never sees your data.
About this skill
Spring Boot LLM Cost Audit
Find the tokens your Spring AI app wastes — priced in your own currency.
Point your agent at a Spring Boot project and get a scored, evidence-based LLM cost audit: cache-breaking timestamps, unbounded chat history, frontier models doing three-way classification, per-item loop calls, missing output limits — each with file, line, the fix, and the tokens it saves.
Nine waste patterns (L1–L9)
A bundled read-only scanner checks your Spring AI / LangChain4j code for the nine ways Java LLM apps silently burn tokens:
- Cache-breaking prompts — timestamps, session IDs, or user names injected into the system prompt, defeating provider prompt caching
- Unbounded chat history — the full conversation resent on every turn, growing without limit
- Oversized models — frontier models doing three-way classification a small model handles at a fraction of the price
- Per-item loop calls — one API call per item instead of a single batched request
- Missing output limits —
maxTokensunset, so rambling responses bill at full length - …and four more patterns, each reported with file, line, the fix, and the tokens it saves
Honest savings, in your currency
Findings are rated HIGH-to-INFO with a 0–100 cost-efficiency score. Savings estimates are token-first and priced at your verified provider rate — CNY supported, with DeepSeek, Qwen, and Doubao as first-class providers alongside OpenAI, Anthropic, and Gemini. No made-up percentages: every estimate shows its traffic assumptions so you can sanity-check it.
Fixes, not just findings
Every finding ships with a concrete diff:
- Static system prompt (timestamps and IDs moved out) to restore prompt caching
- Sliding-window chat history
- Batched requests instead of per-item loops
- Small-model routing for classification, behind an eval gate
- Output limits (
maxTokens) on every call - Usage logging so the savings are measurable after deploy
After the fixes, the skill re-scans and shows the score before → after before delivering.
Proof
Rehearsal: a sample project with nine planted waste patterns scores 30/100 with all nine caught (11 findings); the fixed version scores 100/100 with zero false positives.
What's inside
- SKILL.md — the audit workflow your agent follows
- scripts/llm_audit.py — the read-only scanner (Python stdlib, nothing to install)
- Reference material — waste-pattern checklist, pricing & estimation guide, worked examples, rehearsal notes
- Sample projects — the waste-planted and fixed rehearsal apps
It only scans Java and Spring Boot projects. It cannot accurately estimate money savings unless you provide your specific provider pricing.
Works on Spring Boot projects using Spring AI or LangChain4j with OpenAI, Anthropic, Gemini, DeepSeek, Qwen, Doubao, or other providers. The bundled scanner (scripts/llm_audit.py) uses only the Python 3 standard library and is strictly read-only: it never modifies files and makes no network calls. It checks nine waste patterns (L1–L9) — cache-breaking prompt content, unbounded conversation history, oversized models for simple tasks, per-item loop calls, missing output limits, and more — across Java sources and YAML/properties config. Savings estimates are computed token-first from your traffic assumptions and priced at the provider rate you verify (CNY supported). Fixes are proposed as reviewable diffs and verified by re-scan. Requires Python 3.8+; no API keys are needed for the audit itself.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
- Software
Python 3.8+
Permissions
File Scopes
What's inside
Frequently Asked Questions
New in Code Quality & Review
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.