Deployment
Configure .env
1. LLM Configuration
1.1. LiteLLM Configuration Rules (Recommended)
LiteLLM is a unified LLM API interface supporting 100+ model providers.
How it works
Model Name Format
Format: provider/model_name
or provider/organization/model_name
Examples (model names may change):
- OpenAI Official:
openai/gpt-4o
,openai/gpt-3.5-turbo
- Google Official:
gemini/gemini-2.5-pro
,gemini/gemini-2.5-flash
- Anthropic Official:
anthropic/claude-sonnet-4-20250514
- Third-party or Self-hosted:
openai/deepseek-ai/DeepSeek-V3
,openai/custom-model-name
API Endpoint Routing Logic
- LLM_ENDPOINT must always have a value
- For official APIs, use the provider's official endpoint URL
- For third-party platforms, use the platform's endpoint URL
- LiteLLM automatically handles API format differences between providers
- API key is set through LLM_APIKEY, or use environment variables (e.g.,
OPENAI_API_KEY
)
Configuration Examples
Scenario 1: OpenAI Official API
Scenario 2: Google Official API
Scenario 3: Anthropic Official API
Scenario 4: Third-party Platform or Self-hosted Service
Detailed Request Flow
Common Troubleshooting
Issue | Solution |
---|---|
Incorrect model name format | Check if prefix is correct (openai/ , anthropic/ , gemini/ , etc) |
API key error | Confirm key format and permissions, check if expired |
Endpoint unreachable | Check network connection and URL format, confirm endpoint is correct |
Model not found | Confirm model name is available at provider, check spelling |
Timeout error | Adjust network timeout settings, check provider service status |
Quota limit | Check API quota and billing status |
Code implementation reference: lite_llm_client.py
1.2. AISuite Configuration Rules (No longer updated)
Note: AISuite project hasn't been updated for months, recommend using LiteLLM
How it works:
Model Name Format
Format: provider:model_name
(Note: use colon, not slash)
Examples:
- OpenAI:
openai:gpt-4o
,openai:gpt-3.5-turbo
- Anthropic:
anthropic:claude-sonnet-4-20250514
- Google:
google:gemini-pro
- Custom deployment:
openai:custom-model-name
- SiliconFlow (Third-party Platform):
openai:deepseek-ai/DeepSeek-V3
Configuration Limitations
- Does not support dynamic configuration via environment variables, poor flexibility
- Can only support new providers or endpoints through code modification
Code implementation reference: aisuite_client.py
2. Embedding Model Configuration
The embedding model uses an independent configuration system, not dependent on MODEL_PLATFORM_TYPE
.
Configuration Rules
- Uses OpenAI compatible format by default, so no
openai/
prefix needed - Supports custom endpoints and API keys