AI Skill Hub 强烈推荐:LiteLLM多模型网关 是一款优质的AI工具。在 GitHub 上收获超过 46.9k 颗 Star,AI 综合评分 8.8 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
LiteLLM多模型网关 是一款基于 Python 开发的开源工具,专注于 LLM网关、多模型代理、OpenAI兼容 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
LiteLLM多模型网关 是一款基于 Python 开发的开源工具,专注于 LLM网关、多模型代理、OpenAI兼容 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install litellm
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install litellm
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/BerriAI/litellm
cd litellm
pip install -e .
# 验证安装
python -c "import litellm; print('安装成功')"
# 命令行使用
litellm --help
# 基本用法
litellm input_file -o output_file
# Python 代码中调用
import litellm
# 示例
result = litellm.process("input")
print(result)
# litellm 配置文件示例(config.yml) app: name: "litellm" debug: false log_level: "INFO" # 运行时指定配置文件 litellm --config config.yml # 或通过环境变量配置 export LITELLM_API_KEY="your-key" export LITELLM_OUTPUT_DIR="./output"
LiteLLM AI Gateway
Open Source AI Gateway for 100+ LLMs. Self-hosted. Enterprise-ready. Call any LLM in OpenAI format.
<img width="2688" height="1600" alt="Group 7154 (1)" src="https://github.com/user-attachments/assets/c5ee0412-6fb5-4fb6-ab5b-bafae4209ca6" />
---
<details open> <summary><b>LLMs</b> - Call 100+ LLMs (Python SDK + AI Gateway)</summary>
All Supported Endpoints - /chat/completions, /responses, /embeddings, /images, /audio, /batches, /rerank, /a2a, /messages and more.
All LiteLLM Docker images published to GHCR are signed with cosign. Every release is signed with the same key introduced in commit 0112e53.
Verify using the pinned commit hash (recommended):
A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:
cosign verify \
--key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
ghcr.io/berriai/litellm:<release-tag>
Verify using a release tag (convenience):
Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:
cosign verify \
--key https://raw.githubusercontent.com/BerriAI/litellm/<release-tag>/cosign.pub \
ghcr.io/berriai/litellm:<release-tag>
Replace <release-tag> with the version you are deploying (e.g. v1.83.0-stable).
---
This requires uv to be installed.
git clone https://github.com/BerriAI/litellm.git
cd litellm
make install-dev # Install development dependencies
make format # Format your code
make lint # Run all linting checks
make test-unit # Run unit tests
make format-check # Check formatting only
For detailed contributing guidelines, see CONTRIBUTING.md.
📖 Contributing to documentation? The LiteLLM docs have moved to a separate repository: BerriAI/litellm-docs. Please open doc PRs there. Docs are served at docs.litellm.ai.
uv add litellm
```python from litellm import completion import os
os.environ["OPENAI_API_KEY"] = "your-openai-key" os.environ["ANTHROPIC_API_KEY"] = "your-anthropic-key"
from litellm.a2a_protocol import A2AClient
from a2a.types import SendMessageRequest, MessageSendParams
from uuid import uuid4
client = A2AClient(base_url="http://localhost:10001")
request = SendMessageRequest(
id=str(uuid4()),
params=MessageSendParams(
message={
"role": "user",
"parts": [{"kind": "text", "text": "Hello!"}],
"messageId": uuid4().hex,
}
)
)
response = await client.send_message(request)
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
from litellm import experimental_mcp_client
import litellm
server_params = StdioServerParameters(command="python", args=["mcp_server.py"])
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Load MCP tools in OpenAI format
tools = await experimental_mcp_client.load_mcp_tools(session=session, format="openai")
# Use with any LiteLLM model
response = await litellm.acompletion(
model="gpt-4o",
messages=[{"role": "user", "content": "What's 3 + 5?"}],
tools=tools
)
| Provider | /chat/completions | /messages | /responses | /embeddings | /image/generations | /audio/transcriptions | /audio/speech | /moderations | /batches | /rerank |
|---|---|---|---|---|---|---|---|---|---|---|
[Abliteration (abliteration)](https://docs.litellm.ai/docs/providers/abliteration) | ✅ | |||||||||
[AI/ML API (aiml)](https://docs.litellm.ai/docs/providers/aiml) | ✅ | ✅ | ✅ | ✅ | ✅ | |||||
[AI21 (ai21)](https://docs.litellm.ai/docs/providers/ai21) | ✅ | ✅ | ✅ | |||||||
[AI21 Chat (ai21_chat)](https://docs.litellm.ai/docs/providers/ai21) | ✅ | ✅ | ✅ | |||||||
| [Aleph Alpha](https://docs.litellm.ai/docs/providers/aleph_alpha) | ✅ | ✅ | ✅ | |||||||
| [Amazon Nova](https://docs.litellm.ai/docs/providers/amazon_nova) | ✅ | ✅ | ✅ | |||||||
[Anthropic (anthropic)](https://docs.litellm.ai/docs/providers/anthropic) | ✅ | ✅ | ✅ | ✅ | ||||||
[Anthropic Text (anthropic_text)](https://docs.litellm.ai/docs/providers/anthropic) | ✅ | ✅ | ✅ | ✅ | ||||||
| [Anyscale](https://docs.litellm.ai/docs/providers/anyscale) | ✅ | ✅ | ✅ | |||||||
[AssemblyAI (assemblyai)](https://docs.litellm.ai/docs/pass_through/assembly_ai) | ✅ | ✅ | ✅ | ✅ | ||||||
[Auto Router (auto_router)](https://docs.litellm.ai/docs/proxy/auto_routing) | ✅ | ✅ | ✅ | |||||||
[AWS - Bedrock (bedrock)](https://docs.litellm.ai/docs/providers/bedrock) | ✅ | ✅ | ✅ | ✅ | ✅ | |||||
[AWS - Sagemaker (sagemaker)](https://docs.litellm.ai/docs/providers/aws_sagemaker) | ✅ | ✅ | ✅ | ✅ | ||||||
[Azure (azure)](https://docs.litellm.ai/docs/providers/azure) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
[Azure AI (azure_ai)](https://docs.litellm.ai/docs/providers/azure_ai) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
[Azure Text (azure_text)](https://docs.litellm.ai/docs/providers/azure) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |||
[Baseten (baseten)](https://docs.litellm.ai/docs/providers/baseten) | ✅ | ✅ | ✅ | |||||||
[Bytez (bytez)](https://docs.litellm.ai/docs/providers/bytez) | ✅ | ✅ | ✅ | |||||||
[Cerebras (cerebras)](https://docs.litellm.ai/docs/providers/cerebras) | ✅ | ✅ | ✅ | |||||||
[Clarifai (clarifai)](https://docs.litellm.ai/docs/providers/clarifai) | ✅ | ✅ | ✅ | |||||||
[Cloudflare AI Workers (cloudflare)](https://docs.litellm.ai/docs/providers/cloudflare_workers) | ✅ | ✅ | ✅ | |||||||
[Codestral (codestral)](https://docs.litellm.ai/docs/providers/codestral) | ✅ | ✅ | ✅ | |||||||
[Cohere (cohere)](https://docs.litellm.ai/docs/providers/cohere) | ✅ | ✅ | ✅ | ✅ | ✅ | |||||
[Cohere Chat (cohere_chat)](https://docs.litellm.ai/docs/providers/cohere) | ✅ | ✅ | ✅ | |||||||
[CometAPI (cometapi)](https://docs.litellm.ai/docs/providers/cometapi) | ✅ | ✅ | ✅ | ✅ | ||||||
[CompactifAI (compactifai)](https://docs.litellm.ai/docs/providers/compactifai) | ✅ | ✅ | ✅ | |||||||
[Custom (custom)](https://docs.litellm.ai/docs/providers/custom_llm_server) | ✅ | ✅ | ✅ | |||||||
[Custom OpenAI (custom_openai)](https://docs.litellm.ai/docs/providers/openai_compatible) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |||
[Dashscope (dashscope)](https://docs.litellm.ai/docs/providers/dashscope) | ✅ | ✅ | ✅ | ✅ | ✅ | |||||
[Databricks (databricks)](https://docs.litellm.ai/docs/providers/databricks) | ✅ | ✅ | ✅ | |||||||
[DataRobot (datarobot)](https://docs.litellm.ai/docs/providers/datarobot) | ✅ | ✅ | ✅ | |||||||
[Deepgram (deepgram)](https://docs.litellm.ai/docs/providers/deepgram) | ✅ | ✅ | ✅ | ✅ | ||||||
[DeepInfra (deepinfra)](https://docs.litellm.ai/docs/providers/deepinfra) | ✅ | ✅ | ✅ | |||||||
[Deepseek (deepseek)](https://docs.litellm.ai/docs/providers/deepseek) | ✅ | ✅ | ✅ | |||||||
[ElevenLabs (elevenlabs)](https://docs.litellm.ai/docs/providers/elevenlabs) | ✅ | ✅ | ✅ | ✅ | ✅ | |||||
[Empower (empower)](https://docs.litellm.ai/docs/providers/empower) | ✅ | ✅ | ✅ | |||||||
[Fal AI (fal_ai)](https://docs.litellm.ai/docs/providers/fal_ai) | ✅ | ✅ | ✅ | ✅ | ||||||
[Featherless AI (featherless_ai)](https://docs.litellm.ai/docs/providers/featherless_ai) | ✅ | ✅ | ✅ | |||||||
[Fireworks AI (fireworks_ai)](https://docs.litellm.ai/docs/providers/fireworks_ai) | ✅ | ✅ | ✅ | |||||||
[FriendliAI (friendliai)](https://docs.litellm.ai/docs/providers/friendliai) | ✅ | ✅ | ✅ | |||||||
[Galadriel (galadriel)](https://docs.litellm.ai/docs/providers/galadriel) | ✅ | ✅ | ✅ | |||||||
[GitHub Copilot (github_copilot)](https://docs.litellm.ai/docs/providers/github_copilot) | ✅ | ✅ | ✅ | ✅ | ||||||
[GitHub Models (github)](https://docs.litellm.ai/docs/providers/github) | ✅ | ✅ | ✅ | |||||||
| [Google - PaLM](https://docs.litellm.ai/docs/providers/palm) | ✅ | ✅ | ✅ | |||||||
[Google - Vertex AI (vertex_ai)](https://docs.litellm.ai/docs/providers/vertex) | ✅ | ✅ | ✅ | ✅ | ✅ | |||||
[Google AI Studio - Gemini (gemini)](https://docs.litellm.ai/docs/providers/gemini) | ✅ | ✅ | ✅ | |||||||
[GradientAI (gradient_ai)](https://docs.litellm.ai/docs/providers/gradient_ai) | ✅ | ✅ | ✅ | |||||||
[Groq AI (groq)](https://docs.litellm.ai/docs/providers/groq) | ✅ | ✅ | ✅ | |||||||
[Heroku (heroku)](https://docs.litellm.ai/docs/providers/heroku) | ✅ | ✅ | ✅ | |||||||
[Hosted VLLM (hosted_vllm)](https://docs.litellm.ai/docs/providers/vllm) | ✅ | ✅ | ✅ | |||||||
[Huggingface (huggingface)](https://docs.litellm.ai/docs/providers/huggingface) | ✅ | ✅ | ✅ | ✅ | ✅ | |||||
[Hyperbolic (hyperbolic)](https://docs.litellm.ai/docs/providers/hyperbolic) | ✅ | ✅ | ✅ | |||||||
[IBM - Watsonx.ai (watsonx)](https://docs.litellm.ai/docs/providers/watsonx) | ✅ | ✅ | ✅ | ✅ | ||||||
[Infinity (infinity)](https://docs.litellm.ai/docs/providers/infinity) | ✅ | |||||||||
[Jina AI (jina_ai)](https://docs.litellm.ai/docs/providers/jina_ai) | ✅ | |||||||||
[Lambda AI (lambda_ai)](https://docs.litellm.ai/docs/providers/lambda_ai) | ✅ | ✅ | ✅ | |||||||
[Lemonade (lemonade)](https://docs.litellm.ai/docs/providers/lemonade) | ✅ | ✅ | ✅ | |||||||
[LiteLLM Proxy (litellm_proxy)](https://docs.litellm.ai/docs/providers/litellm_proxy) | ✅ | ✅ | ✅ | ✅ | ✅ | |||||
[Llamafile (llamafile)](https://docs.litellm.ai/docs/providers/llamafile) | ✅ | ✅ | ✅ | |||||||
[LM Studio (lm_studio)](https://docs.litellm.ai/docs/providers/lm_studio) | ✅ | ✅ | ✅ | |||||||
[Maritalk (maritalk)](https://docs.litellm.ai/docs/providers/maritalk) | ✅ | ✅ | ✅ | |||||||
[Meta - Llama API (meta_llama)](https://docs.litellm.ai/docs/providers/meta_llama) | ✅ | ✅ | ✅ | |||||||
[Mistral AI API (mistral)](https://docs.litellm.ai/docs/providers/mistral) | ✅ | ✅ | ✅ | ✅ | ||||||
[Moonshot (moonshot)](https://docs.litellm.ai/docs/providers/moonshot) | ✅ | ✅ | ✅ | |||||||
[Morph (morph)](https://docs.litellm.ai/docs/providers/morph) | ✅ | ✅ | ✅ | |||||||
[Nebius AI Studio (nebius)](https://docs.litellm.ai/docs/providers/nebius) | ✅ | ✅ | ✅ | ✅ | ||||||
[NLP Cloud (nlp_cloud)](https://docs.litellm.ai/docs/providers/nlp_cloud) | ✅ | ✅ | ✅ | |||||||
[Novita AI (novita)](https://novita.ai/models/llm?utm_source=github_litellm&utm_medium=github_readme&utm_campaign=github_link) | ✅ | ✅ | ✅ | |||||||
[Nscale (nscale)](https://docs.litellm.ai/docs/providers/nscale) | ✅ | ✅ | ✅ | |||||||
[Nvidia NIM (nvidia_nim)](https://docs.litellm.ai/docs/providers/nvidia_nim) | ✅ | ✅ | ✅ | |||||||
[OCI (oci)](https://docs.litellm.ai/docs/providers/oci) | ✅ | ✅ | ✅ | |||||||
[Ollama (ollama)](https://docs.litellm.ai/docs/providers/ollama) | ✅ | ✅ | ✅ | ✅ | ||||||
[Ollama Chat (ollama_chat)](https://docs.litellm.ai/docs/providers/ollama) | ✅ | ✅ | ✅ | |||||||
[Oobabooga (oobabooga)](https://docs.litellm.ai/docs/providers/openai_compatible) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |||
[OpenAI (openai)](https://docs.litellm.ai/docs/providers/openai) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
[OpenAI-like (openai_like)](https://docs.litellm.ai/docs/providers/openai_compatible) | ✅ | |||||||||
[OpenRouter (openrouter)](https://docs.litellm.ai/docs/providers/openrouter) | ✅ | ✅ | ✅ | |||||||
[OVHCloud AI Endpoints (ovhcloud)](https://docs.litellm.ai/docs/providers/ovhcloud) | ✅ | ✅ | ✅ | |||||||
[Perplexity AI (perplexity)](https://docs.litellm.ai/docs/providers/perplexity) | ✅ | ✅ | ✅ | |||||||
[Petals (petals)](https://docs.litellm.ai/docs/providers/petals) | ✅ | ✅ | ✅ | |||||||
[Predibase (predibase)](https://docs.litellm.ai/docs/providers/predibase) | ✅ | ✅ | ✅ | |||||||
[Recraft (recraft)](https://docs.litellm.ai/docs/providers/recraft) | ✅ | |||||||||
[Replicate (replicate)](https://docs.litellm.ai/docs/providers/replicate) | ✅ | ✅ | ✅ | |||||||
[Sagemaker Chat (sagemaker_chat)](https://docs.litellm.ai/docs/providers/aws_sagemaker) | ✅ | ✅ | ✅ | |||||||
[Sambanova (sambanova)](https://docs.litellm.ai/docs/providers/sambanova) | ✅ | ✅ | ✅ | |||||||
[Snowflake (snowflake)](https://docs.litellm.ai/docs/providers/snowflake) | ✅ | ✅ | ✅ | |||||||
[Text Completion Codestral (text-completion-codestral)](https://docs.litellm.ai/docs/providers/codestral) | ✅ | ✅ | ✅ | |||||||
[Text Completion OpenAI (text-completion-openai)](https://docs.litellm.ai/docs/providers/text_completion_openai) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |||
[Together AI (together_ai)](https://docs.litellm.ai/docs/providers/togetherai) | ✅ | ✅ | ✅ | |||||||
[Topaz (topaz)](https://docs.litellm.ai/docs/providers/topaz) | ✅ | ✅ | ✅ | |||||||
[Triton (triton)](https://docs.litellm.ai/docs/providers/triton-inference-server) | ✅ | ✅ | ✅ | |||||||
[V0 (v0)](https://docs.litellm.ai/docs/providers/v0) | ✅ | ✅ | ✅ | |||||||
[Vercel AI Gateway (vercel_ai_gateway)](https://docs.litellm.ai/docs/providers/vercel_ai_gateway) | ✅ | ✅ | ✅ | |||||||
[VLLM (vllm)](https://docs.litellm.ai/docs/providers/vllm) | ✅ | ✅ | ✅ | |||||||
[Volcengine (volcengine)](https://docs.litellm.ai/docs/providers/volcano) | ✅ | ✅ | ✅ | |||||||
[Voyage AI (voyage)](https://docs.litellm.ai/docs/providers/voyage) | ✅ | |||||||||
[WandB Inference (wandb)](https://docs.litellm.ai/docs/providers/wandb_inference) | ✅ | ✅ | ✅ | |||||||
[Watsonx Text (watsonx_text)](https://docs.litellm.ai/docs/providers/watsonx) | ✅ | ✅ | ✅ | |||||||
[xAI (xai)](https://docs.litellm.ai/docs/providers/xai) | ✅ | ✅ | ✅ | |||||||
[Xinference (xinference)](https://docs.litellm.ai/docs/providers/xinference) | ✅ |
---
业界主流的LLM统一接口方案,46.9k星超高热度,完善的多模型支持和成熟的代理网关架构,适合规模化应用。
该工具使用 NOASSERTION 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
📄 NOASSERTION — 请查阅原始协议条款了解具体使用限制。
总体来看,LiteLLM多模型网关 是一款质量优秀的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | litellm |
| 原始描述 | 开源MCP工具:Python SDK, Proxy Server (AI Gateway) to call 100+ LLM APIs in OpenAI (or native。⭐46.9k · Python |
| Topics | LLM网关多模型代理OpenAI兼容API统一Python SDK |
| GitHub | https://github.com/BerriAI/litellm |
| License | NOASSERTION |
| 语言 | Python |
收录时间:2026-05-14 · 更新时间:2026-05-16 · License:NOASSERTION · AI Skill Hub 不对第三方内容的准确性作法律背书。