hiw3c AI 日报
Simon Willison 网页快照

ttok 0.4

原文标题 · ttok 0.4

版本:ttok 0.4 ttok是我的CLI工具,用于计数令牌,使用OpenAI的开源tiktoken库。它已经有几年没有更新了,但我最终修复了一个Click警告,更新了CI,并添加了一个--list-models命令来列出可用的模型。它与uvx一起工作,因此您可以在以下任何内容中计算令牌:cat file.txt| Tags:projects,ai,openai,generative-ai,ll

来源:Simon Willison · simonwillison.net

正文为英文,可一键机器翻译(仅首次需要等待)

Simon Willison’s Weblog

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

Recent articles

A new feature for my blog, built using my voice - 9th October 2026

Claude Haiku 5.5 - 7th October 2026

We're going to need default hard budget caps on pretty much everything - 3rd October 2026

OpenAI DevDay 2026 live blog - 29th September 2026

This is a beat by Simon Willison, posted on 8th October 2026 .

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.