Running LiteLLM in an air-gapped or egress-restricted network

Operating a self-hosted LiteLLM gateway where it cannot reach the internet: what must be bundled or mirrored, which features need outbound access and how to verify the setup.

On this page

Running LiteLLM in an air-gapped network starts with knowing what calls out

A security or platform team running LiteLLM in a network with no or restricted egress must first list every moment the software reaches outside its boundary, then decide which of those moments can be removed, replaced or approved. LiteLLM is both a Python SDK and an AI gateway (proxy server) that calls more than 100 LLM providers, including OpenAI, Anthropic, Gemini, Bedrock and Azure, and its proxy is MIT licensed outside the enterprise/ directory. The license is not the hard part of an isolated deployment. The hard part is that the gateway can call out at four distinct points: at startup, at image pull, at the Enterprise license check and at runtime, and each one needs its own answer.

Start with the startup path. By default LiteLLM fetches its model cost map from GitHub when it starts, so a proxy with no route to GitHub will depend on how that fetch fails. Setting LITELLM_LOCAL_MODEL_COST_MAP=True tells the proxy to use the cost map bundled with the package, which LiteLLM suggests for egress restrictions. Test this in a network namespace or egress-blocked staging cluster before production, and confirm the bundled map is current enough for your spend reporting. Next, trace image pulls. The gateway, its PostgreSQL and Redis dependencies and any sidecars must come from a private registry you control, and every image should be verified before it crosses the boundary.

Then map the runtime and license paths. Model traffic is expected to leave only toward model backends you have approved, so each provider route should be listed with its destination address. Confirm the Enterprise license check mode if you use Enterprise features: LiteLLM's compliance material describes both a license server and an offline check against a signed payload, and you should ask the vendor which mode fits your environment and how renewals are delivered. Finally, confirm that self-hosted LiteLLM runs no telemetry, as LiteLLM's data security documentation describes, and verify this with your own egress logs rather than relying on the statement alone.

Configuration options for restricted networks and when each fits

This table compares the four configuration choices that decide whether a LiteLLM gateway can start, validate and serve traffic without open internet access. Read each row against your egress policy to see which settings you need, which are optional, and what to confirm with LiteLLM or your own environment before the build starts.

OptionWhen it appliesTrade-offWhat to confirm
LITELLM_LOCAL_MODEL_COST_MAP=TrueGateway pods cannot reach GitHub at startup to fetch the model cost mapCost data comes from the copy bundled with the installed package, so it can lag provider price changes until you upgradeConfirm the bundled map version matches your pinned release and set a process to refresh it on upgrade
Default GitHub fetch of the cost mapEgress allows outbound HTTPS to GitHub from the gateway networkCost map stays current without an image upgrade, but startup depends on an external hostConfirm the allowlist rule, and whether your proxy or firewall logs blocked startup calls
Offline Enterprise license validationEnterprise edition runs where the gateway cannot call the LiteLLM license serverAn offline check against a signed payload avoids outbound calls, but it depends on the license terms you holdAsk LiteLLM which offline validation option your contract covers and how renewals are delivered
Online Enterprise license validationGateway can reach the LiteLLM license server through a controlled egress pathSimplest to operate, but adds an outbound dependency that security teams will reviewConfirm the exact host, protocol and proxy settings the license check uses
Private image registry mirroringCluster nodes or ECS hosts can pull only from internal registriesEvery LiteLLM image, database and Redis image, and sidecar must be copied in, and each upgrade repeats the copyConfirm the image digests you mirror, and verify signatures before they enter the internal registry
Self-hosted model backend (vLLM or Ollama)Prompts must stay inside the boundary and no external model provider is reachableKeeps inference local, but model weights, GPU capacity and serving upgrades become your responsibilityConfirm model files are transferred offline, and that the vLLM or Ollama endpoint is registered as a route in LiteLLM
Outbound access for provider modelsGateway routes requests to hosted providers such as OpenAI, Anthropic or AzureRequires a permitted egress path per provider endpoint, often through a proxy with its own allowlistAsk each provider for its endpoint hostnames and confirm they match your firewall rules

