struct

Fm::ContextLimit

Inherits Struct < Value < Object

Configuration for estimating context usage.

Constructors

default_on_device

Creates a default configuration for on-device models.

Source
new(max_tokens : Int32 = DEFAULT_CONTEXT_TOKENS, reserved_response_tokens : Int32 = 0, chars_per_token : Int32 = 4)
Source

Instance methods

chars_per_token

Estimated characters per token (English ~3-4, CJK ~1).

Source
max_tokens

Maximum tokens available in the session context window.

Source
reserved_response_tokens

Tokens reserved for the model's next response.

Source