ghcr.io/BerriAI/litellm/chart/litellm

ghcr.io/BerriAI/litellm/chart/litellm:1.103.10

ghcr.iolinux/amd641.103.10大小: 33.89 KB更新于 2026年11月8日

🚅 LiteLLM

LiteLLM AI 网关

面向 100 余款大语言模型的开源 AI 网关,支持自托管,已适配企业级场景,可通过 OpenAI 格式调用任意 LLM。

https://docs.litellm.ai/docs/simple_proxy | 托管代理 | 企业版 | 官网


什么是 LiteLLM

LiteLLM 是一款开源 AI 网关,提供统一的标准化接口,支持以 OpenAI 格式调用 100 余个 LLM 服务商的模型,包括 OpenAI、Anthropic、Gemini、Bedrock、Azure 等。

你可以将其作为 Python SDK 直接集成到代码库中,也可以部署 AI 网关(代理服务器),为团队或组织提供中心化服务。

https://docs.litellm.ai/docs/simple_proxy https://docs.litellm.ai/docs/providers


为什么选择 LiteLLM

跨服务商管理 LLM 调用会快速变得十分复杂:每个模型都有专属的 SDK、鉴权逻辑、请求格式和错误类型。LiteLLM 可以消除这类痛点:

  • 统一 API — 一套接口适配 100 余款 LLM,无需在各类服务商专属 SDK 之间切换
  • 无缝兼容 OpenAI — 无需改写代码即可切换底层服务商
  • 生产级网关 — 开箱即用虚拟密钥、消费追踪、内容防护、负载均衡及管理面板功能
  • 在 1k RPS 场景下实现 8ms 的 P95 延迟(https://docs.litellm.ai/docs/benchmarks)

开源采用方

Netflix


功能特性

大语言模型调用 - 适配 100 余款 LLM(支持 Python SDK + AI 网关两种方式)

https://docs.litellm.ai/docs/supported_endpoints — 涵盖 /chat/completions、/responses、/embeddings、/images、/audio、/batches、/rerank、/a2a、/messages 等。

Python SDK

uv add litellm

独立的 litellm-core 发行包提供 Python SDK 能力,保留了完全一致的 import litellm API 及运行时依赖。该包不含任何可选扩展、CLI 入口或绑定面板。请注意每个环境只能安装一个 SDK 发行版本,litellm 和 litellm-core 会覆盖相同的 Python 文件,二者不能共存。如需使用代理、CLI 及可选扩展,请安装完整版 litellm。

当前 litellm-core 的发布集成流程尚未上线,你可以通过当前代码仓库自行构建并安装核心版本:

python scripts/build_core_distribution.py --out-dir dist/core
python -m pip install dist/core/litellm_core-*.whl

构建工具依赖 Git、uv 及 Rust 构建工具链。它会从根目录的 pyproject.toml 读取发布版本号,不会修改原有源代码,最终在 dist/core 目录下生成 wheel 包与独立源码分发包。请在未安装 litellm 的全新环境中执行安装操作。

from litellm import completion
import os

os.environ["OPENAI_API_KEY"] = "your-openai-key"
os.environ["ANTHROPIC_API_KEY"] = "your-anthropic-key"

# 调用 OpenAI 模型
response = completion(model="openai/gpt-4o", messages=[{"role": "user", "content": "Hello!"}])

# 调用 Anthropic 模型
response = completion(model="anthropic/claude-sonnet-4-20250514", messages=[{"role": "user", "content": "Hello!"}])

AI 网关(代理服务器)

https://docs.litellm.ai/docs/proxy/docker_quick_start — 完成虚拟密钥配置,发起首次调用

uv tool install 'litellm[proxy]'
litellm --model gpt-4o
import openai

client = openai.OpenAI(api_key="anything", base_url="http://0.0.0.0:4000")
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)

自动路由 - 为每个提示词动态选择适配模型(支持 Python SDK + AI 网关两种方式)

Python SDK

https://docs.litellm.ai/docs/autorouter_sdk

先执行 uv add litellm 完成安装,再为后续示例中用到的模型配置好对应的 OPENAI_API_KEY 环境变量。

import asyncio
from litellm import Router

