←新闻详情

The New Stack更新于 10月21日 22:36

Respan 发布 Rust 开源 AI 网关,替代两年 LiteLLM 封装代码

Respan spent two years building on LiteLLM. One upgrade made it start over.

AI 导读

Respan 发布用 Rust 编写的开源 AI 网关,用一个精简内核加插件替代此前围绕 LiteLLM 构建的 10 万多行封装代码。转折点是 2026 年 1 月一次常规 LiteLLM 升级引发间歇性连接失败,回滚后原因仍未查明,此后团队不再直接升级 LiteLLM。新网关借鉴 Nginx 思路,把模型供应商、路由、MCP 工具、实时语音和安全控制拆为插件,Mistral 供应商插件仅 22 行代码;自定义插件需编译进网关二进制,且按注册顺序执行,缓存若排在安全检查之前可能绕过检查。网关目前仍为 pre-alpha,可从 GitHub 下载预构建二进制运行。

推荐理由

AI 评分 55

原文对比了 Respan 与 LiteLLM 两条 Rust 网关迁移路径,并指出编译式插件带来的供应链与顺序配置风险。

主题

标签

正文

当前显示原文,中文全文译文尚未就绪。

Respan released an open-source AI gateway written in Rust on Tuesday, after spending two years building more than 100,000 lines of wrapper code around LiteLLM.

The new gateway replaces that system with a small core and plugins that handle model providers, routing, MCP tools, realtime voice, and security controls.

A LiteLLM upgrade breaks

The breaking point came in January 2026, when a routine LiteLLM upgrade caused intermittent connection failures. Respan rolled back the update but never figured out the problem.

“We still haven’t figured out the cause,” the company said in its Hacker News launch post.

Since then, its engineers have stopped upgrading LiteLLM directly, instead pulling in upstream fixes one at a time.

A small plugin core

To avoid another maintenance headache, the company borrowed an idea from Nginx, keeping the gateway’s core small and moving features like routing, model providers, and security into plugins. Developers can build their own using the same interfaces, without having to change the underlying code.

Developers can build their own using the same interfaces, without having to change the underlying code.

Some of those integrations are surprisingly small. Respan says its Mistral provider takes just 22 lines of code, while quirks like Groq reporting token usage in a different field can be handled separately. This makes it easier when updating one provider while avoiding the need to change how the rest of the gateway works.

When a request comes in over HTTP or WebSocket, the gateway runs it through the plugins in order. They can decide which model handles it, change the response, make additional calls, or stop the request before it reaches a provider.

When both sides use the same format, the gateway can leave the original request and its provider-specific fields intact.

The gateway can also translate between protocols. An application built for OpenAI’s Realtime API, for example, can connect to Gemini Live without changes to the client, according to Respan, although some features may not carry over. When both sides use the same format, the gateway can leave the original request and its provider-specific fields intact.

Plugins you must compile

Custom plugins are compiled into the gateway, so adding one means maintaining the code and rebuilding the binary. There’s also a security concern. Plugins run inside the gateway process, where they can access model requests and other sensitive data.

Rust helps prevent memory-safety bugs, but it can’t protect against malicious dependencies, or flawed application logic, which is probably why the concern came up following the launch in a Hacker News discussion. One commenter questioned whether compiled crates should even be called plugins, arguing that they force developers to maintain a build pipeline and introduce supply-chain risks. Respan’s founder acknowledged the concern, pointing out that developers can at least inspect the source code they’re compiling.

Plugin order is important, too, which is why Respan processes plugins in the order they’re registered, and one can answer or reject a request before the others run. Put a cache ahead of a security check, for example, and a cached response could bypass that check entirely. Developers need to account for that when configuring the gateway.

LiteLLM’s slower Rust road

Respan isn’t alone in deciding that Rust belongs under an AI gateway. LiteLLM is porting its own gateway to Rust, but where Respan rebuilt from the core out, LiteLLM is moving one route at a time, with the Rust core switched off by default and any request it can’t yet handle falling back to the existing Python path, so turning it on can’t break something Python already served.

The company laid out the plan in June and has said its goal is a pure Rust server that runs every hot path, auth, and rate limiting included, which the current beta doesn’t reach yet.

Respan isn’t alone in deciding that Rust belongs under an AI gateway.

LiteLLM has also published benchmarks claiming its Rust gateway has about seven times less overhead and uses nine times less memory than Bifrost. But those numbers come from LiteLLM’s own tests, using a benchmark harness the company developed.

Respan’s gateway is still pre-alpha, although developers can download a prebuilt binary from GitHub and run it without the company’s paid platform. Custom plugins still require compiling their own build.

The post Respan spent two years building on LiteLLM. One upgrade made it start over. appeared first on The New Stack.

来源

The New Stack