Setup sequence for an offline LiteLLM gateway

This sequence takes a LiteLLM gateway from an internet-connected build to one that runs inside a restricted network, with every outbound dependency identified, mirrored or replaced, and checked before users depend on it. Each step names the output that proves it is complete.

  1. Inventory every outbound dependency

    Before changing anything, list every destination the gateway, its database, its cache and its model routes will contact. Include the container registry, the package source for any custom build, the model cost map fetch from GitHub at startup, the Enterprise license check if you use Enterprise, SSO identity providers, secret managers, observability endpoints and each model provider. Record for each one whether it will be mirrored, replaced with an internal equivalent or blocked. Confirm the list with the platform owner and the network team. Done means a signed-off table in which every row has a disposition and an owner, and nothing is marked as unknown.

  2. Mirror the image and its dependencies internally

    Copy the LiteLLM image version you have chosen, along with the PostgreSQL, Redis and any sidecar images, into your private registry, and pull them from there in the build pipeline. Confirm the chosen version is on a supported minor line by checking the LiteLLM releases page and its support policy, since the supported lines are the ones you should mirror. Verify image digests against the source and record them in your change record so the mirrored copy is the one you deploy. Done means every image the manifests reference resolves from the internal registry, and a test pod pulls each of them with egress to public registries blocked.

  3. Set the local model cost map flag

    Set LITELLM_LOCAL_MODEL_COST_MAP=True in the gateway environment so the proxy reads the model cost map bundled with the package instead of fetching it from GitHub at startup. This is the setting LiteLLM suggests for egress restrictions. Note that the bundled map reflects the package release, so pricing for newer models may lag. Plan a periodic update through your normal image release process rather than a live fetch. Done means the startup log shows the gateway loading the bundled map and no connection attempt to GitHub appears in your egress logs during a restart.

  4. Configure the Enterprise license path if applicable

    Skip this step if you run only the open-source code. If you run Enterprise features, confirm with your LiteLLM account contact how the license is validated in your environment. LiteLLM documents two methods: a check against its license server, which needs outbound access, or an offline check against a signed payload. Ask which method suits your network and what the signed payload update process looks like. Install the license through your secret management process and confirm the gateway reports the expected license state. Done means the gateway starts with the license recognized and the license check produces no outbound request if you chose the offline method.

  5. Point model routes at internal backends

    Update the model list so each route points at an endpoint you can reach from inside the network, such as a self-hosted inference server, an internal gateway to a provider, or a private cloud endpoint reachable over a controlled path. Where you serve models yourself, check each backend's offline documentation, for example the vLLM online serving docs, and confirm it runs without fetching assets or model files at request time. Remove or disable routes to public providers that the restricted network cannot reach, so failover does not stall on blocked connections. Done means a test request on every route returns a response from an internal endpoint and each disabled route is absent from the configuration.

  6. Confirm the database and cache stay internal

    Point DATABASE_URL and any Redis settings at internal PostgreSQL and Redis services, and confirm the gateway can reach them only on the paths you have approved. Redis 7.0 or newer is required once more than one proxy instance runs, so check the version you deploy against that minimum. Store the master key, which must begin with sk-, in your internal secret manager and not in the image. Done means the gateway passes its health check with database and cache connected, and a connection test from a non-approved network segment fails.

  7. Verify with egress-denied tests and a startup log review

    Deploy into a segment where outbound internet access is denied at the firewall and the DNS resolver cannot resolve public names. Send test requests through the virtual keys to each internal route and confirm success, then confirm that any attempt to reach a public provider fails in the expected way. Review the startup log for references to external fetches, license checks or telemetry, and capture a packet or flow log for the first startup and one request cycle. LiteLLM states that self-hosted deployments run no telemetry, so an unexpected outbound call is a finding to investigate. Done means the logs show only internal destinations, every test passes, and the results are filed with the change record.

How traffic and mirrored artifacts move across the isolated boundary

