agent-router

theagentrouterApache-2.0活跃维护

基于 Envoy Gateway 构建的生成式 AI 统一接入网关,把各家 LLM 和推理服务的调用收敛到一套路由与鉴权入口,方便在 Kubernetes 上统一管理。

Manages Unified Access to Generative AI Services built on Envoy Gateway

v1.2.1发布于 2026-11-06 16:24 UTC2,381star +14 / 7 天461fork同步于 2026-11-10 17:46 UTC

怎么上手

由 README 提炼,执行前请确认
OPENAI_API_KEY=sk-your-key aigw run
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 Envoy 的统一 AI 流量控制面,为所有模型和工具提供一致的 OpenAI 兼容 API

基于 Envoy Gateway 构建的生成式 AI 统一接入网关,把各家 LLM 和推理服务的调用收敛到一套路由与鉴权入口,方便在 Kubernetes 上统一管理。

核心能力

  • 提供 OpenAI 兼容的统一 API 接入各家模型与 MCP 服务器
  • 用 Envoy Gateway 集中管理凭证、路由、配额、故障转移与用量归属
  • 支持两级网关模式,一级做认证与全局限流,二级精细控制自托管模型
  • 内置对 OpenAI、Anthropic、Gemini、Bedrock 等二十余家提供商的支持
  • 保留原 Envoy AI Gateway 的 CRD、CLI 与镜像,迁移无需改动清单

容易踩的坑

