News ·
ttok 0.4
Simon Willison released ttok 0.4, an update to his CLI token-counting tool built on OpenAI's tiktoken, adding a --list-models command and fixing a Click warning.
Simon Willison released version 0.4 of ttok, his command-line tool for counting and truncating text based on tokens. The tool uses OpenAI's open source tiktoken library and had not been updated in a couple of years.
This release fixes a Click warning and updates the CI setup. The notable new feature is a --list-models command that lists the available models. The tool works with uvx, so tokens can be counted directly from piped input, for example counting tokens in a file by piping it through uvx ttok.
Token counting is a routine task when building with LLMs, and a CLI tool that works through uvx makes it easy to check token counts on arbitrary text without extra setup. The --list-models command helps surface which tokenizer models are available to the tool.
References
- Simon Willison · simonwillison.net
Read the full story at Simon Willison ↗Like, save or discuss on Buzz


