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:openai: OpenAI and compatible APIsdeepseek: DeepSeek Model Servicezhipuai: Zhipu AIsiliconflow: SiliconFlowvolcengine: ByteDance Volcano Ark Large Model Enginevllm: Model service deployed with VLLM, also used to access OpenAI API compatible large models
model(str): Model name to be used, needs to be set according to the service provider’s requirementsapi_key(str): API access keybase_url(Optional[str]): API base URL, only VLLM type supports customization, other types provide the default URL of the providerconcurrency(int): Number of concurrent requests, used to control request frequency to avoid triggering rate limiting, default 200timeout(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