跳到主要内容Skip to main content
← Safety

LiteLLM 网关(Proxy / AI Gateway)LiteLLM Proxy (AI Gateway)

BerriAI · LiteLLM
本地Local 开源Open source 自托管Self-hosted 云端Cloud 权限链Permission chain webhookwebhook MCPMCP guardrailsguardrails partial lifecycle: active 核验Checked 2026-11-06

核验标记表示资料完整度,不是产品评分。下列未确认项可能影响选型;请按对应来源逐项确认。The confidence mark describes evidence completeness, not a product score. Unconfirmed items below may affect your choice; check them against the relevant sources.

未确认的信息Information not confirmed

  • 批处理 / 异步作业(videos、batches 等)的托管面细节与限制
  • 开源版与企业版的完整特性分界清单(只取到文档点到为止的条目)
  • 官方云托管版的数据驻留与留存政策
  • 合规认证与第三方审计报告
  • 数据库与缓存的最小部署要求(Helm / Terraform 之外的裸机口径)
  • Hosted details and limits of batch / asynchronous jobs (videos, batches and similar)
  • The full open-source versus Enterprise feature split (only the items the docs mention were verified)
  • Data residency and retention terms of the official hosted cloud
  • Compliance certifications and third-party audit reports
  • Minimum deployment requirements beyond Helm / Terraform (bare-metal sizing, cache needs)

它是自己部署的统一入口,治理面在密钥与预算上。

官方把它写成开源 AI 网关:一种 OpenAI 格式接住多家 provider, 再把「谁能调哪个模型、花多少钱、能碰哪些工具」变成可配置的对象。

它是自己部署的统一入口,治理面在密钥与预算上。

官方把它写成开源 AI 网关:一种 OpenAI 格式接住多家 provider, 再把「谁能调哪个模型、花多少钱、能碰哪些工具」变成可配置的对象。

适合与不适合When to use it, when not to

适合要把多模型接入收口、需要按 key / team / organization 分层授权,并坚持把密钥与日志留在自己环境里的团队。 不适合只要一个薄客户端 SDK 的场景,也不适合必须拿到厂商背书的托管护栏与合规承诺的团队—— 护栏在这里是「你挂进来的外部服务」,不是厂商担保。

中文生态China availability 国产 / 国内可直接用 / 备案状态 · 快照domestic / direct access / CAC filing · snapshot 2026-11-06

出品属地Origin
国外出品foreign-made BerriAI / LiteLLM 主体(PyPI 与官网当日在册);开源项目,无中国区特供版本的官方声明。BerriAI / LiteLLM (on the PyPI page and official site the same day); an open-source project with no official statement about a China-specific edition.
国内使用Direct access
大陆可直连direct OK 同日实测 docs.litellm.ai、www.litellm.ai 与 pypi.org 返回 200,安装路由可用;自建服务不依赖厂商区域,故「可用」指自托管路由,不指任何合规承诺。Same-day probes returned 200 for docs.litellm.ai, www.litellm.ai and pypi.org, so the install route works; self-hosting does not depend on vendor regions. "Usable" here means the self-hosted route, not any compliance claim.
备案状态CAC filing
备案未核验filing unknown:官方文档与官网未写中国大陆备案/登记信息;本次未检索监管公示名单,不做推断。The docs and site say nothing about mainland filing/registration; the public registry was not searched.

备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.

固定坐标系Fixed coordinate system

8 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.

模型与开放条件Model & openness

这是它的主轴之一:官方 providers 页在册「100+ LLM,一种 OpenAI 格式」,密钥自带(BYO key); 自托管端点也在这条线上(页内在册 Ollama、vLLM、Llamafile)。release notes 在册 provider 持续新增 (2026-11 条目含 Microsoft 365 Copilot、Azure PTU 容量等)。护栏判定不内置,由挂进来的外部 rail 完成。

