Trang này được dịch bằng máy. Đọc bản gốc tiếng Anh.

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.

Nguồn gốc

Chính thứcĐược ký bởi một danh tính ký mà danh mục này công nhận là nhà phát hành chính thức.
Digest nội dung
sha256:2eec2baa709a6b97b2c3595976ecbbe2c831708a05bc63c6f0ebc0c50f7ed48e
Đã xuất bản
2026-11-10T10:12:19Z
Danh tính ký
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

Chữ ký

  • Chính thứcapplication/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

Tham chiếu ở phiên bản này

oci://hub.aggrega.ai/component/core/gateway/litellm:1.0.0

Tham số của nhà phát triển

Các giá trị mà nhà phát triển đặt trong Aggregate.

TênKiểuMặc địnhBắt buộcMô tả
modelsarray—khôngThe 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.
modelstring—khôngThe 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——khôngWhat 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_enabledbooleanfalsekhôngHas 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.

Định cỡ của người vận hành

Định cỡ hạ tầng mà người vận hành tinh chỉnh theo từng môi trường.

Mở rộng LiteLLMGuardSchemas#/schemas/RequestGuardInfra

TênKiểuMặc địnhBắt buộcMô tả
portinteger (min 1024, max 65535)4000khôngProxy port callers connect to. Most operators should omit this and let the Recipe assign the default (4000).
external_base_urlstring—khôngExternally 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_versionstringv1.103.1khôngGateway 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_versionstring—khôngVersion 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.
computeobject—không—
overridesobject (open)—khôngProvider-specific overrides. Accepts any nested structure. Each Recipe documents which keys it reads.

Hợp đồng đầu ra

Các giá trị mà thành phần này xuất bản cho bên tiêu thụ qua cấu trúc liên kết uses.

TênKiểuMặc địnhBắt buộcMô tả
hoststring—có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.
portinteger—có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.
endpointstring—có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.
modelstring—có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.
protocolstring—khôngURL scheme to reach `host` and `port` over, for a consumer composing its own address rather than reading `endpoint`.
metrics_endpointstring—khôngThe 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.

Các socket uses

Các socket phụ thuộc mà thành phần này kết nối qua. Đích của mọi kết nối được nối qua một socket phải thỏa mãn bộ chọn nhãn của socket đó, và mỗi kết nối có thể mang theo phần đính kèm trong các slot mà socket khai báo. Một slot bắt buộc phải được đáp ứng bởi mỗi kết nối mà Aggregate hoặc Release nối qua socket.

pii_analyzer

Bộ chọn
security.aggrega.ai/text-anonymization=analyzer
Tiêm
—

Socket này không khai báo slot đính kèm nào, nên một kết nối qua nó không mang theo phần đính kèm nào.

pii_anonymizer

Bộ chọn
security.aggrega.ai/text-anonymization=anonymizer
Tiêm
—

Socket này không khai báo slot đính kèm nào, nên một kết nối qua nó không mang theo phần đính kèm nào.

cache_store

Bộ chọn
datastore.aggrega.ai/engine=kv
Tiêm
—

Các slot mà mỗi kết nối qua socket này có thể lấp đầy

SlotBộ chọnBắt buộcTiêmNhạy cảmMô tả
credentialfeature.aggrega.ai/kind=secretkhôngenvcó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_cafeature.aggrega.ai/kind=secretkhôngfilecó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

Bộ chọn
dataplane.aggrega.ai/prompt-guard=classifier
Tiêm
—

Socket này không khai báo slot đính kèm nào, nên một kết nối qua nó không mang theo phần đính kèm nào.

models

Bộ chọn
component.aggrega.ai/category=ai-model
Tiêm
—

Các slot mà mỗi kết nối qua socket này có thể lấp đầy

SlotBộ chọnBắt buộcTiêmNhạy cảmMô tả
credentialfeature.aggrega.ai/kind=secretkhôngenvcó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.

Slot đính kèm

Các điểm liên kết có tên mà tại đó một Feature được gắn vào thành phần này. Bộ chọn của một slot giới hạn Feature nào có thể lấp đầy nó, và danh sách tiêm của slot nêu cách nội dung của Feature có thể được chuyển giao. Một slot bắt buộc phải được liên kết trên mọi thể hiện, bằng một phần đính kèm trên thể hiện đó hoặc ở một phạm vi phía trên nó, và một slot nhạy cảm được khai báo để xử lý nội dung bí mật. Một Feature cũng có thể được gắn dưới một tên mà không slot nào khai báo.

SlotBộ chọnBắt buộcTiêmNhạy cảmMô tả
api_keyfeature.aggrega.ai/kind=secretkhôngenvcó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_keyfeature.aggrega.ai/kind=secretkhôngenvcó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_urlfeature.aggrega.ai/kind=secretkhôngenvcó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.

Danh sách cho phép tự tiêm

env

Quan hệ

Các cạnh có kiểu đi tới và đi từ các thực thể đã xuất bản khác. Một tham chiếu không có đích đã xuất bản được hiển thị là một cạnh bị đứt thay vì một liên kết.

Sử dụng

Được sử dụng bởi

Tài liệu tham khảo khái niệm Component →

Danh mục Aggrega — chỉ mục mở gồm các thành phần, tính năng, công thức và các plugin kết xuất chúng.

Được xây dựng bằng hệ thống thiết kế dùng chung của Aggrega.

Quyền riêng tư