LLM Module
The LLM module provides the core language model client and utilities for agent interactions, supporting multiple providers through LiteLLM.Param Cluster Map
Note:
base_url and api_key remain separate parameters (connection/auth constraint).
Precedence Ladder
Instance > Config > Array > Dict > String > Bool > Default
Ways to Use llm=
Legacy (Deprecated)
Installation
Quick Start
Classes
LLM
Main LLM client class supporting multiple providers.Constructor
Methods
LLMContextLengthExceededException
Exception raised when context length is exceeded.LLMResponseError
Raised byLLM.get_response() when the tool-calling loop fails mid-iteration and cannot produce a response. The original exception is chained via raise … from e, so e.__cause__ holds the underlying error.
agent.chat() persisted an empty assistant message and retries burned through their budget on a phantom success. Now the failure surfaces as a distinguishable exception.
LLMResponseError and LLMContextLengthExceededException coexist. Context-length errors still raise their dedicated exception; LLMResponseError is strictly the “tool loop failed mid-iteration” case. If you already wrap agent.chat() in try/except Exception, nothing changes — it still catches this. Catch LLMResponseError only if you want to distinguish tool-loop failures.
