LLM Gateway
An optional proxy Industric deploys into your own cluster. It fronts your provider keys, mints short-lived scoped virtual keys for agent runs, and meters every request against spend budgets.
An LLM gateway proxies model requests and enforces configured budgets and rate limits on routed traffic. By default, an agent run reads a provider key from its model provider. When enabled, Industric deploys a gateway into your connected cluster and syncs provider keys to it.
Each routed agent run receives a short-lived virtual key. Every request flows through the gateway, which meters token spend, enforces per-agent and per-user budgets, and reports usage back to Industric.
The gateway is optional and off by default. A deployment can host multiple gateways, each with its own name, namespace, synced providers, budgets, and access list. Agents opt in individually: an agent that names no gateway keeps using master provider keys directly.
What it does
- Isolates credentials. Your master provider keys are synced into the gateway and only used for proxied traffic. Agents receive a scoped virtual key over which you have full control.
- Meters and caps spend. The gateway prices every request and folds the cost into per-key, per-agent, and per-user counters, enforcing the budgets and rate limits you set.
- Reports usage. Spend, request, and token totals stream back to Industric for a per-gateway analytics view.
Create a gateway
Open a deployment's Gateways tab (you must have the gateways:write permission). Two things must already be in place: a connected deployment to host the gateway, and at least one model provider whose keys it will front.
- Click Create gateway and give it a name. The name doubles as the in-cluster resource name; the namespace defaults to
default. - Industric automatically provisions it on the target operator cluster and syncs in any providers you select.
Route agents
An agent is routed through a gateway by naming it in its resource's spec.gateway — that reference is the only routing mechanism. When you create an agent in the dashboard, the deployment's default gateway is pre-selected; pick another gateway, or None to keep direct provider keys.
Set the gateway reference on an agent:
1spec:2 gateway:3 name: team-a-gateway4 namespace: default # optional; defaults to the agent's namespaceRemoving the reference reverts the agent to direct provider keys. The agent's current gateway is shown on its detail page.
Sync provider keys
The gateway can only front providers whose keys it holds, and syncing is opt-in per provider. On the gateway's Overview tab, each model provider has a Sync action that mirrors its key into the gateway as an upstream credential. Nothing is synced until you choose it, so a provider can exist in Industric without ever reaching a gateway.
- Sync pushes the key and, from then on, keeps it in step: editing a synced provider re-syncs it automatically.
- Unsync removes the key and its link from that gateway. Any virtual key pinned to it stops working.
- Deleting a provider removes it from every gateway it was synced to.
Virtual keys
Every request through the gateway carries a virtual key. There are two kinds.
- Session keys are minted automatically for agent runs. They have no fixed expiration date; instead they expire at the end of a session.
- User keys are minted manually from the Virtual Keys tab. A key must name a user and pin exactly one synced provider. You can give it a budget and an expiry, or leave it open-ended.
Any key can be revoked from the Virtual Keys tab; the workload holding it loses model access immediately.
A key pinned to a provider or a model allowlist rejects anything outside that scope. Hence, a request that names no model, an unlisted model, or a provider that's gone all fail immediately.
Budgets and rate limits
Rules on the Limits tab bound what runs can spend and how fast they can call. Each rule targets a scope — agent or user — and names one or more targets, or * for all of them. A rule that names a target explicitly overrides the wildcard.
| Field | What it bounds |
|---|---|
session budget | USD cap applied to each minted key as its own spend ceiling. |
total budget | USD cap across all of the scope's keys until it resets. |
resets | How the total budget rolls over: never, daily, weekly, or monthly. |
requests / min | Per-minute request ceiling. |
tokens / min | Per-minute token ceiling (charged as responses complete). |
Cost is priced from a model catalogue. A custom, private, model still works and still counts tokens, but accrues $0, so USD budgets do not constrain it. Use a token-per-minute limit if you need a ceiling on an unpriced model or add the pricing in the CRD.
Usage and analytics
The Analytics tab charts spend, requests, or tokens over a 7-, 30-, or 90-day window, filterable by agent and user.
Industric stores usage per gateway. The history survives removal and recreation of a gateway with the same name and namespace.
Example gateway manifest
The Gateway can be automatically provisioned through Industric or you can manually deploy it on your cluster using the CRD. This example defines a gateway and its configuration:
1apiVersion: autonomic.sh/v1alpha12kind: LLMGateway3metadata:4 name: team-a-gateway5 namespace: default6spec:7 replicas: 18 resources:9 requests: { cpu: 200m, memory: 256Mi }10 service:11 type: ClusterIP12 port: 400013 # Optional: reference the ConfigMaps holding your rules and prices.14 budgets: { name: team-a-gateway-budgets, key: rules }15 pricing: { name: team-a-gateway-pricing, key: pricing }16---17apiVersion: v118kind: ConfigMap19metadata:20 name: team-a-gateway-budgets21 namespace: default22data:23 rules: |24 - scope: agent # cap every agent25 targets: ["*"]26 total_budget_usd: 10027 resets: monthly28 requests_per_minute: 6029 - scope: agent # a tighter, specific rule wins over the "*"30 targets: [billing-bot]31 session_budget_usd: 532 total_budget_usd: 25033 resets: weekly34 tokens_per_minute: 10000035 - scope: user36 targets: ["*"]37 total_budget_usd: 5038 resets: monthly39---40apiVersion: v141kind: ConfigMap42metadata:43 name: team-a-gateway-pricing44 namespace: default45data:46 pricing: |47 claude-sonnet-5: { input_per_mtok: 3, output_per_mtok: 15 }48 gpt-4o: { input_per_mtok: 2.5, output_per_mtok: 10 }Remove a gateway
Remove gateway on the Overview tab tears the instance down: live keys are revoked and the synced upstream credentials are deleted from the cluster. Agents routed through it revert to master provider keys on their next run. You can recreate a gateway at any time.