This is one of its two main axes: the providers page records '100+ LLMs' behind one OpenAI-format API with bring-your-own keys, and self-hosted endpoints on the same page (Ollama, vLLM, Llamafile). Release notes record providers still being added (the 2026-11 entries include Microsoft 365 Copilot and Azure PTU capacity). No guardrail judgement is built in; it comes from external rails you attach.

运行位置Where it runs

自托管为主:simple-proxy 页在册 pip 安装后 litellm --config config.yaml 起服务,默认 4000 端口; deploy 页在册镜像 ghcr.io/berriai/litellm、Docker 运行示例、Helm / Terraform 与 Postgres 依赖、 健康检查 /health/readiness。首页在册另有托管云用法。生产需数据库这点在 simple-proxy 页明写。

Self-hosting first: the simple-proxy page records pip install then litellm --config config.yaml, default port 4000. The deploy page records the ghcr.io/berriai/litellm image, a docker run example, Helm / Terraform, a Postgres dependency and the /health/readiness check. The site also records a hosted cloud usage path. Production requiring a database is stated plainly on the simple-proxy page.

本地文件Local files

读的是你本机的 config.yaml(模型清单、密钥引用、guardrail 配置),密钥与路由定义都在你自己的环境; 花费与日志写进你自管的 Postgres。它不读你的业务代码工作区,文件面就是配置与数据落库两处。

It reads your own config.yaml (model list, key references, guardrail settings); keys and routing definitions stay in your environment, and spend and logs go into the Postgres you manage. It does not read your application source tree - the file surface is configuration plus where you persist data.

关机后的任务Tasks after shutdown

它是常驻网关进程,请求排队、重试与路由由服务侧处理;跨关机续跑取决于你怎么部署(Helm / VM)。 批处理与异步作业面(如 videos / batches)只在 release notes 里出现过,官方专页本档未逐条核验,记为未知。

It is a long-running gateway process: queueing, retries and routing happen service-side, and surviving a shutdown depends on how you deploy it (Helm or a VM). The batch and asynchronous job surface (videos / batches) has only appeared in release notes; dedicated pages were not verified item by item and are recorded as unknown.

工具与扩展Tools & extensions

官方 MCP 页在册它是「MCP Gateway」,提供「governed access to tools」:server 走 config.yaml 或 UI 配置, 传输支持 HTTP / SSE / stdio,鉴权含 OAuth、API key 与 AWS SigV4,访问按 key / team / organization 控制。 另外有 A2A、Auto Router、logging 与 OpenTelemetry 页在文档导航在册。

The MCP page records it acting as an 'MCP Gateway' offering 'governed access to tools': servers configured through config.yaml or the UI, transports HTTP / SSE / stdio, authentication via OAuth, API keys and AWS SigV4, with access scoped by key, team and organization. A2A, Auto Router, logging and OpenTelemetry pages sit in the documentation navigation.

上下文与记忆Context & memory

上下文由调用方透传,网关自身不做记忆或压缩。虚拟密钥、预算与团队是访问层的边界,不是上下文层; 上下文窗口实际大小由你路由到的模型决定。

Context passes through from the caller; the gateway itself keeps no memory and does no compression. Virtual keys, budgets and teams are access-layer boundaries, not context-layer ones, and the effective window is whatever the routed model gives you.

权限与限制Permissions & limits

访问控制是它的核心:virtual-keys 页在册密钥经 /key/generate 签发,可限模型、预算、速率与团队, 主密钥用于管理,定时轮换属企业版。guardrails 页在册多数护栏在开源侧可用, 动态参数与逐 key 护栏控制需企业版。数据流向取决于你接的 provider;SSO 与审计日志在企业版口径下(simple-proxy 页在册)。 合规认证与第三方审计未核验到官方在册页,记为未知。

Access control is its core: the virtual-keys page records keys minted through /key/generate, model, budget, rate-limit and team scoping, a master key for administration, and scheduled rotation as an Enterprise capability. The guardrails page records that most integrations run in the open-source build while dynamic parameters and per-key rail control need Enterprise. Data flow follows whichever providers you attach. SSO and audit logs sit in the Enterprise framing (simple-proxy page). Compliance certifications and third-party audits were not found on official pages and are recorded as unknown.

