Tokenizers

Overview

Tokenizers are used throughout Gen AI Builder to calculate the number of tokens in a piece of text. They are particularly useful for ensuring that the LLM token limits are not exceeded.

Tokenizers are a low level abstraction that you will rarely interact with directly.

Tokenizers

OpenAI

Cohere

Anthropic

Google

Hugging Face

Amazon Bedrock

Grok

Simple

Not all LLM providers have a public tokenizer API. In this case, you can use the SimpleTokenizer to count tokens based on a simple heuristic.


Could this page be better? Report a problem or suggest an addition!