LLM Configuration

LLM configuration defines the large language model related settings used by agents. AgentSociety supports multiple LLM configurations, and the system will automatically load balance between multiple configurations using a round-robin approach.

Configuration

  • provider (LLMProviderType): LLM service provider type, supporting the following options:

  • model (str): Model name to be used, needs to be set according to the service provider’s requirements

  • api_key (str): API access key

  • base_url (Optional[str]): API base URL, only VLLM type supports customization, other types provide the default URL of the provider

  • concurrency (int): Number of concurrent requests, used to control request frequency to avoid triggering rate limiting, default 200

  • timeout (float): Request timeout time (seconds), default 30 seconds, maximum 60 seconds

Configuration Example

OpenAI Compatible API Configuration:

llm:
  - provider: openai
    model: gpt-4o-mini
    api_key: sk-your-api-key
    concurrency: 100
    timeout: 30

Multiple LLM Configuration (Load Balancing):

llm:
  - provider: deepseek
    model: deepseek-chat
    api_key: sk-deepseek-key
    concurrency: 200
  - provider: qwen
    model: qwen-turbo
    api_key: sk-qwen-key
    concurrency: 150

VLLM Local Deployment Configuration:

llm:
  - provider: vllm
    model: qwen2.5-14b-instruct
    api_key: token-abc123
    base_url: http://localhost:8000/v1
    concurrency: 50