Governing Enterprise AI Traffic at Scale: Design and Operation of a Policy-Driven, Multi-Vendor LLM Gateway on Envoy
作者: Mithun Sasidharan, Srinivasan Manoharan, Rupesh Thakur, Abhinav TK, Ashwin Hegde, Anand Gautam
分类: cs.DC, cs.AI, cs.SE
发布日期: 2026-10-26
备注: 17 pages, 6 figures, 6 tables. Industry case study
💡 一句话要点
提出Cosmos LLM网关以解决企业AI流量治理问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 流量治理 多供应商管理 Rust WebAssembly 声明式政策
📋 核心要点
- 现有方法面临凭证管理混乱、格式锁定和支出失控等挑战,影响企业对多供应商LLM的有效使用。
- 提出Cosmos LLM网关,通过外部处理服务和Rust WebAssembly过滤器分离控制决策与数据处理,提升治理效率。
- 该网关在高并发情况下仅增加4毫秒的延迟,服务超过12,000名开发者,处理2000亿个令牌,展现出极高的可用性。
📝 摘要(中文)
大型组织同时使用多个供应商的大型语言模型(LLM),每个供应商都有其独特的API方言、凭证模型、流媒体协议和定价。这种异构性导致凭证管理混乱、格式锁定、支出失控和治理不一致。本文介绍了Cosmos LLM网关的设计与生产运营,这是PayPal企业LLM流量的治理入口。该网关基于Envoy构建,通过延迟配置分离工作,采用外部处理服务进行I/O绑定控制决策,同时在代理中使用Rust WebAssembly过滤器进行线格式转换和令牌计量。治理通过Open Policy Agent进行声明式政策评估,并通过控制平面进行管理。该网关目前服务超过12,000名开发者,每天处理约2000亿个令牌,具有99.999%的可用性。
🔬 方法详解
问题定义:本文旨在解决大型企业在使用多个供应商的LLM时面临的治理和管理挑战,包括凭证管理混乱和支出失控等问题。现有方法未能有效整合不同API和治理策略,导致效率低下。
核心思路:论文提出的Cosmos LLM网关通过将控制决策与数据处理分离,利用外部处理服务和Rust WebAssembly过滤器,优化了流量治理和响应时间。这样的设计确保了在处理高并发请求时,数据流的延迟最小化。
技术框架:整体架构包括外部处理服务和Envoy代理,外部服务负责身份验证、凭证管理和政策评估,而在代理中进行线格式转换和令牌计量。治理策略通过Open Policy Agent进行声明式管理,确保灵活性和可控性。
关键创新:最重要的创新在于将控制逻辑与数据处理分离,使得流量治理更加高效,并且通过声明式政策管理提升了治理的一致性和透明度。这与传统的集成方法形成鲜明对比。
关键设计:关键设计包括使用Rust WebAssembly进行高效的流处理,采用声明式政策管理,支持角色范围的授权和版本化政策包,确保治理的灵活性和可追溯性。
📊 实验亮点
实验结果显示,Cosmos LLM网关在处理超过2200个请求每秒的情况下,仅增加了4毫秒的中位延迟和11毫秒的p99延迟,展现出极高的性能和可用性,满足了企业级应用的需求。
🎯 应用场景
该研究的潜在应用领域包括金融服务、电子商务和其他需要高效管理多供应商AI模型的行业。通过提供一个统一的治理入口,企业能够更好地控制成本、提升效率,并确保合规性,未来可能推动更多行业的数字化转型。
📄 摘要(原文)
Large organizations consume large language models (LLMs) from several vendors at once, each with its own API dialect, credential model, streaming protocol and pricing. Integrated directly, this heterogeneity yields credential sprawl, format lock-in, unbounded spend and inconsistent governance. We present the design and production operation of the Cosmos LLM Gateway, the governed entry point for enterprise LLM traffic at PayPal. Built on Envoy, it splits work by latency profile: I/O-bound control decisions (authentication, credential brokering, policy and budget evaluation) run in an out-of-process external-processing service, while wire-format translation, token metering and prompt-cache shaping run in-proxy as a Rust WebAssembly filter, so that, by default, streamed response body chunks never wait on an out-of-process call. Models, providers and prices are largely validated data rather than code. Governance is declarative policy evaluated by Open Policy Agent and managed through a control plane with role-scoped authoring, approvals, pilots, shadow-mode rollout, usage notifications and versioned policy bundles. For use cases that require it, a data-loss-prevention layer can block, redact or pseudonymize detected sensitive content before it reaches a provider. Spend scopes are views over per-model usage counters, so a new budget applies to spend already recorded in its window without migration. As of September 2026, the gateway serves more than 12,000 developers and hundreds of business use cases, handling roughly 200 billion tokens per day across more than 100 models at 99.999% availability to business. In a benchmark of the core request path against a synthetic upstream, it adds a median of 4 ms and a p99 of 11 ms of overhead at more than 2,200 requests per second on two 4-vCPU instances. We report the architecture, policy model, evaluation and lessons learned.