The diagram starts with client applications sending requests to the LiteLLM proxy inside the internal network. The proxy calls PostgreSQL for keys, budgets and spend, Redis for shared rate limits and router state, and internal model backends you serve yourself. Only approved provider endpoints sit beyond the egress boundary, and every such path should be allowed explicitly. Container images, the model cost map and packages enter through the artifact import path into a private registry. Check that each arrow beyond the boundary matches a documented outbound need.

Request paths inside the network, the single egress gate, and the artifact import path.

Security controls for an isolated LiteLLM gateway

An isolated gateway is only as trustworthy as what crosses into it and what can still leave it. The cards below cover the controls that matter most at the boundary: verifying what you import, protecting the keys that govern the proxy, restricting its network paths, and auditing the egress you did not plan for.

Verify packages and images before import

Every container image, Python package and cost map file carried across the boundary should be checked against a published checksum or signature before it is loaded. Keep a record of what was imported, from which source and by whom. NERC CIP-013-2 is one example of this expectation in the energy sector, where vendor software and patches must be verified for integrity and authenticity. Confirm with your LiteLLM release notes which image digests and packages each target version uses.

Latest listed release
v1.105.1
LiteLLM releases

Keep the master key in a secret manager

LITELLM_MASTER_KEY must start with sk- and grants full administrative control of the gateway, so it should never sit in a values file or image layer. Store it in a secret manager that is reachable from inside the isolated network, and rotate it through a documented procedure. Confirm which secret manager integrations your edition supports, since Enterprise adds several beyond the open-source options.

Production guide

Restrict virtual key scope and admin access

Virtual keys carry budgets, rate limits and model restrictions, so issuing a broad key to a service is a control decision, not a convenience. Limit admin UI access to a named operator group, and confirm how SSO and admin roles are assigned in your environment. Review which keys can reach which models after every change.

Virtual keys docs

Apply network policy to the proxy

Only the callers that need the gateway should reach its port, and the gateway should reach only the database, Redis and model backends it is designed to use. In Kubernetes, express this as NetworkPolicy objects that deny by default and allow named sources and destinations. Test the policy from both sides, since a policy that looks correct on paper can still permit unplanned paths.

Audit remaining egress paths

Even after the cost map is bundled and images are pre-pulled, something may still try to call out, such as a telemetry hook, a DNS lookup, a package manager or a license check path. Capture outbound connections during a full test run and compare them to an approved list. Confirm with your edition's documentation which features need outbound access, and disable or document each one.

LiteLLM settings

Monitor the boundary for drift

Controls degrade when nobody checks them. Record the image digests and configuration hashes deployed, and alert when a running pod differs from the approved set. Review the egress audit after each upgrade, because a new release can add an outbound call that the previous version did not make.

Which features still need outbound access

Several LiteLLM features need a reachable endpoint, and each one must either be routed through an approved internal path or switched off before the gateway goes live. SSO with an external identity provider is the most common case. The admin UI supports Google, Microsoft Entra ID, Okta and generic OIDC providers, so the gateway must reach the identity provider's discovery and token endpoints. If your provider sits inside the network, point the OIDC settings at that internal address and confirm the certificate chain is trusted by the gateway. Otherwise, plan for local accounts with strict admin controls.

Other features reach out in the same way. External guardrail services, cloud secret managers (AWS, Azure, Google, HashiCorp Vault, CyberArk), hosted provider APIs and external logging destinations each open a connection from the gateway. Build an inventory that lists every callback, guardrail, secret source and log sink enabled in your configuration, and mark each one as internal, proxied through an approved path, or disabled. Pay particular attention to the license check and any callback that sends request content elsewhere, since that is where data can leave the boundary without anyone noticing.

Confirm each feature against the LiteLLM documentation for the exact release you run, because endpoints, default callbacks and settings change between versions. Use the LiteLLM docs: All settings page as the starting point, then test from inside the isolated segment: block egress at the firewall, start the gateway, exercise each enabled feature, and record every connection attempt that fails. Any failure you did not expect means a dependency you have not documented yet.

Limits to confirm before you commit to an offline design

An offline LiteLLM gateway depends on decisions made outside your network: which release line you pin, what your contract lets the Enterprise license do without outbound access, and how often the vendor refreshes the files you must carry in. Check these before you size the project, because each one changes what you mirror, how you upgrade and who answers when something breaks.