适合什么任务Best for

适合要把多家 provider 收成一个 OpenAI 兼容入口、同时按 key / team 做预算与访问治理、并坚持自托管的团队。 不适合只要一个薄 SDK 的场景,也不适合把「厂商背书的托管护栏 + 合规承诺」当必需项的团队。

Fits: teams collapsing many providers into one OpenAI-compatible entry point, governing spend and access per key or team, and insisting on self-hosting. Not a fit: anyone wanting only a thin client SDK, nor anyone for whom a vendor-backed hosted guardrail with compliance attestations is a requirement - rails here are external services you plug in, not a vendor guarantee.

头号误解Top misconception

  • 以为开源版就带 SSO 与审计日志:官方 simple-proxy 页把这些写在企业版口径里
  • 以为 MCP 工具接进来就安全:MCP 页在册的是按 key / team / org 的授权面,策略仍要自己配
  • 以为 100+ provider 等于都能挂护栏:护栏集成是另一份清单,逐 key 控制还要企业版

证据来源Evidence sources

最近核验记录Latest recorded check 2026-11-06,内容更新日content updated on 2026-11-06。单项复核范围见正文或来源说明,不代表所有字段在同一天重新核验。See the text or source notes for item-specific scope; this does not mean every field was rechecked on that date.

类型Type名称Name链接Link
docsLiteLLM · 文档首页(开源 AI 网关定位、100+ 模型、quickstart、变更记录入口,2026-11-06 直抓 200)LiteLLM · docs home (open-source AI gateway positioning, 100+ models, quickstart, release-notes entry, direct-fetched 200 on 2026-11-06)https://docs.litellm.ai/
docsLiteLLM · Providers(一种 OpenAI 格式接 100+ 模型与自托管端点,2026-11-06 直抓 200)LiteLLM · Providers (100+ models through one OpenAI format, self-hosted endpoints, direct-fetched 200 on 2026-11-06)https://docs.litellm.ai/docs/providers
docsLiteLLM · Run LiteLLM Proxy(pip 安装、--config、4000 端口、生产需数据库、企业版能力边界,2026-11-06 直抓 200)LiteLLM · Run LiteLLM Proxy (pip install, --config, port 4000, production database, Enterprise capability boundary, direct-fetched 200 on 2026-11-06)https://docs.litellm.ai/docs/simple_proxy
docsLiteLLM · Deploy(镜像、Docker / Helm / Terraform、Postgres、健康检查,2026-11-06 直抓 200)LiteLLM · Deploy (image, Docker / Helm / Terraform, Postgres, health check, direct-fetched 200 on 2026-11-06)https://docs.litellm.ai/docs/proxy/deploy
docsLiteLLM · Virtual keys(/key/generate、预算/速率/团队、轮换属企业版,2026-11-06 直抓 200)LiteLLM · Virtual keys (/key/generate, budgets / rate limits / teams, rotation as Enterprise, direct-fetched 200 on 2026-11-06)https://docs.litellm.ai/docs/proxy/virtual_keys
docsLiteLLM · Guardrails quick start(在册集成清单、config.yaml 字段、阻断与掩码、企业边界,2026-11-06 直抓 200)LiteLLM · Guardrails quick start (recorded integration list, config.yaml fields, block versus mask, Enterprise boundary, direct-fetched 200 on 2026-11-06)https://docs.litellm.ai/docs/proxy/guardrails/quick_start
docsLiteLLM · MCP(网关定位、传输与鉴权、按 key/team/org 授权,2026-11-06 直抓 200)LiteLLM · MCP (gateway positioning, transports and authentication, key / team / org authorisation, direct-fetched 200 on 2026-11-06)https://docs.litellm.ai/docs/mcp
changelogLiteLLM · Release notes(v1.108.0 等于 2026-11-04 的在册条目,2026-11-06 直抓 200)LiteLLM · Release notes (v1.108.0 entries dated 2026-11-04, direct-fetched 200 on 2026-11-06)https://docs.litellm.ai/release_notes
changelogLiteLLM · PyPI(MIT 许可、1.108.1 与 2026-11-05 发布日、Python 版本区间,2026-11-06 直抓 200)LiteLLM · PyPI (MIT licence, 1.108.1 dated 2026-11-05, Python range, direct-fetched 200 on 2026-11-06)https://pypi.org/project/litellm/
docsLiteLLM · 官网(开源网关与自托管/云两种用法、企业特性口径,2026-11-06 直抓 200)LiteLLM · official site (open-source gateway, self-host versus cloud, Enterprise feature framing, direct-fetched 200 on 2026-11-06)https://www.litellm.ai/

