Settings

Theme

Show HN: Slash-tokens – know LLM cost before the call leaves your machine

github.com

4 points by wolfejam · 5 comments · 1 min read

Reader

I kept finding out what a call cost after I had already paid, so I built /Slash -- slash-tokens is a 4.8KB WASM that estimates tokens FAST and can block a wasted trip, or switch to cheaper same-provider model before the request leaves your machine. Try it MIT, no account needed: bunx slash-tokens

Or install the SDK: npm install slash-tokens

3 threads
brownbear7

How do you handle cached input or long-context pricing? Some providers change the rate a lot depending on that, so I’m curious how accurate the estimate stays.

chrism238

Move over Halting Problem!

  • wolfejamOP

    we don't claim 100% -- we optimize, we don't offer perfect computation! The bill is after the call, it's a local estimate, so you can skip a wasted trip or use a cheaper model, same provider.

ramon156

good thing you replaced emdashes with double dashes, i almost thought this was AI generated /s

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection