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 str

No description available.

ResponseField Optional

No description available.

ResponseField Optional[str]

No description available.

ResponseField Optional[str]

No description available.

ResponseField Optional

No description available.

Internal & Generic Methods
  • from_dict: Create LLMConfig from dictionary.
  • to_dict: Convert to dictionary.

Usage

python
# 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 GitHub

praisonaiagents/config/feature_configs.py at line 1169


Related Documentation