ttok 0.4 Simon Willison released ttok 0.4, an update to his CLI token-counting tool built on OpenAI's open source tiktoken library. The release fixes a Click warning, updates CI, and adds a --list-models command for listing available models, and the tool can be run via uvx, as in `cat file.txt | uvx ttok`. Release: ttok 0.4 https://github.com/simonw/ttok/releases/tag/0.4 ttok is my CLI tool for counting tokens, using OpenAI's open source tiktoken https://github.com/openai/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 https://simonwillison.net/tags/projects , ai https://simonwillison.net/tags/ai , openai https://simonwillison.net/tags/openai , generative-ai https://simonwillison.net/tags/generative-ai , llms https://simonwillison.net/tags/llms , tokenization https://simonwillison.net/tags/tokenization