Skip to main content
LiteLLM is an open-source proxy that gives your team a single endpoint for multiple LLM providers. You can point it at Consus Gateway so all requests route through government-authorized infrastructure. For LiteLLM setup and deployment instructions, see the LiteLLM docs.

Authentication

Consus Gateway authenticates via the x-api-key header. LiteLLM’s built-in API key field is required but ignored by Consus Gateway. Your Consus API key must be passed via extra_headers.

Run with Docker Compose

This walkthrough gets LiteLLM Proxy running locally — with a Postgres database for virtual keys and spend tracking — routing every request through Consus Gateway. The only provider credential you need is your Consus API key.

Step 1 — Get the Docker Compose file

Download LiteLLM’s official docker-compose.yml into an empty directory:
This starts three services: the LiteLLM proxy, a Postgres database, and Prometheus.

Step 2 — Add your Consus API key

Create a .env file next to docker-compose.yml. The first command uses > to create the file; the rest use >> to append:
Unlike a standard LiteLLM setup, you do not need Azure, OpenAI, or any other provider keys — Consus Gateway brokers every model behind your single CONSUS_API_KEY.

Step 3 — Create your config.yaml

Create a config.yaml next to docker-compose.yml and paste the full model list below. Every entry already points api_base at https://api.consus.io/v1 and passes your key via extra_headers: x-api-key: os.environ/CONSUS_API_KEY, so there’s nothing else to edit.
For the full list of available models and compliance levels, see the Model Explorer.

Step 4 — Enable the config mount

By default, LiteLLM’s docker-compose.yml ships with the config file commented out. This sed uncomments the volumes and command lines under the litellm service in place, so your config.yaml is loaded (it leaves a docker-compose.yml.bak backup you can delete):
The compose file also mounts a prometheus.yml, so create a minimal one (it must exist before you start, or the stack won’t come up):

Step 5 — Start the proxy

With docker-compose.yml, .env, config.yaml, and prometheus.yml all in the same directory, start everything:
Once the logs settle, send a test request through the proxy to a Consus model:
The Authorization: Bearer sk-1234 here is your LiteLLM master key (from .env), not your Consus key — LiteLLM injects CONSUS_API_KEY upstream via the extra_headers in your config.

Optional — Open the UI and create a virtual key

Visit http://localhost:4000/ui and log in with your master key (sk-1234). Under Virtual Keys → + Create New Key, you can mint scoped keys with per-key RPM limits and model access — all spend is tracked in the Postgres container that Compose already started.

Configure via the UI

  1. Go to Models + Endpoints and click Add Model
  2. Set Provider to OpenAI-Compatible Endpoints (Together AI, etc.)
  3. Set LiteLLM Model Name to openai/<model>:<compliance-level> (e.g. openai/gpt-4.1:il5+itar)
  4. Set API Base to https://api.consus.io/v1
  5. Set OpenAI API Key to any value (required by LiteLLM, ignored by Consus)
  6. Under Advanced Settings, set LiteLLM Params to:
  7. Click Add Model
Do not use the Custom OpenAI provider. It prepends openai/ to the model name sent to Consus Gateway, causing a 400 error. Use OpenAI-Compatible Endpoints instead.