Configuration for estimating context usage.
Constructors
default_on_device
Creates a default configuration for on-device models.
Sourcenew(max_tokens :
Int32 =
DEFAULT_CONTEXT_TOKENS, reserved_response_tokens :
Int32 = 0, chars_per_token :
Int32 = 4)
SourceInstance methods
chars_per_token
Estimated characters per token (English ~3-4, CJK ~1).
Sourcemax_tokens
Maximum tokens available in the session context window.
Sourcereserved_response_tokens
Tokens reserved for the model's next response.
Source