
ametnes/litellm using a consistent OpenAI-compatible API format. Whether you're using OpenAI, Anthropic, Azure, Bedrock, Vertex AI, or any other provider, LiteLLM translates your requests and provides consistent responses.
LiteLLM is an AI Gateway (Proxy Server) that provides:
| Tag | Description |
|---|---|
main-stable | Latest stable release (recommended for production) |
main-latest | Latest development build |
v1.x.x-stable | Specific stable version |
v1.x.x | Specific version (may include pre-releases) |
Recommended: Use main-stable or version-specific -stable tags for production deployments.
docker run -p 4000:4000 \ -e OPENAI_API_KEY=your-openai-key \ berriai/litellm:main-stable \ --model gpt-4o### With Configuration File
docker run -p 4000:4000 \ -v $(pwd)/config.yaml:/app/config.yaml \ -e DATABASE_URL=postgresql://user:pass@host:5432/litellm \ berriai/litellm:main-stable \ --config /app/config.yaml
ml services: litellm: image: berriai/litellm:main-stable ports: - "4000:4000" environment: DATABASE_URL: postgresql://llmproxy:password@db:5432/litellm STORE_MODEL_IN_DB: "True" depends_on: - db db: image: postgres:16 environment: POSTGRES_DB: litellm POSTGRES_USER: llmproxy POSTGRES_PASSWORD: password## 🔧 Configuration
| Variable | Description | Required |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | Yes (for production) |
LITELLM_MASTER_KEY | Master key for admin operations | Yes |
OPENAI_API_KEY | OpenAI API key | No (if using other providers) |
STORE_MODEL_IN_DB | Enable model management via UI | No |
LITELLM_LOG | Log level (ERROR, INFO, DEBUG) | No |
LITELLM_MODE | Set to "PRODUCTION" for production | No |
docker run berriai/litellm:main-stable
--port 4000 \ # Server port (default: 4000)
--config /app/config.yaml \ # Path to config file
--num_workers 4 \ # Number of worker processes
--run_gunicorn \ # Use Gunicorn instead of Uvicorn
--max_requests_before_restart *** # Worker recycling### Example Config File
Create config.yaml:
model_list:
general_settings: master_key: os.environ/LITELLM_MASTER_KEY database_connection_pool_limit: 10 proxy_batch_write_at: 60
router_settings: redis_host: os.environ/REDIS_HOST redis_port: os.environ/REDIS_PORT redis_password: os.environ/REDIS_PASSWORD
litellm_settings: cache: true cache_params: type: redis host: os.environ/REDIS_HOST port: os.environ/REDIS_PORT password: os.environ/REDIS_PASSWORD## 📚 Key Features
Call any LLM provider using OpenAI's format:
Access the web UI at http://localhost:4000/ui to:
pythonimport openai client = openai.OpenAI( api_key="your-virtual-key", # Created via admin UI base_url="http://localhost:4000" ) response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)## 🛠️ Production Deployment
For production deployments, see our Production Guide which covers:
See Benchmarks for detailed performance metrics.
LiteLLM is licensed under the MIT License. See LICENSE for details.
Made with ❤️ by BerriAI






manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务