Up – Package index » chatoyant » Library chatoyant.tokens » Chatoyant_tokens » Token_estimateModule Chatoyant_tokens.Token_estimate Source Heuristic token estimation.
These functions intentionally mirror the current TypeScript package's zero-dependency token estimates. They are fast approximations, not provider tokenizer bindings.
chatoyant Library chatoyant Library chatoyant.core Library chatoyant.native Library chatoyant.provider Library chatoyant.runtime Library chatoyant.schema Library chatoyant.tokens Library chatoyant_ppx Sources Source type content_kind = | English | Code | Cjk | Mixed Source type prompt_estimate = { input : int; output : int; total : int; } Source val estimate : string -> intSource val estimate_many : string list -> intSource val estimate_with_ratio : chars_per_token :float -> string -> int