
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://img.shields.io/docker/pulls/berriai/litellm](https://hub.docker.com/r/berriai/litellm) https://img.shields.io/badge/docs-litellm.ai-blue]([***] https://img.shields.io/github/stars/BerriAI/litellm?style=social](https://github.com/BerriAI/litellm)
LiteLLM is a production-ready LLM Gateway and unified interface that allows you to call 100+ Large Language Models (LLMs) 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 https://docs.litellm.ai/docs/proxy/prod which covers:
See https://docs.litellm.ai/docs/benchmarks for detailed performance metrics.
LiteLLM is licensed under the MIT License. See https://github.com/BerriAI/litellm/blob/main/LICENSE for details.
Made with ❤️ by [*]
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 ametnes/litellm 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: