π Join the Community: We are building in public! Drop into our Discord Server to grab early alpha builds, report bugs, and chat directly with me about the roadmap!
Hey Dev Community! π
Iβm a 13-year-old developer, and I just built TokenShark. It is a lightweight Python tool designed to show you your real-time LLM token usage and financial costs right inside your terminal.
When building AI apps, token costs can spiral out of control fast. I wanted a solution that was instant, local, and required zero configuration.
Here is how TokenShark works, why I chose a controversial architecture pattern to build it, and how you can help me test it.
β‘ What is TokenShark?
TokenShark patches your Python LLM client with one single import. It gives you instant visibility into your AI spend without forcing you to sign up for another SaaS dashboard.
π₯ Key Features
-
Zero Configuration: Just add
import tokensharkto your code. - Real-Time Terminal Output: See cost breakdowns as streaming responses land.
- Accurate Pricing: Deep integration that accounts for prompt caching discounts.
- 100% Private: No accounts required. No traffic leaves your machine.
- Metadata Tagging: Filter and tag your cost metrics per-request.
π οΈ The Architecture Choice: Why Monkey Patching?
When deciding how to hook into the AI SDKs (like OpenAI or Anthropic), I evaluated three methods. Here is why I skipped proxies and wrappers:
| Method | Friction | Privacy | Why I Chose/Skipped It |
|---|---|---|---|
| SDK Wrapping | π΄ High | π’ Safe | Requires rewriting your code everywhere an API is called. Too much friction. |
| Proxy (e.g. Helicone) | π‘ Medium | π΄ Risky | Requires changing base URLs. Routes your data through external servers. |
| Monkey Patching | π’ Zero | π’ Safe | Modifies provider objects at runtime locally. Just pip install and you are done. |
β οΈ A Note on Transparency: Monkey patching means modifying third-party objects at runtime. While perfectly safe when done right, I believe in absolute transparency. For the final release, I will document exactly which internal classes and methods TokenShark modifies so you always know what is running under the hood.
π Roadmap: What's Next?
The official launch is happening on July 17th (though early access versions will drop sooner!).
Here is what I am building next:
- Slack Integration: Get instant budget alerts pushed to your team channels.
- Web Dashboard: A local, beautiful UI to visualize your historic spend trends.
- Mobile App: Monitor your production API burn rates from your phone.
π¦ I Need Your Constructive Criticism!
Because I am 13, I don't have a massive team testing thisβit's just me. TokenShark is in its early phases, which means there will be bugs.
I want to build what the community actually needs. Please break my tool, test its limits, and give me your most brutal constructive feedback so I can improve it.
Let's Connect!
- π¬ Discord: Join the TokenShark Server
- π§ Email: tokenshark@tuta.io
- π/Twitter: tokenshark_dev
If you find this project interesting, let me know in the comments below! What features should I add next?
Top comments (0)