Oct 11 edition/Reporting & analysis
CodingInfrastructure

CodingSoftware & developer tools

Simon Willison releases ttok 0.4, then ships ttok 1.0 a day later with o200k_base as the default tokenizer

Simon Willison's ttok, a command-line wrapper around OpenAI's tiktoken for counting and truncating text by tokens, got its first update in about two years with version 0.4. A day later, version 1.0 switched the default tokenizer to o200k_base.

Reach: not measured yet

THE CORE IDEAS3 TAKEAWAYS
01

ttok 0.4 (8 October 2026) was mainly a maintenance release. It fixed a Click warning on --tokens, made --allow-special work for counting and truncation, added a --list-models command, required Python 3.10 or later and moved packaging to pyproject.toml. The tool can also be run without installing it, through uvx. [1] [4] [5] [6]

02

ttok 1.0 (9 October 2026) changed the default tokenizer to o200k_base, which the release notes tie to the GPT-5 and GPT-6 families. Default token counts and truncation points therefore change between 0.4 and 1.0. Older package listings still describe a GPT-3.5/GPT-4 default. [2] [5] [9]

03

ttok does no tokenizing of its own. It hands the work to tiktoken, which maps exact model names and name prefixes to specific tokenizers and raises an error for names it does not recognise. The --list-models output now shows how that lookup resolves a given model name. [2] [7] [8]

WHY IT MATTERS

The evidence is the author's release notes and tiktoken's source code: the default changed, and tiktoken maps model names to tokenizers.

Read the full assessment

The implication is that scripts relying on default counts or truncation limits may shift after upgrading, so they should pin the tokenizer explicitly.

Executive brief

The ttok 0.4 release that Simon Willison posted on 8 October 2026 was replaced the next day. ttok 1.0 (9 October) changed the default tokenizer to o200k_base, which the release notes tie to the GPT-5 and GPT-6 families. ttok is a small command-line tool for counting and truncating text by tokens. Version 0.4 was its first release in about two years and was mostly maintenance work. If you upgrade, the default token counts change too. ttok only counts tokens accurately for OpenAI tokenizers. No independent coverage or testing of the release exists.

Read the full section

The ttok 0.4 release that Simon Willison posted on 8 October 2026 was replaced the next day. ttok 1.0 (9 October) changed the default tokenizer to o200k_base, which the release notes tie to the GPT-5 and GPT-6 families. ttok is a small command-line tool for counting and truncating text by tokens. It wraps OpenAI's open-source tiktoken library. Version 0.4 was its first release in about two years and was mostly maintenance work. If you upgrade, the default token counts change too. ttok only counts tokens accurately for OpenAI tokenizers. No independent coverage or testing of the release exists.

What changed and event timeline

  1. Ttok launches

    Willison built it alongside strip-tags as a thin wrapper over tiktoken, so token counts and truncation could be used in Unix pipelines that feed LLMs ().

  2. Ttok 0.4 released

    Fixes Click warnings on --tokens, makes --allow-special work for counting and truncation, adds --list-models, requires Python 3.10+ and moves packaging to pyproject.toml ().

  3. The blog post

    Willison describes the update as a fix for a Click warning, updated CI and the new --list-models command. He also shows that the tool runs without installation through uvx ().

  4. Ttok 1.0 released

    The default tokenizer becomes o200k_base, and --list-models now shows how model-name prefixes such as gpt-5* are resolved ().

Capabilities and access

  • Versions: 0.4 (8 Oct 2026) and 1.0 (9 Oct 2026) (releases).
  • Features: count tokens, truncate with -t, show token IDs with --encode, turn IDs back into text with --decode, show a readable breakdown with --tokens, choose a tokenizer with -m, list models with --list-models, and accept special tokens with --allow-special (README).
  • Install: pip, Homebrew (simonw/llm/ttok) or uvx ttok (README; PyPI).
Read the full section
  • Versions: 0.4 (8 Oct 2026) and 1.0 (9 Oct 2026) (releases).
  • Features: count tokens, truncate with -t, show token IDs with --encode, turn IDs back into text with --decode, show a readable breakdown with --tokens, choose a tokenizer with -m, list models with --list-models, and accept special tokens with --allow-special (README).
  • Install: pip, Homebrew (simonw/llm/ttok) or uvx ttok (README; PyPI).

Technical analysis for researchers and developers

  • ttok does no tokenization itself.
  • tiktoken picks a tokenizer from the model name in two ways. An unrecognised name raises a KeyError (tiktoken model.py).
  • The new --list-models output exposes this lookup, so you can see which tokenizer a model name will actually use.
