LLMConfig
The LLMConfig class defines configuration parameters for LLM calls and memory management.
Properties
require_tools(bool): DefaultFalse. Whether to force at least one tool to be used per callmemory_length_limit(int): Default50. Maximum number of messages in memory contextmax_tokens(int): Default1000. Maximum number of tokens generated in a single responsetokens_count_mode(Literal["word", "bpe", "char"]): Default"bpe". Token counting mode: bpe (subwords) / word (words) / char (characters)enable_tokens_limit(bool): DefaultTrue. Whether to enable context length limitssession_tokens_windows(int): Default5000. Session tokens window sizellm_timeout(int): Default60. API request timeout duration (seconds)auto_retry(bool): DefaultTrue. Automatically retry on request failuremax_retries(int): Default3. Maximum number of retriesmax_fallbacks(int): Default5. Maximum number of preset fallbacksenable_memory_abstract(bool): DefaultTrue. Whether to enable context memory summarization (deletes context and inserts a summary into system instruction)memory_abstract_proportion(float): Default0.5. Context summarization proportion (0.5 = 50%)enable_multi_modal(bool): DefaultTrue. Whether to enable multi-modal support (currently only supports image)
Description
The LLMConfig class inherits from BaseModel and is exposed as AmritaConfig.llm. It controls token limits, retry/fallback behavior, memory summarization, and multi-modal support.
Example
python
from amrita_core.config import LLMConfig
llm_config = LLMConfig(
enable_memory_abstract=True,
memory_abstract_proportion=0.15, # Summarize a portion of the conversation when reaching the token limit
)