router = Router(model_list=[
{"model_name": "fast", "litellm_params": {"model": "openai/gpt-6-luna"}},
{"model_name": "capable", "litellm_params": {"model": "openai/gpt-6.1-sol"}},
{"model_name": "auto", "litellm_params": {
"model": "auto_router/complexity_router",
"complexity_router_config": {
"classifier_type": "heuristic",
"tiers": {"SIMPLE": "fast", "MEDIUM": "fast",
"COMPLEX": "capable", "REASONING": "capable"},
"return_raw_model_name": True,
},
"complexity_router_default_model": "capable",
}},
])
response = asyncio.run(router.acompletion(
model="auto", messages=[{"role": "user", "content": "What is 2+2?"}],
))
print(response.model, response.choices[0].message.content)

AI 网关(代理服务器)

https://docs.litellm.ai/docs/auto_router/setup 之后即可通过配置的模型名称发起调用。请将下方示例中的 auto 和 URL 替换为你自己的配置,并将 LITELLM_API_KEY 设置为你的虚拟密钥。

curl http://localhost:4000/v1/chat/completions \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"auto","messages":[{"role":"user","content":"What is 2+2?"}]}'

A2A - 调用 A2A 智能体(支持 Python SDK + AI 网关两种方式)

https://docs.litellm.ai/docs/a2a#add-a2a-agents — LangGraph、Vertex AI Agent Engine、Azure AI Foundry、Bedrock AgentCore、Pydantic AI

Python SDK - A2A 协议

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)

AI 网关(代理服务器)

步骤 1. https://docs.litellm.ai/docs/a2a#adding-your-agent — 为每个智能体单独配置 protocolVersion 为 1.0 或 0.3

步骤 2. 通过 A2A SDK 调用智能体(依赖 a2a-sdk>=1.1.0)

import httpx
from a2a.client import A2ACardResolver, ClientConfig, ClientFactory
from a2a.types import Message, Part, Role, SendMessageRequest
from a2a.utils.constants import TransportProtocol
from uuid import uuid4

base_url = "http://localhost:4000/a2a/my-agent" # LiteLLM 代理地址 + 智能体名称
headers = {"Authorization": "Bearer "} # LiteLLM 主密钥或虚拟密钥

async with httpx.AsyncClient(headers=headers, timeout=60.0) as http_client:
resolver = A2ACardResolver(httpx_client=http_client, base_url=base_url)
agent_card = await resolver.get_agent_card()
config = ClientConfig(
httpx_client=http_client,
streaming=False,
supported_protocol_bindings=[TransportProtocol.JSONRPC, TransportProtocol.HTTP_JSON],
)
client = ClientFactory(config).create(agent_card)

request = SendMessageRequest(
message=Message(
message_id=uuid4().hex,
role=Role.ROLE_USER,
parts=[Part(text="Hello!")],
)
)
async for event in client.send_message(request):
populated = event.ListFields()
if populated and populated[0][0].name in ("message", "msg"):
print("".join(getattr(p, "text", "") or "" for p in populated[0][1].parts))

https://docs.litellm.ai/docs/a2a

MCP 工具 - 将 MCP 服务器接入任意 LLM(支持 Python SDK + AI 网关两种方式)

Python SDK - MCP 桥接

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
from litellm import 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()

# 以 OpenAI 格式加载 MCP 工具
tools = await mcp_client.load_mcp_tools(session=session, format="openai")

# 搭配任意 LiteLLM 模型使用
response = await litellm.acompletion(
model="gpt-4o",
messages=[{"role": "user", "content": "What's 3 + 5?"}],
tools=tools
)

AI 网关 - MCP 网关

步骤 1. https://docs.litellm.ai/docs/mcp#adding-your-mcp

步骤 2. 通过 /chat/completions 调用 MCP 工具

curl -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Summarize the latest open PR"}],
"tools": [{
"type": "mcp",
"server_url": "litellm_proxy/mcp/github",
"server_label": "github_mcp",
"require_approval": "never"
}]
}'

在 Cursor IDE 中使用

{
"mcpServers": {
"LiteLLM": {
"url": "http://localhost:4000/mcp/",
"headers": {
"x-litellm-api-key": "Bearer "
}
}
}
}