Read the full section
  • ttok does no tokenization itself. It passes the work to tiktoken, OpenAI's byte-pair-encoding tokenizer, which is MIT-licensed and turns text into tokens and back without losing anything (tiktoken).
  • tiktoken picks a tokenizer from the model name in two ways. Exact names like gpt-5 map to o200k_base. Name prefixes like o1-, o3- and gpt-4o- also map to o200k_base, while gpt-4- and gpt-3.5-turbo- map to cl100k_base. An unrecognised name raises a KeyError (tiktoken model.py).
  • The new --list-models output exposes this lookup, so you can see which tokenizer a model name will actually use.
  • If you need counts to be reproducible, pin both the ttok version and the tokenizer explicitly. The default changed between 0.4 and 1.0.

Claims and evidence

  • The tool had gone unmaintained for about two years: stated by the author (blog).
  • tiktoken is 3–6x faster than a comparable open-source tokenizer: this is OpenAI's own figure, measured on 1 GB of text against older tokenizers/transformers versions (tiktoken).
  • The default model is unclear across sources. Older package listings say the default is the GPT-3.5/GPT-4 tokenizer (Datasette tools listing).
Read the full section
  • The tool had gone unmaintained for about two years: stated by the author (blog). The release history is consistent with this: 0.3 is the previous release (releases).
  • tiktoken is 3–6x faster than a comparable open-source tokenizer: this is OpenAI's own figure, measured on 1 GB of text against older tokenizers/transformers versions (tiktoken). It has not been independently re-run.
  • The default model is unclear across sources. Older package listings say the default is the GPT-3.5/GPT-4 tokenizer (Datasette tools listing). The current README and the 1.0 notes say o200k_base (README). Which default you get depends on the version installed.

Context and prior work

  • ttok was part of Willison's 2023 Unix-pipe toolkit. In his New York Times homepage example, raw HTML came to 210,544 tokens, stripping tags cut it to 115,117, and filtering with CSS selectors cut it to 2,165 (Willison, 2023).
  • Other projects also put a command-line interface on tiktoken, for example tiktoken-cli on PyPI and the .NET Tiktoken.Cli.
Read the full section
  • ttok was part of Willison's 2023 Unix-pipe toolkit. In his New York Times homepage example, raw HTML came to 210,544 tokens, stripping tags cut it to 115,117, and filtering with CSS selectors cut it to 2,165 (Willison, 2023).
  • Other projects also put a command-line interface on tiktoken, for example tiktoken-cli on PyPI and the .NET Tiktoken.Cli.

Limitations, safety and contested findings

  • ttok counts tokens the way OpenAI's tokenizers do. Willison's 2023 post notes it is calibrated for OpenAI models (Willison, 2023).
  • Other vendors' tokenizers can give very different counts. It recommends counting tokens through its own API, whose counts are themselves estimates (Anthropic token counting docs).
  • Scripts that relied on the old default tokenizer may report different numbers after upgrading to 1.0.
Read the full section
  • ttok counts tokens the way OpenAI's tokenizers do. Willison's 2023 post notes it is calibrated for OpenAI models (Willison, 2023).
  • Other vendors' tokenizers can give very different counts. Anthropic says Claude Opus 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text than earlier models. It recommends counting tokens through its own API, whose counts are themselves estimates (Anthropic token counting docs).
  • Scripts that relied on the old default tokenizer may report different numbers after upgrading to 1.0.

Business and practitioner implications

  • Budget checks: ttok is a cheap, offline way to estimate prompt size and cost for OpenAI models.
  • Multi-vendor stacks: don't use tiktoken counts for budgeting or context-window checks on other vendors' models. Use each provider's own counter, such as Anthropic's free count_tokens endpoint.
  • Upgrades: check any token-based limits or truncation after moving to 1.0, because the default tokenizer change will shift the numbers.
Read the full section
  • Budget checks: ttok is a cheap, offline way to estimate prompt size and cost for OpenAI models. Running it through uvx means it can go into CI or shell pipelines without a setup step.
  • Multi-vendor stacks: don't use tiktoken counts for budgeting or context-window checks on other vendors' models. Use each provider's own counter, such as Anthropic's free count_tokens endpoint.
  • Upgrades: check any token-based limits or truncation after moving to 1.0, because the default tokenizer change will shift the numbers.
FOLLOW THE EVIDENCE

The source trail.

Sources (11)
A LITTLE LESS NOISE. A LOT MORE CONTEXT.

Stay curious.
Follow the evidence.

Independent perspectives, the original sources, and room for the questions that don't have easy answers.

How we build the brief
Connect with us

Find us where you already read.