README来源: main@42fbb509
DSH Token Optimizer
A lightweight Python CLI that audits DeepSeek Harness (DSH) agent logs to find wasted tokens.
Instead of just tracking your bill, this tool tells you why you are burning tokens, finding the redundant tool calls and retry loops that agents fall into.
What it does
- Redundant Calls: Flags the same tool being called with identical arguments.
- Retry Loops: Detects tools being called repeatedly after an error.
- Cost Estimate: Quantifies the waste in both tokens and estimated dollars.
Usage
Requires Python 3.9+. No external packages needed.
python scripts/run.py path/to/your_agent_log.txt
Example Output:
=== DSH TOKEN OPTIMIZER REPORT ===
Log analyzed: test_log.txt
Estimated tokens in log: 71
Waste Patterns Detected:
- Redundant Calls: 4
- Retry Loops: 4
--- Savings Estimate ---
Potential Tokens Saved: 6,000
Estimated Cost Saved: $0.0180
Recommendation: Implement memoization or a retry backoff policy.
License
MIT
Ready-to-use Agent Skills
Want your AI agent to use these tools automatically? Browse my full catalog of AI agent skills for Jira, Sentry, DevOps, and agent observability on Agensi.
还没有评论,来写第一条。