Component
core/gateway/litellm
An AI gateway that fronts several models behind one in-cluster, OpenAI-compatible endpoint, routing each request by the alias it asks for. Each model wired to its models socket is served under the connection's alias, with that connection's credential; values.models adds aliases typed by hand, presenting provider_key. No credential reaches the calling application. It publishes one alias as its model, so an agent's model socket takes it in place of a model. Because it holds those credentials, it forwards only the request fields the proxy declares for the route, and refuses the rest naming the field. It answers only its model routes, the model listing, its health checks and key management. Its other optional sockets take the Presidio analyzer and anonymizer, the vector-search store that core/semantic-caching keeps replies in, and the guard that core/prompt-injection-shield sends requests through; wiring one alone changes no request. On Kubernetes, reach for helm/litellm-gateway, the synthesis, where the build must fetch nothing, and helm/litellm-gateway-chart, BerriAI's chart, where its registry is reachable. On Docker Compose, compose/litellm-gateway runs it for local development, without the semantic cache. values.log_masking masks what it lists in the copies of a successful call the gateway hands to its logs, never in what the provider or the caller receives. It excludes core/data-masking. Attached, core/semantic-caching keeps end users apart only by the end user each request names, which the gateway does not verify, and core/period-budget, once spent, refuses the administrative key's model requests too.
Provenance
- Content digest
- sha256:2eec2baa709a6b97b2c3595976ecbbe2c831708a05bc63c6f0ebc0c50f7ed48e
- Published
- 2026-11-10T10:12:19Z
- Signing identity
- https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main
Signature
- Officialapplication/vnd.dev.sigstore.bundle.v0.3+json
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main
sha256:89df638cc9197596682999b461cc28e61efba0c6ec93c6be82e7270e5e2fb42d
Reference at this version
oci://hub.aggrega.ai/component/core/gateway/litellm:1.0.0Developer parameters
Values the developer sets in the Aggregate.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| models | array | — | no | The hand-typed part of the model map. Each entry publishes one alias and names the upstream target it resolves to, and presents provider_key as its credential. Optional; the gateway also serves every model wired to its models socket, and the build halts when neither gives it a model. |
| model | string | — | no | The alias of the model map published as this gateway's model, which a component wired to the gateway sends as the model name of its requests. It must be an alias the gateway serves, from values.models or from a connection on the models socket, and the build halts naming this value otherwise. It may be omitted only when the gateway serves one alias and an entry of values.models publishes it, which is then the one published; with several distinct aliases, or with no entry in values.models, the build halts without it. |
| log_masking | — | — | no | What to mask in the copies of each call the gateway hands to its logs, while the request it forwards and the reply it returns stay exactly as they were sent. List regular expressions under patterns, matched inside the gateway, and entity types under entities, found and replaced by the Presidio analyzer and anonymizer wired to the pii_analyzer and pii_anonymizer sockets, which listing any requires; a type the analyzer does not recognize in English halts the build, naming the ones it does. It masks each copy of a successful call the gateway hands to its logs, the request the spend logs keep and the reply each logging integration receives among them, on every call, and a caller cannot turn it off. A failed call carries no request text in any log the catalog renders: its text is withheld, matched or not, its error text leaves the gateway's own log with only its kind staying, and failed calls leave the spend logs and the daily spend totals, so beside core/audit-logging the request log keeps answered requests only. An integration configured outside the catalog can still receive a provider's own error message, and one registered ahead of the gateway's own failure callback a failed call's text as it came. Left unmasked: all the provider receives and the caller is answered; request metadata, tool definitions and headers; the gateway's debug output; and text nothing matches. A call whose copies cannot be masked, as when a recognizer cannot be reached, is still logged and counted, with every text in its copies replaced by [TEXT_WITHHELD]. Listing nothing masks nothing and adds nothing to the gateway. The build halts while it lists something and core/data-masking is attached to the gateway. |
| metrics_enabled | boolean | false | no | Has the gateway serve its own Prometheus metrics through its path allowlist on port 9090 of the Service its Recipe serves them on, where a GET of /metrics alone is forwarded, and publishes their address as `metrics_endpoint`; while false that key is empty. The port checks no caller, and the metrics name the hashed keys, key aliases and user emails the gateway attributes spend to, so anything that reaches the port reads them. |
Operator sizing
Infrastructure sizing the operator tunes per environment.
Extends LiteLLMGuardSchemas#/schemas/RequestGuardInfra
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| port | integer (min 1024, max 65535) | 4000 | no | Proxy port callers connect to. Most operators should omit this and let the Recipe assign the default (4000). |
| external_base_url | string | — | no | Externally reachable origin of the gateway, as assembled at the ingress tier — scheme, host and, where it is not the scheme's default, port, with no path; for example https://llm.example.com. The gateway composes from this the sign-in callback address it hands an identity provider, the address of its admin console it sends a browser to after sign-in, and the gateway address it writes into every alert it sends. The product documents this setting as an origin only, so the Recipe halts the build on an address carrying a path. Omitted, the gateway composes each of those addresses from the request that arrives, which is correct for a gateway nobody signs in to from outside the cluster. |
| engine_version | string | v1.103.1 | no | Gateway image tag. Selects the image tag of the proxy container on every Recipe. Each Recipe delivers code into the proxy that is proven only at the LiteLLM releases it lists, and halts the build on any other value, naming them. |
| source_version | string | — | no | Version of BerriAI's litellm-helm chart the chart-backed Recipe pulls, defaulting to the version that Recipe was checked against. The workload-synthesis Recipe pulls no chart and reads nothing here. |
| compute | object | — | no | — |
| overrides | object (open) | — | no | Provider-specific overrides. Accepts any nested structure. Each Recipe documents which keys it reads. |
Output contract
Values this component publishes to consumers over the uses topology.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| host | string | — | yes | In-cluster DNS name of the Service fronting the gateway. A consumer that composes its own address dials this name; one that does not reads `endpoint` instead. |
| port | integer | — | yes | TCP port that Service accepts caller traffic on. It follows the port an operator set in the Release, so a consumer reads it rather than assuming a default. |
| endpoint | string | — | yes | Full base URL of the OpenAI-compatible API the gateway serves, with the host, the port and the API path already composed. A caller hands it to a client library as its base URL and asks for an alias the model map publishes. |
| model | string | — | yes | The alias a consumer wired to the gateway sends as its model name: values.model, or the one alias the map publishes when that is omitted. Other aliases the map publishes are served at the same endpoint to a caller that names them itself. |
| protocol | string | — | no | URL scheme to reach `host` and `port` over, for a consumer composing its own address rather than reading `endpoint`. |
| metrics_endpoint | string | — | no | The full address Prometheus scrapes this component's metrics at — scheme, host, port and path, `http://<host>:9090/metrics`, the host being the name of the Service the Recipe serves them on. Empty while values.metrics_enabled is false. |
Uses sockets
The dependency sockets this component connects through. The target of every connection wired through a socket must satisfy its label selector, and each connection may carry an attachment in the slots the socket declares. A required slot is owed by each connection the Aggregate or the Release wires through the socket.
pii_analyzer
- Selector
- security.aggrega.ai/text-anonymization=analyzer
- Inject
- —
This socket declares no attachment slots, so a connection through it carries no attachment.
pii_anonymizer
- Selector
- security.aggrega.ai/text-anonymization=anonymizer
- Inject
- —
This socket declares no attachment slots, so a connection through it carries no attachment.
cache_store
- Selector
- datastore.aggrega.ai/engine=kv
- Inject
- —
Slots each connection through this socket may fill
| Slot | Selector | Required | Inject | Sensitive | Description |
|---|---|---|---|---|---|
| credential | feature.aggrega.ai/kind=secret | no | env | yes | Optional password the gateway's semantic cache presents to the store this connection reaches. When attached, the Recipe delivers it as REDIS_PASSWORD, referenced from the secret that holds it, and the cache reads it inside its connection URL, unencoded: a password carrying /, ?, # or %, or a tab or a line break, breaks that URL when the gateway starts, and nothing checks it at build, so use letters and digits. Attach a credential holding the password the store itself requires. Unattached, the cache connects without a password, which suits a store with none. |
| server_ca | feature.aggrega.ai/kind=secret | no | file | yes | Optional authority the gateway's semantic cache checks the store's certificate against while the store publishes protocol redis-tls, where the gateway does not already trust the authority that signs it. Its Secret holds ca.crt and sits in the gateway's namespace. The Recipe mounts the whole Secret read-only into the gateway and names its ca.crt in the cache's connection URL; the cache checks the certificate's chain against it and that the certificate names the store's published host, and, verifying strictly, refuses an authority certificate that carries no key usage extension; with a refused certificate every lookup is a miss and nothing is stored. The build halts on a server_ca publishing no Secret name, and on one wired to a store served without TLS. Fill it with core/referenced-secret. |
guard
- Selector
- dataplane.aggrega.ai/prompt-guard=classifier
- Inject
- —
This socket declares no attachment slots, so a connection through it carries no attachment.
models
- Selector
- component.aggrega.ai/category=ai-model
- Inject
- —
Slots each connection through this socket may fill
| Slot | Selector | Required | Inject | Sensitive | Description |
|---|---|---|---|---|---|
| credential | feature.aggrega.ai/kind=secret | no | env | yes | Optional credential the gateway presents to the model this connection reaches. When attached, the Recipe delivers it as LITELLM_MODEL_<ALIAS>_API_KEY, the connection's alias in capitals with every character other than a letter or a digit as an underscore, referenced from the secret that holds it, and the connection's entry in the routing table names that variable. Unattached, the entry presents no credential. |
Attachment slots
Named binding points at which a Feature attaches to this component. A slot's selector constrains which Feature may fill it and its inject list names how the Feature's material may be delivered. A required slot must be bound on every instance, by an attachment on the instance or at a scope above it, and a sensitive slot is declared to handle secret material. A Feature may also attach under a name no slot declares.
| Slot | Selector | Required | Inject | Sensitive | Description |
|---|---|---|---|---|---|
| api_key | feature.aggrega.ai/kind=secret | no | env | yes | Optional administrative key guarding the gateway's own API, which LiteLLM calls its master key. When attached, the Recipe delivers it as LITELLM_MASTER_KEY, the environment variable the proxy reads at startup, so callers and the management API must present it. Unlike a server that checks one key, the gateway also accepts the keys it issues through its key-management API and keeps in its bookkeeping database: with database_url attached a caller may present such a key instead, and with none the gateway accepts this key alone. Unattached, the gateway starts with no administrative key and treats every caller as an unprivileged internal user, which suits a development Release and not a shared one. |
| provider_key | feature.aggrega.ai/kind=secret | no | env | yes | Optional credential the gateway presents to the upstreams the hand-typed entries of values.models target. When attached, every such entry names the environment variable the Recipe delivers it under, so the gateway authenticates upstream and the calling application never holds the credential. A model wired to the models socket never presents it: its credential is the one its own connection carries. Unattached, a hand-typed entry presents no credential, so a request routed to an upstream that requires one fails at the provider. This one slot holds one credential for every hand-typed entry; upstreams that each need their own are wired to the models socket, one connection and one credential each, where their model API allows it. |
| database_url | feature.aggrega.ai/kind=secret | no | env | yes | Optional connection string for the gateway's own bookkeeping database, which backs key management, spend tracking and request logs. When attached, the Recipe delivers it as the environment variable the proxy reads at startup, referenced from the secret that holds it, so the gateway's Deployment carries the reference and never the string. The compiler never connects to the database. Unattached, the gateway runs stateless — it serves and routes normally, and the features that need persistence are simply inactive. |
Self-inject allowlist
env
Relationships
Typed edges to and from other published entities. A reference with no published target renders as a broken edge rather than a link.
Uses
- usesuses socket «pii_analyzer»
security.aggrega.ai/text-anonymization=analyzer
Declares no attachment slots.
- usesuses socket «pii_anonymizer»
security.aggrega.ai/text-anonymization=anonymizer
Declares no attachment slots.
- usesuses socket «cache_store»
datastore.aggrega.ai/engine=kv
Attachment slots: credential, server_ca
- usesuses socket «guard»
dataplane.aggrega.ai/prompt-guard=classifier
Declares no attachment slots.
- usesuses socket «models»
component.aggrega.ai/category=ai-model
Attachment slots: credential
core/ai-model/ai21 v1.0.0 →core/ai-model/anthropic v1.0.0 →core/ai-model/azure-managed v1.0.0 →core/ai-model/azure-openai v1.0.0 →core/ai-model/azure-openai-embedding v1.0.0 →core/ai-model/bedrock v1.0.0 →core/ai-model/bedrock-embedding v1.0.0 →core/ai-model/cohere v1.0.0 →core/ai-model/databricks v1.0.0 →core/ai-model/docker-model-runner v1.0.0 →core/ai-model/gemini v1.0.0 →core/ai-model/huggingface v1.0.0 →core/ai-model/litellm v1.0.0 →core/ai-model/mistral v1.0.0 →core/ai-model/nemoguard-content-safety v1.0.0 →core/ai-model/nvidia-api v1.0.0 →core/ai-model/nvidia-nim v1.0.0 →core/ai-model/nvidia-nim-operator v1.0.0 →core/ai-model/ollama v1.0.0 →core/ai-model/openai v1.0.0 →core/ai-model/openai-compatible v1.0.0 →core/ai-model/openai-embedding v1.0.0 →core/ai-model/replicate v1.0.0 →core/ai-model/sagemaker v1.0.0 →core/ai-model/tei v1.0.0 →core/ai-model/tgi v1.0.0 →core/ai-model/vertex-ai v1.0.0 →core/ai-model/vertex-ai-embedding v1.0.0 →core/ai-model/vllm v1.0.0 → - $refextends schema (infra)
LiteLLMGuardSchemas#/schemas/RequestGuardInfra
Used by
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «model»
uses socket «target_model»
uses socket «extraction_model»
uses socket «embedding_model»
uses socket «upstream»
uses socket «forward_target»
uses socket «scrape_target»
uses socket «store»
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
applies to
implements
implements
implements