Version support window

LiteLLM maintains support for the four most recent stable minor versions for both open source and Enterprise deployments. In an isolated network, every upgrade is a transfer job, so you need to plan when each minor version will leave support and how long the carry-in cycle takes. Ask the vendor which minor versions are current at the start of the project and when the next one is expected to fall out of support.

Supported minor versions
4
LiteLLM Enterprise docs

Confirm the current release

Pin the release you build against by checking the LiteLLM releases page on the day you start, not the version in an older runbook. The most recent release listed is v1.105.1, published October 14, 2026. Record the exact tag, image digest and package version in your bill of materials so the mirrored artifacts can be verified against the same release later.

LiteLLM releases

Offline license behavior

Enterprise license checks use either the LiteLLM license server or an offline check against a signed payload. Which one applies depends on your contract and the terms of your Enterprise license, so do not assume it from the documentation alone. Ask the vendor in writing how the check runs in your environment, how license renewals are delivered into an isolated network, and what happens if the signed payload expires before a renewal arrives.

LiteLLM compliance page

Cost map and image update cadence

The bundled model cost map is only as current as the package version that carries it, so pricing data in an offline gateway ages between releases. Ask the vendor how often the cost map and container images are updated, which channel carries security patches, and how much notice you get before a change. Plan a recurring intake process that pulls these updates across the boundary and scans them before they reach production.

Feature list against your contract

Several gateway features, including SSO beyond the free user limit, SCIM, audit logs, IP allowlisting and external secret managers, sit in the Enterprise tier. Some vendor support options, such as response targets, depend on the agreement you sign. Build a list of the features you need, map each one to an edition and to the outbound calls it makes, and confirm that list with the vendor before procurement closes.

LiteLLM Enterprise docs

Questions buyers ask about air-gapped LiteLLM

What makes an air-gapped LiteLLM deployment take more or less effort?

The main drivers are the number of model providers you connect, whether you use SSO, which secret manager holds your keys, and whether guardrails call external services. Each provider adds routes, credentials and cost settings to test. SSO and secret manager integrations need reachable identity and vault endpoints inside the boundary. Guardrails that call outside services need either an internal replacement or an explicit exception. Self-hosted model backends remove most provider work but add capacity planning and model file transfer. Ask any partner to list each integration and mark whether it needs outbound access, an internal endpoint or a replacement before quoting.

Who does the mirroring and import of images, packages and model data?

In most engagements, the team that owns the boundary performs the transfer, because it controls the approved media, the scanning steps and the import into the private registry. A partner can design the transfer procedure, build the bundle list, and run the first import with your team watching. Container images for LiteLLM, PostgreSQL, Redis and any Kubernetes components need copies in a private registry. The LiteLLM cost map can be bundled with the package by setting LITELLM_LOCAL_MODEL_COST_MAP=True, so no GitHub fetch is needed at startup. Agree in writing who signs off each transfer and who keeps the record.

Can our own platform team run an air-gapped LiteLLM gateway without outside help?

Yes, if your team already runs Kubernetes or containers, PostgreSQL and Redis inside a restricted network, and can maintain an internal image registry. The harder parts are not the install itself but the ongoing work: moving each new release through the boundary, keeping the release line supported, and handling provider or model updates that normally arrive over the internet. Teams often start with an outside review of the design, then run the upgrades internally. Check whether your staff have done an offline transfer before, and whether the process needs a second approver for each package.

How long does an air-gapped LiteLLM project usually take?

Duration depends on how many providers and integrations are in scope, how fast your change approvals and media transfers move, and whether the Kubernetes, database and Redis layers already exist. No duration is fixed here. A written scope should list each integration, each transfer path, the acceptance tests, and the approvals that gate production. Ask for milestones tied to those items rather than a single end date, and ask which steps depend on your team's availability, such as access to the isolated network and approval of imported packages.

What evidence should we request from a partner or from our own team?

