ttok 0.4
- ID
- 33475
- Status
- summarized
- Published
- 09 Oct 2026, 7:34 AM
- Fetched
- 09 Oct 2026, 9:44 AM
- Provider
- Simon Willison
- Category
- developer-ai
- Original URL
- https://simonwillison.net/2026/Oct/8/ttok/
- Source URL
- https://simonwillison.net/atom/everything/
Summary
- Score
- 3.0
- Created
- 09 Oct 2026, 9:44 AM
- Tags
- Audience
- developersai_ml_learners
What happened
Simon Willison released ttok 0.4, a CLI for counting and truncating text by tokens using OpenAI's open source tiktoken library. After roughly two years without updates, this release fixes a Click warning, refreshes CI, and adds a --list-models command to list available models. It runs without installation via uvx, e.g. `cat file.txt | uvx ttok`.
Why it matters
If you budget context windows for prompts or agent pipelines, ttok 0.4 gives you a zero-install way to count tokens (`cat file.txt | uvx ttok`) and a new --list-models flag for checking which model names the tool knows about. The practical caveat: --list-models reflects whatever list is baked into the release, so after a two-year gap in updates it is likely to lag current model names — verify against your provider's docs rather than treating it as authoritative.
Discussion angle
How does everyone actually count tokens before sending prompts — provider SDK tokenizers, tiktoken directly, or a wrapper like ttok — and does a stale built-in model list make --list-models more misleading than useful?