[!NOTE] 对于 MCP OAuth 场景,上游服务可能会声明支持动态客户端注册,但实际会返回 HTTP 401 或 403 拒绝请求。如果提供商要求使用预注册的 OAuth 应用,请在 MCP 服务器上配置对应应用的 credentials.client_id,必要时还需配置 credentials.client_secret,这样网关登录流程就会跳过动态注册步骤。注意该提供商必须为该应用授予 MCP 访问权限,仅成功跳转至授权页面并不代表后续登录或工具调用一定能成功。

https://docs.litellm.ai/docs/mcp

代理 —— 通过 Python SDK 在任意模型上运行 Claude Code、Codex、OpenCode、pi 或深度代理

Python SDK - 代理

import litellm
from litellm import Harness, sandbox

result = litellm.agent(
Harness.CLAUDE_CODE, # 也可选用 Harness.CODEX、Harness.OPENCODE、Harness.PI、Harness.DEEPAGENTS
"Find why tests/test_router.py is flaky and fix it.",
sandbox=sandbox.local("./repo"),
model="litellm_proxy/claude-sonnet-4-5", # 你 AI 网关上的模型组
)

print(result.text, result.cost, [f.path for f in result.files])

配置 LITELLM_PROXY_API_BASE 和 LITELLM_PROXY_API_KEY 后,代理发起的所有模型调用都会经过你的 AI 网关,且会自动打上 harness,claude_code 标签。如果去掉 litellm_proxy/ 前缀,则会直接调用对应提供商的模型。你需要先安装 starlette uvicorn,以及对应代理的 CLI 工具(claude、codex、opencode 或 pi),如果使用深度代理则需要安装 deepagents langchain-litellm。

https://docs.litellm.ai/docs/harness

