Simon Willison·· 9 days agoAI score37
ttok 0.4
ttok 0.4
AI introduction
Simon Willison released ttok 0.4, a CLI tool for counting tokens built on OpenAI's open-source tiktoken library. The update fixes Click warnings, updates CI, and adds a --list-models command to list available models. The tool can run via uvx, for example cat file.txt | uvx ttok to count tokens in any file.
Article · English
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
Source: Simon Willison · simonwillison.net