跳到正文
原文
Simon Willison·· 12 天前AI 评分4

ttok 0.4:开源工具更新,支持模型列表和文件token计数

ttok 0.4

AI 导读

开源工具ttok 0.4更新,新增模型列表命令,支持使用uvx进行文件token计数,并修复了Click警告问题。

原文

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

来源:Simon Willison · simonwillison.net