LLM Rate Limiting & Traffic Management Service  ·  View 04 of 24  ·  Structure

Container Architecture (C4 Level 2)

The deployable units, which plane each belongs to, and the contracts between them.

Editable source SVG draw.io All views
Data plane — one per region
Data plane — one per region
Edge
Edge
Envoy Gateway
ext_authz · mTLS
Envoy Gateway...
Admission Controller
tier + queue
Admission Controller...
Decision services
Decision services
limiterd
Go · 60 pods
limiterd...
llm-gateway
Go · 30 pods
llm-gateway...
Coordination state
Coordination state
Valkey Cluster
16 shards · 3 AZ
Valkey Cluster...
Reservation Reaper
sweeps expiries
Reservation Reaper...
Control plane — global
Control plane — global
Policy
Policy
policy-api
Go · REST
policy-api...
PostgreSQL
Patroni · 3 nodes
PostgreSQL...
policy.v1
Kafka · compacted
policy.v1...
Administration
Administration
Admin Console
React SPA
Admin Console...
Policy-as-code
Git + Argo CD
Policy-as-code...
Usage plane — global
Usage plane — global
Ingest
Ingest
usage-collector
Go · batched
usage-collector...
usage.v1
Kafka · 24 parts
usage.v1...
Process & serve
Process & serve
Flink Aggregator
1 m / 1 h / 1 d
Flink Aggregator...
ClickHouse
usage + cost marts
ClickHouse...
Grafana
tenant dashboards
Grafana...
Keycloak
OIDC
Keycloak...
Vault / OpenBao
provider keys
Vault / OpenBao...
LLM Providers
four upstreams
LLM Providers...
Check gRPC
Check gRPC
EVALSHA
EVALSHA
HTTPS
HTTPS
usage event
usage event
outbox relay
outbox relay
policy push
policy push
key lease
key lease
Container Architecture (C4 Level 2)
Container Architecture (C4 Level 2)
Interface / broker
Interface / broker
Application we own
Application we own
Data store
Data store
Queue / topic
Queue / topic
Security / platform
Security / platform
External / third party
External / third party
synchronous
synchronous
event / async
event / async
Only edges that carry a contract are drawn. Health probes, metric scrapes and trace exports are omitted — view 20 has them.
Only edges that carry a contract are drawn. Health probes, metric scrapes and trace exports are omitted — view 20 has them.
v 1.0 · owner Data & AI Global Practice
v 1.0 · owner Data & AI Global Practice
Text is not SVG - cannot display

Decisions

  • Three planes with different failure domains: data plane is regional and must survive alone; control plane is global and may be read-only for hours; usage plane is global and may lag by minutes.
  • limiterd and llm-gateway are separate deployables even though they are always co-deployed. They scale on different signals — decisions per second versus concurrent upstream connections — and llm-gateway holds long-lived streaming connections that must not force a limiter restart.
  • The Reservation Reaper is its own workload rather than a goroutine inside limiterd, so a rolling restart of the decision fleet cannot leave orphaned holds unswept.

Contracts

  • Envoy → limiterd: Envoy ext_authz v3 gRPC, 5 ms deadline, fail-open configured at the filter for HIGH-tier routes only.
  • limiterd → Valkey: EVALSHA against pinned script SHAs, 3 ms timeout, one retry to a replica.
  • policy.v1 is log-compacted, so a restarting pod replays only the current policy set and reaches steady state in about 1.2 s at 5,000 organisations.

Assumptions

  • 60 limiterd pods per region at the 100k/s target, from a measured 18k decisions per second per 4-vCPU pod.
  • Valkey runs as 16 primary shards with one replica each, spread across three availability zones.
  • Health probes, metric scrapes and trace exports exist on every container but are omitted here — view 20 covers them.