官方口径与未核到项Official record and unverified items

本站尚未完成实测。本档不含路由成功率、延迟、护栏拦截率或统计误差数字。

实测建议(三条):

  • 逐 key 花费统计在失败请求、批处理与推理配置文件场景下是否准确
  • 同一 MCP 工具在有 key / team / org 三层配置时的实际可见范围
  • 挂外部护栏后 pre_call 与 post_call 的延迟与阻断行为差异

This site has not completed measured runs; nothing here covers routing success rates, latency, guardrail block rates or accounting error.

Suggested measurements (three):

  • Whether per-key spend accounting stays accurate for failed requests, batches and Bedrock inference profiles
  • The real visibility of one MCP tool across key / team / organization layers
  • Latency and blocking behaviour of pre_call versus post_call rails

能力边界Capability boundaries

在册的治理对象是:模型访问、预算与速率、团队归属、MCP 工具的可见范围、外部护栏的挂载点。 不在册的:它不做内容安全模型的训练承诺,也不给「拦得准不准」的数字。 按 key 的护栏控制与动态参数被写在企业版口径里,开源版与企业版的边界要按官方页逐条核对。

What it governs is on record: model access, budgets and rate limits, team membership, which MCP tools a principal can see, and where external rails attach. What it does not claim: any training-use promise about content safety, or published numbers for how well anything blocks. Per-key rail control and dynamic parameters sit in the Enterprise framing, so the open-source / Enterprise split has to be checked line by line against the official pages.

变更记录说明Change record

变更记录有两条官方流水线:docs 站内 release_notes 页与 PyPI 发布记录。 当日在册:release notes 最新条目 v1.108.0(2026-11-04),PyPI 最新 1.108.1(2026-11-05)。 近期条目里能看到与安全相关的连续动作,例如 2026-10-24 更换镜像签名密钥并调整信任根, 以及多条修 spend logging 的记录——花费统计的正确性要靠实测确认,不能只看版本标题。

Two official streams carry change history: the release_notes page inside the docs and the PyPI release record. Recorded on the verification day: release notes latest v1.108.0 (2026-11-04), PyPI latest 1.108.1 (2026-11-05). Recent entries also show security-relevant actions, such as the 2026-10-24 image-signing key change and trust-bundle adjustment, plus repeated spend-logging fixes - spend accuracy needs measurement, not a changelog headline.

相关条目Related entries

  • NeMo GuardrailsNeMo Guardrails护栏本体在那边;这里决定在哪个入口、对哪些 key 调用它。Same line: NeMo Guardrails (in gateway and access control); this entry states only what its own official sources support.
  • Amazon Bedrock GuardrailsAmazon Bedrock Guardrails云内推理层的策略与数据保留模式,这里是可以把它当外部 rail 挂进来的入口层。Same line: Azure AI Content Safety (in gateway and access control); this entry states only what its own official sources support.
  • Azure AI Content SafetyAzure AI Content Safety判定能力在厂商侧,路由与预算治理在网关侧,两层互不替代。Same line: Amazon Bedrock Guardrails (in gateway and access control); this entry states only what its own official sources support.

本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0). 方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.