需先安装 aigw CLI 才能运行单机模式;单机模式默认监听 http://localhost:1975/v1;部署到 Kubernetes 需额外安装 Envoy Gateway

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.2.1
  1. v1.2.1最新正式版2026-11-06 · 2026-11-06 16:24 UTC

    Agent Router v1.2.1

    Agent Router v1.2.1 is a security and stability patch for the v1.2 series. It tightens MCP session handling and makes the external processor tolerate malformed upstream responses. It also keeps MCP session encryption seeds out of Pod specs and logs, and moves to Go 1.27.2 for standard library CVE fixes. Upgrading rolls Gateway pods that serve MCPRoutes once. An MCP session ID now works only on the MCPRoute that created it. Envoy Gateway stays at v1.9.2, with Envoy Proxy v1.39.1 and Gateway API v1.6.1.

    🐛 Bug Fixes

    • MCP proxy listens on loopback only — The MCP proxy in the external processor sidecar now binds to 127.0.0.1:9856 instead of every interface, so only the Envoy proxy in the same pod can reach it. The controller rolls existing Gateway pods whose sidecar still listens on all interfaces. aigw run no longer exposes the port on the host network.
    • MCP sessions are bound to their MCPRoute — A session ID is now accepted only on requests routed through the MCPRoute that created it, so that route's security policy always applies to its sessions. Reusing a session ID on a different MCPRoute returns 400; the client must initialize a new session.
    • promptSelector is enforced on prompts/get and completions — Prompts filtered out of prompts/list by a backend's promptSelector could still be fetched by name. prompts/get and completion/complete with a prompt reference now return 400 for those prompts, matching how toolSelector already applied to tools/call.
    • MCP session encryption seeds stay out of Pod specs — The controller used to pass the MCP session encryption seeds to the external processor as command-line arguments, where anyone who could read Gateway Pods could see them. It now delivers them in the filter config Secret, so changing a seed no longer rolls the Gateway pods. The controller reads the seeds from the MCP_SESSION_ENCRYPTION_SEED and MCP_FALLBACK_SESSION_ENCRYPTION_SEED environment variables. The Helm chart stores controller.mcp.sessionEncryption.fallback.seed in its own Secret, and restarts the controller on every helm upgrade while a fallback seed is set so that a seed rotation takes effect.
    • Malformed upstream responses no longer crash the external processor — A 2xx response with missing or null fields could panic the external processor. This covered Anthropic messages without usage on Anthropic, AWS, and GCP backends, null image generation or Gemini bodies, and null Bedrock Converse content blocks. Such responses are now handled as empty responses or responses without usage. OpenInference tracing of Anthropic responses without usage and of null rerank results no longer panics either.
    • More credential headers redacted in debug logs — Debug logs now redact the api-key (Azure API key) and x-amz-security-token (AWS session token) headers, in addition to authorization and x-api-key. Header mutations in immediate (locally generated) responses are redacted too.
    • OAuth metadata fetch is size-limited — When resolving an MCPRoute's OAuth authorization server metadata, the controller reads at most 1 MiB of each response. Larger documents are skipped and the next well-known URL is tried.
    • Controller replicas no longer restart on a fresh install — With controller.replicaCount of 2 or more, replicas that started together raced to patch the admission webhook's caBundle, and the losers exited with a conflict error. The update is now retried, and a replica that finds the bundle already in place does nothing.
    • Go 1.27.2 — Built with Go 1.27.2, which includes standard library CVE fixes.

    📖 Upgrade Guidance

    v1.2.1 has no API changes and no new breaking changes. Upgrade from v1.2.0 by upgrading both charts:

    helm upgrade -i aieg-crd oci://docker.io/envoyproxy/ai-gateway-crds-helm \
      --version v1.2.1 \
      --namespace envoy-ai-gateway-system
    
    helm upgrade -i aieg oci://docker.io/envoyp
    
  2. v1.2.1-rc2pre-release2026-10-28 · 2026-10-28 17:43 UTC
    查看更新说明

    Release candidate

  3. v1.2.1-rc1pre-release2026-10-26 · 2026-10-26 14:57 UTC
    查看更新说明

    Release candidate

  4. v1.2.02026-10-07 · 2026-10-07 11:58 UTC
    查看更新说明

    Agent Router v1.2.0

    The full rendered version lives at https://theagentrouter.ai/release-notes/v1.2.

    Agent Router v1.2.0 is the first release under the project's new name (formerly Envoy AI Gateway). Nothing you deploy is renamed: the aigateway.envoyproxy.io API group, the CRDs, the Helm charts, the container images, and the aigw CLI all stay the same. This release hardens MCP authentication and cross-namespace references. It adds bare tool names, caller-supplied credentials, and policy merging to MCPRoute, plus two new backend schemas (AWSOpenAI and TypeSafe). It also moves to Envoy Gateway v1.9.2, Gateway API v1.6, and Gateway API Inference Extension v1.6. Several security fixes change behavior, so read the breaking changes before you upgrade.

    ✨ New Features

    Agent Router

    • Same project, new name — Envoy AI Gateway is now Agent Router, an Agentic AI Foundation project with the same code, maintainers, and Apache 2.0 license. The website moved to theagentrouter.ai and the repository to theagentrouter/agent-router; old links redirect. Your manifests, Helm values, and automation keep working unchanged.

    MCP Gateway

    • Bare tool and prompt names with prefixMode: Never — Clients that hardcode tool names, such as interactive MCP Apps, no longer have to see the <backend>__ prefix. Set prefixMode: Never on the route or on individual backendRefs. A Never-mode backend must list its tools in toolSelector.include, and the controller marks the route NotAccepted if two Never-mode backends expose the same name. Prompts are exposed bare only when they are listed in the new promptSelector.include. Resources always keep the prefix. The default is still Always.
    • Caller-supplied credentials with injectionPolicy: IfNotPresent — Let users bring their own upstream token, for example a personal GitHub PAT forwarded with forwardHeaders, and fall back to a shared service key when they don't. With IfNotPresent, the configured API key is injected only when the target header is missing. This applies to header injection only.
    • Inherit Gateway-level policies with mergeType — The SecurityPolicy and BackendTrafficPolicy that Agent Router generates for an MCPRoute used to replace any Gateway- or listener-level policy. Set securityPolicy.mergeType or backendTrafficPolicy.mergeType to StrategicMerge or JSONMerge to keep a Gateway-wide rate limit or ext-auth policy in force alongside MCP OAuth.
    • OAuth for identity providers with non-standard metadata paths — oauth.authorizationServerMetadataUrl points the controller at the exact RFC 8414 metadata document when the issuer URL doesn't lead to it. The controller fetches this document while reconciling, so it needs network access to the identity provider. If the fetch fails, reconciliation fails.
    • Groundwork for the next MCP spec — The initialize response now negotiates the protocol version with the client and backends instead of always answering 2025-06-18. Merged list responses also carry ttlMs and cacheScope caching hints. Support for the stateless 2026-07-28 MCP specification is in progress and not yet enabled.

    Providers & API Compatibility

    • AWS OpenAI-compatible endpoint (AWSOpenAI) — Send OpenAI-format /v1/chat/completions and /v1/responses requests to Bedrock Runtime's OpenAI-compatible /openai/v1 endpoint without a translation hop. Requests are signed with SigV4 through an AWS BackendSecurityPolicy. The prefix defaults to openai/v1. Other endpoints return 422.
    • TypeSafe System One (TypeSafe) — Route TypeSafe's Jev decision model through the gateway at /typesafe/v1/systemone with API-key auth. Request bodies pass through unchanged apart from a model name override, and token usage feeds the standard metrics and llmRequestCosts. Streaming is not supported.
    • **Per-backend anthropic-beta filt
  5. v1.2.0-rc1pre-release2026-10-06 · 2026-10-06 08:40 UTC
    查看更新说明

    Release candidate

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Agent Router

    Agent Router gives application teams one consistent, OpenAI-compatible API for every model and tool, from hosted providers to self-hosted inference and MCP servers. Platform teams keep credentials, routing, quotas, failover, and usage attribution in one place, enforced by Envoy and Envoy Gateway.

    Agent Router controls. Envoy carries.

    Formerly Envoy AI Gateway

    Envoy AI Gateway is now Agent Router, an Agentic AI Foundation project. Same code, same maintainers, same release cadence and Apache 2.0 license. Nothing you deploy is renamed:

    • CRDs and API group are unchanged: AIGatewayRoute, AIServiceBackend, BackendSecurityPolicy, and the aigateway.envoyproxy.io API group stay as they are.
    • The CLI is still aigw, and the envoy-ai-gateway-system namespace is unchanged.
    • Container images, Helm charts, and the Go module path are unchanged (docker.io/envoyproxy/ai-gateway-*, github.com/envoyproxy/ai-gateway).
    • The repository moved to theagentrouter/agent-router; old envoyproxy/ai-gateway links redirect.
    • The website moved to theagentrouter.ai; every aigateway.envoyproxy.io link redirects to the same page.

    Your manifests from yesterday apply tomorrow.

    Quick start

    Run Agent Router as a standalone, OpenAI-compatible router on your laptop with one command:

    OPENAI_API_KEY=sk-your-key aigw run
    

    Then point any OpenAI-compatible client at http://localhost:1975/v1. See the CLI guide for installation and provider auto-configuration, or the Getting Started guide to deploy on Kubernetes with Envoy Gateway.

    Usage

    When using Agent Router, we refer to a two-tier gateway pattern. The Tier One Gateway functions as a centralized entry point, and the Tier Two Gateway handles ingress traffic to a self-hosted model serving cluster.

    • The Tier One Gateway handles authentication, top-level routing, and global rate limiting.
    • The Tier Two Gateway provides fine-grained control over self-hosted model access, with endpoint picker support for LLM inference optimization.

    Supported AI Providers

    Agent Router supports a wide range of AI providers, making it easy to integrate with your preferred LLM services:

    Documentation

    Contact

    • Chat: join the Agent Router Discord to ask questions and collaborate with the community.
    • Weekly meeting: the maintainers and community meet every Monday. Register, add agenda points, and get involved via the public meeting document.

    Get Involved

    We follow the LF Projects Code of Conduct, as an Agentic AI Foundation project.

    To contribute to the project via pull requests, please read the CONTRIBUTING.md file which includes information on how to build and test the project.

    Background

    The proposal of using Envoy Gateway as a Cloud Native LLM Gateway inspired the initiation of this project.


    Agent Router is an Agentic AI Foundation project, powered by Envoy. Copyright © Agent Router a Series of LF Projects, LLC. For web site terms of use, trademark policy and other project policies please see https://lfprojects.org.