[KongchangAI]
Product

tiktoken

A tokenization library developed by OpenAI, based on the Byte Pair Encoding (BPE) algorithm. It is used for text tokenization in models such as ChatGPT.

Core Facts

Timeline (last 90 days)

Nov 5

Developers should use the tokenizer corresponding to the target model (such as OpenAI's tiktoken or the Hugging Face tokenizers library) for precise token counting.

Unverified50%
Nov 1

The o200k_base tokenizer is open-sourced through the tiktoken library, and developers can directly call its encode/decode interfaces.

Unverified50%
Nov 1

Every segmentation result in the video comes from actual output of tiktoken 0.14.0.

Expired50%
Oct 19

The project provides a free counter at modelmarket.dev/tools/tool-list-cost that uses the same tokenizer as the statistics and was compared against tiktoken on 120 of HISTOR's tool lists (2.6 million tokens in total), with zero differences.

Expired50%
Oct 19

tiktoken is OpenAI's open-source tokenizer library, and cl100k_base is its commonly used encoding scheme; an English word typically corresponds to 1-2 tokens, while Chinese uses more.

Unverified50%
Oct 19

The OpenAI API's logit_bias parameter does not accept the word itself as a key but requires token ID strings, which must be obtained by encoding with the tokenizer matching the model (such as the tiktoken library).

Unverified50%
Oct 17

An LLM gateway needs to parse the model field in the request payload to make routing decisions, use tokenizers such as tiktoken to count tokens in messages for token-based rate limiting, translate OpenAI-format tools definitions into Anthropic's input_schema, and extract and accumulate the usage field from each chunk of the response stream to compute cost.

Unverified50%
Oct 16

When counting with the tiktoken library and the o200k_base encoding, the smallest git_status tool (no parameters) is only 54 tokens, while the largest search_code tool (five parameters) reaches 193 tokens.

Unverified50%
Oct 16

The author's measurements show that the JSON Schema definitions of 18 tools consume 2,388 tokens, averaging 133 tokens per tool, and in a 10-step Agent run they can account for 36% of input tokens and 32% of the total bill.

Unverified50%
Oct 13

tiktoken's README gives an average of about 4 bytes of text per token.

Unverified50%

16 more timeline events

All Facts (20)

Verified

Token是大语言模型处理文本的基本单位,大约对应0.75个英文单词或1.5个汉字

90%
Verified

The GPT series uses tiktoken (based on BPE encoding) for tokenization.

80%
Verified

OpenAI provides the open-source tool tiktoken, which allows developers to estimate token counts before calling the API.

80%
Verified

OpenAI uses the tiktoken tokenizer for token metering.

70%
Verified

OpenAI has used a variant of BPE since GPT-2, and GPT-4's cl100k_base vocabulary contains approximately 100,000 tokens.

65%
Verified

The number of tokens consumed by the same Chinese text may differ by 30%–50% across different large model service providers.

65%
Unverified

LLaMA 3的分词器从SentencePiece升级为基于tiktoken的BPE分词器,词表大小扩展至128,256

90%
Unverified

OpenAI's GPT series uses the tiktoken library, with vocabulary sizes typically ranging between 50,000 and 100,000 Tokens

85%
Unverified

ttok is a command-line tool built on OpenAI's open-source tiktoken library, used to count the number of tokens in text.

60%
Unverified

tiktoken is OpenAI's open-source tokenizer library, cl100k_base is the encoding scheme used for the GPT-3.5/4 series, and its tokenization results differ from Anthropic Claude's proprietary tokenizer, usually by a single-digit to low-teen percentage.

60%
Unverified

OpenAI uses the tiktoken tokenization algorithm, and Google uses the SentencePiece tokenization algorithm.

60%
Unverified

Developers should use the tokenizer corresponding to the target model (such as OpenAI's tiktoken or the Hugging Face tokenizers library) for precise token counting.

50%
Unverified

The o200k_base tokenizer is open-sourced through the tiktoken library, and developers can directly call its encode/decode interfaces.

50%
Unverified

tiktoken is OpenAI's open-source tokenizer library, and cl100k_base is its commonly used encoding scheme; an English word typically corresponds to 1-2 tokens, while Chinese uses more.

50%
Unverified

The OpenAI API's logit_bias parameter does not accept the word itself as a key but requires token ID strings, which must be obtained by encoding with the tokenizer matching the model (such as the tiktoken library).

50%
Unverified

An LLM gateway needs to parse the model field in the request payload to make routing decisions, use tokenizers such as tiktoken to count tokens in messages for token-based rate limiting, translate OpenAI-format tools definitions into Anthropic's input_schema, and extract and accumulate the usage field from each chunk of the response stream to compute cost.

50%
Unverified

When counting with the tiktoken library and the o200k_base encoding, the smallest git_status tool (no parameters) is only 54 tokens, while the largest search_code tool (five parameters) reaches 193 tokens.

50%
Unverified

The author's measurements show that the JSON Schema definitions of 18 tools consume 2,388 tokens, averaging 133 tokens per tool, and in a 10-step Agent run they can account for 36% of input tokens and 32% of the total bill.

50%
Unverified

tiktoken's README gives an average of about 4 bytes of text per token.

50%
Unverified

OpenAI's tokenizer is open source; in JavaScript, js-tiktoken can run in any environment (including the browser), and in Python the corresponding package is tiktoken.

50%

Source Articles