AivexaNewsSearch
AI news for builders and product teamsChecked every hour

ttok 0.4

Collected Oct 9, 2026

Simon Willison has published ttok 0.4, a new version of his command-line tool for counting tokens with OpenAI's open source tiktoken library. The release marks the project's first update in a couple of years.

The changes are modest and maintenance-focused. Version 0.4 fixes a Click warning that had accumulated since the last release, updates the project's continuous integration setup, and introduces a --list-models command for listing the models the tool can work with. No other new functionality is described.

For developers who already use ttok, the practical value is that the tool now runs cleanly without the Click warning and can report its supported models directly from the command line rather than requiring users to check separately.

The tool remains usable through uvx, the runner that executes Python command-line applications without a permanent install. Willison gives the example of piping a file's contents into it, such as cat file.txt | uvx ttok, which returns a token count for the piped text.

Why it matters: token counts drive context-window limits and API cost estimates, so a small, scriptable counter is useful in pipelines and shell workflows. This release is narrow in scope, so teams relying on ttok mainly gain a cleaner CLI and an easier way to discover supported models; the underlying tiktoken-based counting behavior is unchanged as far as the release describes.

Read at Simon Willison

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher excerpt

Release: ttok 0.4 ttok is my CLI tool for counting tokens, using OpenAI's open source tiktoken library. It hasn't been in updated in a couple of years, but I finally fixed a Click warning, updated CI, and added a --list-models command to list available models. It works with uvx , so you can count tokens in anything like this: cat file.txt | uvx ttok Tags: projects , ai , openai , generative-ai , llms , tokenization