openscilab/tocount
ToCount: Lightweight Token Estimator
This tool helps professionals working with large language models to estimate the "token" cost of text inputs. You provide a piece of text, and it quickly tells you approximately how many tokens that text represents. This is crucial for anyone managing budgets for API calls, optimizing prompt length, or handling context windows when interacting with AI models.
Available on PyPI.
Use this if you need a quick, reliable way to predict the token count of text before sending it to a large language model API.
Not ideal if you need perfectly precise token counts for every single model, as estimations might vary slightly from actual API results.
Stars
21
Forks
1
Language
Python
License
MIT
Category
Last pushed
Feb 14, 2026
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/nlp/openscilab/tocount"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
guillaume-be/rust-tokenizers
Rust-tokenizer offers high-performance tokenizers for modern language models, including...
sugarme/tokenizer
NLP tokenizers written in Go language
elixir-nx/tokenizers
Elixir bindings for 🤗 Tokenizers
reinfer/blingfire-rs
Rust wrapper for the BlingFire tokenization library
Scurrra/ubpe
Universal (general sequence) Byte-Pair Encoding