Latest / Developer tools

tokencost

github.com · Package · Quiet

Python utility that estimates LLM costs for 400+ models

Visit github.com ↗Share

Stars
2k
Forks
110
Open issues
19
Last commit
Releases
29
Found
2 years ago

GitHub figures as of . They are context, not a ranking.

tokencost is a Python utility library that estimates the cost of LLM prompts and completions across more than 400 models. It counts tokens with each model's tokenizer and multiplies them by a stored price for that model, accounting for float precision; it helps developers estimate spending before bills arrive.

Repository description on GitHub: “Easy token price estimates for 400+ LLMs. TokenOps.”

What it does

  • Counts tokens with each model's tokenizer and multiplies by stored prices
  • Price estimates for more than 400 LLM models
  • Accounts for float precision in cost calculations

Good for

  • Estimate prompt and completion cost before the bill arrives
  • Compare the cost of the same prompt across LLM models

Suits: Python developers tracking LLM API spending.

What you can try

Read the README on GitHub and install the Python package.

Install

pip install tokencost

Confirmed against the package registry. Read the project’s own instructions before running anything.

Links go to third-party sites KipFound does not control. KipFound has not installed, audited or tested this software.

Found vs. released

Kip first saw tokencost on , when Areibman posted it to Show HN. The oldest published release on GitHub is 0.0.1, dated . tokencost had been shipping tagged releases for 174 days before it was found. 29 releases have been published in total; the latest is 0.1.26 ().

Day-7 and day-30 updates

Day 7 1 release shipped

  • 1 release in the first 7 days: 0.1.11 (21 Jun 2024)
  • Show HN discussion at check time: 268 points, 76 comments. API record

Checked , later than day 7 because tracking began after.

Day 30 1 release shipped

  • 1 release in the first 30 days: 0.1.11 (21 Jun 2024)
  • Show HN discussion at check time: 268 points, 76 comments. API record

Checked , later than day 30 because tracking began after.

Release timeline every entry links to its source

Releases per month, last 24 months (9 in total, busiest month 2).
  1. Repository created on GitHub: AgentOps-AI/tokencost
  2. Release 0.0.1
  3. Found: Areibman posted it to Show HN. Show HN
  4. Release 0.1.21
  5. Release 0.1.22
  6. Release 0.1.23
  7. Release 0.1.24
  8. Release 0.1.25
  9. Release 0.1.26
  10. Day-7 check recorded by Kip (details)
  11. Day-30 check recorded by Kip (details)

Showing the first and the 6 latest of 29 releases. All releases on GitHub

Quick answers

When was tokencost released?
Its first tagged release on GitHub is dated 26 Dec 2023. Kip found it on Show HN on 17 Jun 2024.
Is tokencost open source?
Its source is public on GitHub at AgentOps-AI/tokencost under the MIT licence.
What does tokencost run on?
Library.
Is tokencost free?
It is open source, so the code is free to read and run; check the licence for terms.
Is tokencost still maintained?
It has had no commit or release for over a year as of the latest check.

Provenance

SourceRecordLast checked
Show HNlisting
official API record
GitHub repositoryAgentOps-AI/tokencost
REST API record
GitHub Releasesrelease list
REST API record

Stable ID hn-40710154. Summary written by KipFound’s editor.

Share

Similar tools

More in Developer tools

Made this, or spotted a mistake? Ask for a correction or removal. No account or email address needed.