展示HN:UnifyRoute – 自托管的OpenAI兼容LLM网关,支持故障转移
嗨,HN,
我创建了UnifyRoute,因为我不断遇到同样的问题:速率限制、配额耗尽和服务提供商的故障在最糟糕的时刻破坏了我的基于大型语言模型(LLM)的应用程序。
UnifyRoute是一个自托管的网关,位于您的LLM提供商(如OpenAI、Anthropic等)前面,自动处理路由、故障转移和配额管理——并且提供完全兼容OpenAI的API,因此您无需更改现有代码的任何一行。
它的功能包括:
- 即插即用的OpenAI兼容API(/chat/completions、/models等)
- 基于层级的路由:定义尝试哪些提供商及其顺序
- 当提供商失败或达到配额时自动故障转移
- Web仪表板用于管理提供商、凭证和使用情况
- 自托管——您的API密钥永远不会离开您的基础设施
- 适用于任何支持OpenAI API的工具(LangChain、LlamaIndex等)
快速开始(Docker):
```
git clone https://github.com/unifyroute/UnifyRoute.git
cd UnifyRoute && cp sample.env .env
./unifyroute setup && ./unifyroute start
# 仪表板地址 http://localhost:6565
```
它是基于Apache 2.0的开源项目。
欢迎提问关于架构或设计决策的问题。
[https://github.com/unifyroute/UnifyRoute](https://github.com/unifyroute/UnifyRoute)
查看原文
Hey HN,<p>I built UnifyRoute because I kept running into the same problem:
rate limits, quota exhaustion, and provider outages were breaking
my LLM-powered apps at the worst times.<p>UnifyRoute is a self-hosted gateway that sits in front of your LLM
providers (OpenAI, Anthropic, etc.) and handles routing, failover,
and quota management automatically — with a fully OpenAI-compatible
API, so you don't change a single line of your existing code.<p>What it does:
- Drop-in OpenAI-compatible API (/chat/completions, /models, etc.)
- Tier-based routing: define which providers to try and in what order
- Automatic failover when a provider fails or hits quota
- Web dashboard to manage providers, credentials, and usage
- Self-hosted — your API keys never leave your infrastructure
- Works with any tool that supports OpenAI's API (LangChain,
LlamaIndex, etc.)<p>Quick start (Docker):
git clone <a href="https://github.com/unifyroute/UnifyRoute.git" rel="nofollow">https://github.com/unifyroute/UnifyRoute.git</a>
cd UnifyRoute && cp sample.env .env
./unifyroute setup && ./unifyroute start
# Dashboard at http://localhost:6565<p>It's open source under Apache 2.0.<p>Happy to answer questions about the architecture or design decisions.<p><a href="https://github.com/unifyroute/UnifyRoute" rel="nofollow">https://github.com/unifyroute/UnifyRoute</a>