Skip to main content

Architecture

A self-hosted AI Gateway runs in a private data plane that you manage and connects to Agent Control Plane in the cloud. You manage LLM service providers, MCP servers, and policies centrally, while LLM and MCP traffic, runtime execution, and upstream connectivity stay within your own environment.

Agent Control Plane​

Agent Control Plane is hosted by Choreo Labs. You use it to register gateways, deploy LLM service providers and MCP servers, and manage policies.

The gateway opens an outbound WebSocket connection to Agent Control Plane over port 443, using the registration token you configured. The gateway receives deployment and policy updates over this connection. Because the connection starts in your network, you do not need to expose the gateway's management services to the public internet.

Private Data Plane​

The private data plane runs in your infrastructure. It handles agent traffic, applies runtime policies, and communicates with upstream LLM providers and MCP servers. Requests from agents are processed entirely within this environment.

The gateway has two components.

Gateway Controller​

The Gateway Controller receives deployments and policy configuration from Agent Control Plane and configures the Gateway Runtime accordingly. It contains the following services.

ServiceDescription
Controller REST APIExposes the management API used by the control plane and internal gateway components.
Controller xDSProvides runtime configuration to the router and policy distribution to the policy engine.
DatabaseStores gateway configuration and runtime metadata.

Gateway Runtime​

The Gateway Runtime handles traffic. It includes the router and the policy engine.

The router receives HTTP and HTTPS requests and routes them to the relevant LLM provider or MCP server. During request and response processing, the router calls the policy engine to run the configured policies, such as authentication, rate limiting, and guardrails.

Default Ports​

PortComponentTypeDescription
8080Gateway Runtime (router)ExternalHTTP ingress for agent traffic.
8443Gateway Runtime (router)ExternalHTTPS ingress for agent traffic.
9901Gateway Runtime (router)InternalEnvoy admin console.
9002Gateway Runtime (policy engine)InternalPolicy engine admin API.
9003Gateway Runtime (policy engine)InternalPolicy engine metrics. Listens after you enable metrics. See Monitor Gateway Metrics.
9090Gateway ControllerInternalController REST API.
9094Gateway ControllerInternalController admin and debug API.
9011Gateway ControllerInternalController metrics, the host port for container port 9091. Listens after you enable metrics.
18000Gateway ControllerInternalController xDS, which configures the router. Not published to the host.
18001Gateway ControllerInternalPolicy xDS, which configures the policy engine. Not published to the host.

Only the ingress ports need to be reachable by agents. Keep the internal ports private. The Docker Compose file publishes the controller, admin, metrics, and Envoy ports on all host interfaces by default, so restrict them as described in Production Hardening.

Configuration Flow​

When you deploy or change an LLM service provider, an MCP server, or a policy in Agent Control Plane, the configuration reaches the Gateway Controller over the outbound WebSocket connection.

The Gateway Controller stores the configuration and converts it into runtime configuration. Controller xDS then configures the router and the policy engine. Once configured, the Gateway Runtime serves traffic according to the routes and policies you defined.

Runtime Traffic Flow​

Agents send requests to the Gateway Runtime through the HTTP or HTTPS ingress ports.

The router identifies the matching route and applies the configured policy chain through the policy engine. After the policies succeed, the router forwards the request to the LLM provider or MCP server. The response follows the same path back, so response policies apply before the response reaches the agent.

Key Benefits​

This architecture keeps runtime execution close to your upstream services and limits the exposure of internal systems. You apply consistent policies across all LLM service providers and MCP servers from one place.

To keep serving traffic when a controller or runtime replica is unavailable, run more than one of each. See High Availability.

Was this page helpful?