Documentation
¶
Overview ¶
Package tokencount provides token estimation for LLM text.
Index ¶
Constants ¶
View Source
const CharsPerToken = 4
CharsPerToken is the approximate number of characters per token for GPT-style tokenizers.
Variables ¶
This section is empty.
Functions ¶
func EstimateTokens ¶
EstimateTokens estimates the number of LLM tokens in the given text. Uses a simple heuristic of approximately 4 characters per token, which is a common approximation for English text with GPT-style tokenizers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.