Ask for a bill of materials listing every image, package and model file imported, with versions and checksums, and a record of how each was verified before entering the boundary. Request the configuration showing LITELLM_LOCAL_MODEL_COST_MAP=True and a list of any remaining outbound destinations, with the reason each is needed. For the Enterprise license, confirm whether the check runs against the license server or an offline signed payload, and where that happens. Ask for test results showing that the gateway starts, routes to internal backends and writes logs with no egress. Also request the network diagram and the change record for each import.

Which LiteLLM features still need outbound access in a restricted network?

Any feature that calls an outside service needs either an internal replacement or a documented exception. Common examples are calls to cloud model providers, external guardrail services, outside secret managers, and identity providers hosted outside the boundary. Self-hosted LiteLLM sends no telemetry according to its data privacy documentation, so that is not a reason for an exception. Enterprise license validation can run offline against a signed payload, which should be confirmed with your license terms before deployment. Map each feature you use against your egress policy and record the decision.

Does moving to an air-gapped setup change our compliance obligations?

Restricted networks do not remove obligations, and they can add evidence work for controls on supply chain integrity. For example, NERC CIP-013-2 requires procurement processes that address verification of software integrity and authenticity, which is the control behind checking each package carried across an isolated boundary. NERC CIP-005-7 governs remote access into high and medium impact systems. Whether a given rule applies to your gateway depends on your classification and regulator, so confirm scope with your compliance lead and auditor. DeployOpen prepares systems, controls and evidence for assessments but does not issue audit reports or certifications.

How scope and evidence for an isolated gateway get agreed

DeployOpen agrees a fixed, written scope before any work starts on an isolated LiteLLM gateway. The scope names what the gateway may reach, what gets carried across the boundary, how it is configured and how the result is verified. Most of the later disagreements about an air-gapped build come from an outbound list that nobody wrote down, so the first deliverable is an outbound inventory: every destination the proxy, its database, its Redis instance, its container runtime and its Kubernetes nodes would contact, grouped by purpose. That list covers model provider endpoints, the GitHub fetch for the model cost map, license checks for Enterprise, package and image registries, identity providers and any observability exporters. Each line is marked as blocked, replaced by an internal service, or approved with a stated reason.

The second part of the scope is the artifact import process. It defines how the container images, Python packages, the bundled model cost map, Helm charts or Terraform modules, and any model weights are obtained on the connected side, checked, transferred and loaded into the private registry or package mirror. Ask who signs off each import and what record is kept of the hash or signature checked. The configuration and verification section then sets LITELLM_LOCAL_MODEL_COST_MAP to True, confirms the gateway starts with egress blocked, tests each approved provider route and each self-hosted backend, and documents which features were turned off because they need outbound access.

Compliance evidence is scoped in the same agreement. DeployOpen prepares the system description, network diagrams, configuration records, the outbound inventory, import logs and test results that an assessor will ask for. It does not issue audit reports, attestations or certifications. Confirm early which assessor, framework and control set applies to your environment, because that decides the format of the evidence. Ask the proposal to state the deliverables, the environments covered, what your team must provide (network access for testing, named approvers, a connected staging side), and what is excluded.

How DeployOpen works on this

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including networks that cannot reach the internet. For an offline LiteLLM gateway, we start by mapping which outbound paths are blocked, then build and verify each dependency against that map before handover.

How we scope

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • We list every outbound dependency the gateway needs, including the model cost map, container images, license checks and model backends.
  • The written scope separates features that need internet access from those that will run fully inside your network.

How we build

  • We configure LITELLM_LOCAL_MODEL_COST_MAP=True and confirm the gateway starts without reaching GitHub.
  • We mirror LiteLLM images and their dependencies into your private registry and verify each artifact before it crosses the boundary.
  • We connect the gateway to your self-hosted model backends and test routing, failover and key limits with no external calls.

How we hand over

  • We document the offline upgrade procedure, including how new release artifacts are imported, checked and promoted.
  • We deliver the outbound-dependency inventory, configuration files and test results your security and compliance teams can review.
  • We record which Enterprise features, such as offline license validation, were confirmed in your environment before handover.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover importing each new LiteLLM release into the isolated network on your chosen release line.
  • Security testing of the gateway and its routes can be repeated after upgrades or changes to model backends.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.