
一个自托管的多提供商LLM API网关,具备协议转换、流式传输、速率限制、MCP集成和Vue 3管理仪表盘。
概览
每个LLM都有一个网关。任何客户端协议进出,任何提供商出——配备智能路由、成本控制和完整的管理控制台。 LLM 代理是一个自托管的 LLM API 网关。将你现有的 OpenAI 或 Anthropic SDK 指向它,即可即时访问所有配置好的供应商——配备自动故障切换、成本导向路由、按密钥预算、请求日志以及管理仪表盘,无需重启即可管理所有内容。 - — 你的应用使用一种协议(OpenAI 或 Anthropic);代理对每个上游协议进行双向转换。切换供应商时,只需更改模型名称,而不是代码。- — 基于优先级的提供者备份,带有断路器,当某个供应商失败或有速率限制时,会自动重试。- — 虚拟模型自动/快速/最佳分类每个请求,并选择成本和质量合适的真实模型。
概述(AI 翻译)
每个大型语言模型都配备一个网关。任何客户端协议进出,任何提供商都出——配备智能路由、成本控制和完整的管理控制台。
LLM 代理是一个自托管的 LLM API 网关。将你现有的 OpenAI 或 Anthropic SDK 指向它,即可即时访问所有配置好的供应商——配备自动故障切换、成本导向路由、按密钥预算、请求日志以及管理仪表盘,无需重启即可管理所有内容。
文献资料
完整文档:
| 入门 | 安装,首次运行设置,连接客户端,核心概念 |
| 部署 | Docker Compose、PostgreSQL 和 Redis、反向代理、升级与备份 |
| 管理控制台 | 提供商、型号与定价、API密钥、用户、MCP、每个服务器设置 |
| API 参考 | 认证、端点、流式传输、工具与网页搜索、路由、错误 |
| 指南 | 成本控制、监控与警报、安全加固 |
| 参考文献 | 环境变量,常见问题解答 |
为什么选择LLM代理?
- 写一次,运行任意供应商 — 你的应用使用一种协议(OpenAI 或 Anthropic);代理会双向转换到每个上游。切换提供者时,可以通过更改模型名称,而不是你的代码。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
LLM Proxy
A self-hosted gateway for LLM APIs. Clients send OpenAI, Anthropic, or Cohere-compatible requests; the proxy forwards each one to a configured provider and translates the response back.
LLM Proxy sits between your application and the model providers you pay for. Point an OpenAI or Anthropic SDK at the proxy, or a Cohere SDK at the rerank endpoint, and the proxy sends the request to whichever upstream serves the requested model. Supported providers include OpenAI, Anthropic, Gemini, OpenRouter, Ollama, vLLM, SGLang, and any OpenAI-compatible endpoint. Fallback, per-key budgets, request logs, and the admin console are built in. Configuration lives in the database and is applied without a restart.
Contents
- How it works
- Why LLM Proxy
- What it supports
- Quick start
- Use it from code
- Configuration
- Operations
- Documentation
- More screenshots
- Development
- Contributing
- Security
- License
How it works
Client LLM Proxy Upstream
OpenAI / Anthropic / ──▶ parse to InternalRequest provider API
Cohere rerank wire route: mapping, allowlists, budgets, ──▶ (built-in
retries, fallback, circuit breaker adapters)
◀── translate back to the client's protocol
The proxy parses each client request into an internal request model. A protocol serializer handles the client side, and a provider serializer builds the upstream body. A request can arrive as OpenAI Chat Completions and leave as Anthropic Messages, or be forwarded unchanged when both sides use the same protocol.
Why LLM Proxy
- Clients keep their existing SDK and change only the base URL. Model names are defined in the proxy, so one name can point to any upstream model.
- Failed requests retry on the same provider and then fall back to the next mapping. A circuit breaker skips providers that keep failing.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →