TokenizerGateway
interface TokenizerGateway
Pluggable tokenizer for cost-aware context-window management.
Tokenization is provider- and model-specific and there is no single cross-platform Kotlin library that covers every encoding. The gateway pattern lets callers supply whichever implementation suits their target: the OpenAI port ships a JVM-only jtokkit-backed implementation; Kotlin/Native consumers can plug in their own or skip token counting entirely.
Implementations must be safe to call from any coroutine.