Skip to main content

Module tokenizer

Module tokenizer 

Source
Expand description

Token estimation utilities

Simple utilities for estimating token counts. The default implementations in Model and ModelProvider use ~4 characters per token, but you can use these utilities for custom token estimation.

Structsยง

CharacterTokenizer
Simple character-based token estimator Uses ~4 characters per token heuristic (common approximation)