How It Works
Zilla's LLM Gateway is built from three llm bindings, layered on top of the http bindings.
Binding Pipeline


| Binding | Role |
|---|---|
tcp · server, http · server | Accept the application's connection and decode each HTTP request |
llm · server | Resolves which API the request uses, checks its content type and API key, and validates its body |
llm · proxy | Picks a client by the request's API and model, applies guardrails, and falls back to another model when needed |
llm · client | Builds the request to one provider, in that provider's API, and translates the reply back |
sys:http_client | Connects to the provider over HTTP, or over TLS when the server URL is https:// |
The llm bindings sit on top of http the same way the mcp bindings do in the MCP Gateway: http handles the wire format, and llm works on the decoded request and reply.
Request Flow
- The application sends a request, such as
POST /v1/chat/completions, tohttp · server. llm · serverresolves the request's dialect, the API it is written in:openaioranthropic.llm · serverchecks the request's content type and, whenoptions.authorizationis set, passes its API key to a guard. A request that fails either check is rejected with415or401, in the error format of its dialect.llm · servervalidates the request body and reads themodelit asks for.llm · proxyfollows the first route whosedialectandmodelconditions match. See Model Routing.llm · proxyapplies the request guardrails configured for that model. A rejected request never reaches the provider. See LLM Guardrails.llm · clientbuilds the request to its provider from itsserverURL and its own dialect, translating the request when the two dialects differ, and adds the API key to the header its provider expects. See LLM Credentials.- If the provider can't be reached at all,
llm · proxytries the route's fallback models in order. See Fallback. llm · clienttranslates the reply to the request's dialect,llm · proxyapplies the reply guardrails, and the application receives the reply, or the provider's error, in the format it sent the request in.
Each llm binding records the llm.* metrics for the exchange when its telemetry.metrics includes them.
What Each Binding Sees
llm · server is the only binding that reads the request's HTTP headers and path. It passes on the request with the dialect and model it resolved.
llm · proxy routes on those two values. It reads the request and reply content only to apply the guardrails configured for the model.
llm · client builds the upstream request from its own configuration. The upstream path comes from the server URL and the client's dialect, not from the path the application called.
Streaming
A request that asks for a stream, with "stream": true in the body, receives its reply as Server-Sent Events (text/event-stream). A request without it receives a single JSON reply.
Streaming works across translation: each event is translated into the request's dialect as it arrives.
Next Steps
- Unified API: the APIs Zilla accepts and how it recognizes them.
- Dialect Translation: what changes when the application and the provider use different APIs.
- Model Routing: how
llm · proxypicks a provider.