支持的提供商(https://models.litellm.ai/ | https://docs.litellm.ai/docs/providers)

以下是 LiteLLM 支持的所有提供商及其对应 API 端点的兼容情况表:

提供商/chat/completions/messages/responses/embeddings/image/generations/audio/transcriptions/audio/speech/moderations/batches/rerank
https://docs.litellm.ai/docs/providers/abliteration✅
https://docs.litellm.ai/docs/providers/aiml✅✅✅✅✅
https://docs.litellm.ai/docs/providers/ai21✅✅✅
https://docs.litellm.ai/docs/providers/ai21✅✅✅
https://docs.litellm.ai/docs/providers/aleph_alpha✅✅✅
https://docs.litellm.ai/docs/providers/amazon_nova✅✅✅
https://docs.litellm.ai/docs/providers/anthropic✅✅✅✅
https://docs.litellm.ai/docs/providers/anthropic✅✅✅✅
https://docs.litellm.ai/docs/providers/anyscale✅✅✅
https://docs.litellm.ai/docs/pass_through/assembly_ai✅✅✅✅
https://docs.litellm.ai/docs/proxy/auto_routing✅✅✅
https://docs.litellm.ai/docs/providers/bedrock✅✅✅✅✅
https://docs.litellm.ai/docs/providers/aws_sagemaker✅✅✅✅
https://docs.litellm.ai/docs/providers/azure✅✅✅✅✅✅✅✅✅
https://docs.litellm.ai/docs/providers/azure_ai✅✅✅✅✅✅✅✅✅
https://docs.litellm.ai/docs/providers/azure✅✅✅✅✅✅✅
https://docs.litellm.ai/docs/providers/baseten✅✅✅
https://docs.litellm.ai/docs/providers/bytez✅✅✅
https://docs.litellm.ai/docs/providers/cerebras✅✅✅
https://docs.litellm.ai/docs/providers/clarifai✅✅✅
https://docs.litellm.ai/docs/providers/clf_ai_gateway✅✅✅
https://docs.litellm.ai/docs/providers/cloudflare_workers✅✅✅
https://docs.litellm.ai/docs/providers/codestral✅✅✅
https://docs.litellm.ai/docs/providers/cognition✅✅✅
https://docs.litellm.ai/docs/providers/cohere✅✅✅✅✅
https://docs.litellm.ai/docs/providers/cohere✅✅✅
https://docs.litellm.ai/docs/providers/cometapi✅✅✅✅
https://docs.litellm.ai/docs/providers/compactifai✅✅✅
https://docs.litellm.ai/docs/providers/coralbricks✅✅✅
https://docs.litellm.ai/docs/providers/custom_llm_server✅✅✅
https://docs.litellm.ai/docs/providers/openai_compatible✅✅✅✅✅✅✅
https://docs.litellm.ai/docs/providers/dashscope✅✅✅✅✅
https://docs.litellm.ai/docs/providers/databricks✅✅✅
https://docs.litellm.ai/docs/providers/datarobot✅✅✅
https://docs.litellm.ai/docs/providers/deepgram✅✅✅✅
https://docs.litellm.ai/docs/providers/deepinfra✅✅✅
https://docs.litellm.ai/docs/providers/deepseek✅✅✅
https://docs.litellm.ai/docs/providers/edenai✅✅✅✅✅✅✅
https://docs.litellm.ai/docs/providers/elevenlabs✅✅✅✅✅
https://docs.litellm.ai/docs/providers/empiriolabs✅✅
https://docs.litellm.ai/docs/providers/empower✅✅✅
https://docs.litellm.ai/docs/pass_through/eu_jev
https://docs.litellm.ai/docs/providers/fal_ai✅✅✅✅
https://docs.litellm.ai/docs/providers/featherless_ai✅✅✅
https://docs.litellm.ai/docs/providers/fireworks_ai✅✅✅
https://docs.litellm.ai/docs/providers/friendliai✅✅✅
https://docs.litellm.ai/docs/providers/galadriel✅✅✅
https://docs.litellm.ai/docs/providers/github_copilot✅✅✅✅
https://docs.litellm.ai/docs/providers/github✅✅✅
https://docs.litellm.ai/docs/providers/palm✅✅✅
https://docs.litellm.ai/docs/providers/vertex✅✅✅✅✅
https://docs.litellm.ai/docs/providers/gemini✅✅✅
https://docs.litellm.ai/docs/providers/gradient_ai✅✅✅
https://docs.litellm.ai/docs/providers/groq✅✅✅
https://docs.litellm.ai/docs/providers/heroku✅✅✅
https://docs.litellm.ai/docs/providers/vllm✅✅✅
https://docs.litellm.ai/docs/providers/huggingface✅✅✅✅✅
https://docs.litellm.ai/docs/providers/hyperbolic✅✅✅
https://docs.litellm.ai/docs/providers/watsonx✅✅✅✅
https://docs.litellm.ai/docs/providers/infinity✅
https://docs.litellm.ai/docs/providers/jina_ai✅

https://docs.litellm.ai/docs/


快速入门

你可以通过代理服务器或 Python SDK 使用 LiteLLM。二者均提供统一接口,可对接 100 余种大语言模型。请选择最贴合自身需求的方案:

对比项LiteLLM AI 网关LiteLLM Python SDK
使用场景作为中心化服务(LLM 网关)对接多个大模型直接在 Python 代码中使用 LiteLLM
适用团队Gen AI 赋能 / ML 平台团队开发 LLM 项目的开发者
核心特性集中式 API 网关,内置身份认证与权限控制;支持多租户成本统计,按项目/用户进行支出管理;支持按项目自定义配置(日志、防护规则、缓存);提供虚拟密钥实现安全访问控制;配备管理面板 UI 用于监控和运维可直接在代码库中完成 Python 库集成;内置 Router 组件,支持跨多部署环境(如 Azure/OpenAI)的重试/降级逻辑 — 详见 https://docs.litellm.ai/docs/routing;支持应用层负载均衡与成本统计;提供与 OpenAI 兼容的异常处理机制;支持对接 Lunary、MLflow、Langfuse 等可观测性回调

稳定版本: 使用带 -stable 标签的 Docker 镜像。这类镜像在发布前已完成 12 小时负载测试。https://docs.litellm.ai/docs/proxy/release_cycle

我们持续扩展对更多服务商的支持。如果缺少所需的服务商或大模型平台,请提交 https://github.com/BerriAI/litellm/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml&title=[Feature]%3A+。

使用 Terraform 在 AWS 或 GCP 上部署

使用官方发布的 Terraform 模块,可将 LiteLLM 代理作为生产就绪的组件化栈运行(网关、后端、UI 拆分至独立服务,搭配托管 Postgres + Redis + 对象存储)。两个模块均已发布至 https://registry.terraform.io/namespaces/BerriAI,无需身份认证即可访问。

AWS — ECS Fargate + Aurora + ElastiCache + ALB

git clone https://github.com/BerriAI/litellm.git
cd litellm/terraform/litellm/aws/examples/default
cp terraform.tfvars.example terraform.tfvars # 编辑区域/租户/环境配置
terraform init && terraform apply

https://registry.terraform.io/modules/BerriAI/litellm/aws/latest

你也可以在自有根配置中直接调用该模块:

# main.tf
terraform {
required_version = ">= 1.6.0"
required_providers {
aws = { source = "hashicorp/aws", version = "~> 5.60" }
}
}

provider "aws" {
region = "us-west-2"
}

module "litellm" {
source = "BerriAI/litellm/aws"
version = "~> 1.89"

region = "us-west-2"
azs = ["us-west-2a", "us-west-2b"]
tenant = "acme"
env = "prod"

# 生产环境:请提供 ACM 证书。未配置证书时,仅可将 allow_plaintext_alb 设为 true(仅限开发/试用场景)
# acm_certificate_arn = "arn:aws:acm:us-west-2:111122223333:certificate/..."
allow_plaintext_alb = true
}

output "litellm_url" {
value = module.litellm.alb_dns_name
}
terraform init
terraform apply

服务商 API 密钥存储在 AWS Secrets Manager 中,可通过 gateway_extra_secrets 参数引用其 ARN。完整输入参数列表与架构图请查看 https://registry.terraform.io/modules/BerriAI/litellm/aws/latest?tab=inputs。

GCP — Cloud Run + Cloud SQL + Memorystore + HTTPS LB

真正的一键部署流程:会自动打开 Cloud Shell,拉取最新稳定版的 https://github.com/BerriAI/terraform-google-litellm 模块镜像(体积较小,无需下载完整的 litellm 仓库),并通过内置的 DeployStack 教程引导你完成 terraform apply 操作。你只需选择目标项目,教程将自动配置 Artifact Registry 远程仓库、根据你的输入生成 terraform.tfvars 并执行部署。

https://registry.terraform.io/modules/BerriAI/litellm/google/latest

如果你希望在自有配置中调用该模块,由于 Cloud Run 无法直接从 ghcr.io 拉取镜像,需要先一次性配置由 GHCR 后端支持的 Artifact Registry 远程仓库:

gcloud artifacts repositories create litellm \
--location=us-central1 \
--repository-format=docker \
--mode=remote-repository \
--remote-docker-repo=https://ghcr.io \
--project=my-gcp-project

之后执行以下配置:

# main.tf
terraform {
required_version = ">= 1.6.0"
required_providers {
google = { source = "hashicorp/google", version = "~> 6.10" }
google-beta = { source = "hashicorp/google-beta", version = "~> 6.10" }
}
}

provider "google" { project = "my-gcp-project"; region = "us-central1" }
provider "google-beta" { project = "my-gcp-project"; region = "us-central1" }

module "litellm" {
source = "BerriAI/litellm/google"
version = "~> 1.89"

project_id = "my-gcp-project"
region = "us-central1"
tenant = "acme"
env = "prod"

# 将 my-gcp-project 替换为你的 GCP 项目 ID(需与上方 project_id 值保持一致)
image_registry = "us-central1-docker.pkg.dev/my-gcp-project/litellm/berriai"

# 生产环境:请提供已指向负载均衡 IP 的 DNS 域名,用于获取 Google 托管证书
# 未配置域名时,仅可将 allow_plaintext_lb 设为 true(仅限开发/试用场景)
# lb_domains = ["proxy.example.com"]
allow_plaintext_lb = true
}

output "litellm_url" {
value = module.litellm.load_balancer_url
}
terraform init
terraform apply

服务商 API 密钥存储在 Secret Manager 中,可通过 gateway_extra_secrets 参数引用其资源 ID(例如 projects/my-gcp-project/secrets/openai-api-key)。完整输入参数列表与架构图请查看 https://registry.terraform.io/modules/BerriAI/litellm/google/latest?tab=inputs。

两套部署栈均包含以下组件

  • 完整组件化拆分架构:网关 / 后端 / UI 均为独立服务
  • 托管 Postgres(主节点 + 读节点)与 Redis
  • 带版本控制的对象存储,用于保存代理状态与上传文件
  • 在对应云服务商的密钥管理服务中自动生成的 LITELLM_MASTER_KEY
  • 一次性迁移任务,会在代理启动前自动执行 prisma migrate deploy
  • 与 Helm Chart 完全一致的 proxy_config 配置能力 — 支持以类型化映射形式传入 YAML

Terraform 模块的源码位于本仓库的 terraform/litellm/aws/ 和 terraform/litellm/gcp/ 路径下;注册表中的条目为只读镜像,每次版本发布时同步更新。

以开发模式运行

依赖服务

  1. 在项目根目录下创建 .env 文件
  2. 启动依赖服务:docker-compose up db prometheus

后端

  1. 执行 make bootstrap 完成环境初始化
  2. 启动代理后端:uv run python litellm/proxy/proxy_cli.py

前端

  1. 进入 ui/litellm-dashboard 目录(依赖项已通过 make bootstrap 完成安装)
  2. 启动管理面板:npm run dev

校验 Docker 镜像签名

所有发布至 GHCR 的 LiteLLM Docker 镜像均使用 https://docs.sigstore.dev/cosign/overview/ 签名。版本签名密钥在提交 https://github.com/BerriAI/litellm/commit/e82a3c646908ba0a6ee0beddc4310d7a6cac4065 中引入。

推荐使用固定提交哈希进行校验:

提交哈希具有密码学不可篡改特性,因此这是确保你使用已发布签名密钥的最可靠方式:

cosign verify \
--key https://raw.githubusercontent.com/BerriAI/litellm/e82a3c646908ba0a6ee0beddc4310d7a6cac4065/cosign.pub \
ghcr.io/berriai/litellm:

使用发布标签验证(便捷方式):

本仓库中的标签受保护,且会解析到同一密钥。该方式可读性更强,但依赖仓库的标签保护规则:

cosign verify \
--key https://raw.githubusercontent.com/BerriAI/litellm/ /cosign.pub \
ghcr.io/berriai/litellm:

请将 <your-release-tag> 替换为你要部署的版本(例如 v1.83.0-stable)。


企业版

面向需要更高安全性、用户管理能力与专业支持的企业用户

https://litellm.ai/enterprise https://enterprise.litellm.ai/demo

企业版包含以下权益:

  • ✅ https://docs.litellm.ai/docs/enterprise 覆盖的所有功能
  • ✅ 功能优先级定制
  • ✅ 自定义集成开发
  • ✅ 专业支持——专属 *** + Slack 服务通道
  • ✅ 定制服务级别协议(SLA)
  • ✅ 支持单点登录的安全访问机制

贡献指南

我们欢迎所有对 LiteLLM 的贡献!无论你是修复 Bug、新增功能还是优化文档,你的帮助都十分珍贵。

如果你希望与我们的团队深度协作,请查看 https://www.litellm.ai/champions,该计划面向受信任的开源贡献者开放,参与者可获得专属 Slack 频道,且能直接参与产品路线图的讨论。

贡献者快速上手

该流程要求预先安装 uv。

git clone https://github.com/BerriAI/litellm.git
cd litellm
make install-dev # 安装开发依赖
make format # 格式化代码
make lint # 运行所有代码检查
make test-unit # 运行单元测试
make format-check # 仅执行格式校验

详细的贡献规范请参阅 CONTRIBUTING.md。

📖 贡献文档相关内容?LiteLLM 文档已迁移至独立仓库:https://github.com/BerriAI/litellm-docs。请在该仓库提交文档 PR,文档的在线访问地址为 https://docs.litellm.ai。

代码质量 / 代码检查

LiteLLM 遵循 https://google.github.io/styleguide/pyguide.html。

我们的自动化检查流程包含:

  • Ruff:负责代码格式化、代码规范检查与代码质量校验
  • basedpyright:负责类型检查
  • 循环导入检测
  • 导入安全检查

所有上述检查项必须全部通过,你的 PR 才能被合并。

技术支持 / 与核心团队沟通

  • 预约演示 👋
  • 社区 *** 💭
  • https://www.litellm.ai/support
  • 核心团队*** ✉️ *** / ***

贡献者

专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告