跳到正文
Simon Willison·· 4 小时前AI 评分39

ttok 0.4 更新:修复 Click 警告并新增模型列表命令

ttok 0.4

AI 导读

Simon Willison 更新了用于统计模型 token 的 CLI 工具 ttok 0.4,修复 Click 警告、更新 CI,并新增 `--list-models` 命令以列出可用模型。ttok 基于 OpenAI 开源的 tiktoken 库,支持通过 uvx 使用。

正文

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