LLM Config • AI Agent SDK
LLMConfig: Configuration for LLM model settings.
LLMConfig
Defined in the Feature Configs module.
AI Agent
Configuration for LLM model settings.
Groups all LLM-related parameters including model selection, API settings, and fallback configuration.
Properties
ResponseField
strNo description available.
ResponseField
OptionalNo description available.
ResponseField
Optional[str]No description available.
ResponseField
Optional[str]No description available.
ResponseField
OptionalNo description available.
Internal & Generic Methods
- from_dict: Create LLMConfig from dictionary.
- to_dict: Convert to dictionary.
Usage
# With primary model only
Agent(llm_config=LLMConfig(model="gpt-4o"))
# With fallback chain
Agent(llm_config=LLMConfig(
model="gpt-4o",
fallback_models=["claude-3-5-sonnet", "gpt-4o-mini"],
base_url="https://api.example.com",
api_key="sk-...",
))
# With LiteLLM-style provider prefix
Agent(llm_config=LLMConfig(
model="anthropic/claude-3-5-sonnet",
fallback_models=["openai/gpt-4o", "openai/gpt-4o-mini"],
))Source
View on GitHubpraisonaiagents/config/feature_configs.py at line 1169