The Model Proxy Boundary

One stable endpoint for several backends

The LiteLLM module earlier in this track showed how a single Python library call can normalize requests across different model backends inside one application's own code. This module goes one step further, moving that same normalization into its own dedicated network service sitting in front of everything. A reverse proxy is a service that accepts client requests at one single, stable address, and forwards each one along to whichever actual backend service should handle it. A model proxy applies this pattern specifically to LLM traffic: it can expose one consistent, OpenAI-compatible chat-completion interface to every caller, while internally routing each request to Ollama, a hosted provider, or any number of other backend deployments, entirely transparently to the client.

The LiteLLM Proxy (a separate, standalone service from the LiteLLM Python library covered earlier) reads a configured model list that maps public-facing route names onto specific, real provider models and their base network addresses. An application can then call a stable, meaningful alias like local-primary, while the proxy's own routing configuration is what actually decides that alias currently means ollama/qwen2.5:0.5b - without any provider-specific detail ever needing to be hard-coded into the calling application itself.

model_list:
  - model_name: local-primary
    litellm_params:
      model: ollama/qwen2.5:0.5b
      api_base: http://127.0.0.1:11434
Analogy: A company's main switchboard keeps one single public phone number posted everywhere, while internally directing each incoming call to whichever team or extension should actually handle it that day. Callers never need to know, or keep track of, every individual employee's direct extension.
Scenario: A configured route points at a seven-billion-parameter model tag that was never actually included in this platform's offline image. Every single client request through that route fails outright - even though two smaller, fully approved models are already sitting right there, correctly installed and ready to serve, just under a different route name nobody pointed traffic toward.

A proxy sitting at this position in the architecture is also a natural security and observability boundary, not just a convenience. Authenticate every caller reaching it, cap both request size and processing time, record which route actually served each request along with its latency, and - echoing the earlier security-phase lessons in this track - never log authorization headers or full sensitive prompt content passing through it.