跳到正文
Simon Willison 博客·· 4 小时前AI 评分35

ttok 0.4 发布:新增 --list-models 命令

ttok 0.4

AI 导读

Simon Willison 的 token 计数 CLI 工具 ttok 发布 0.4 版,修复了 Click 警告、更新了 CI,并新增 --list-models 命令用于列出可用模型。该工具基于 OpenAI 开源的 tiktoken 库,可通过 uvx 直接运行,例如 `cat file.txt | uvx ttok` 即可统计 token 数。

正文

Release: ttok 0.4

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

Tags: projects, ai, openai, generative-ai, llms, tokenization

来源:Simon Willison 博客 · simonwillison.net