HIPAA Model Index LLM Gateway Architecture
Managed LLM Gateway vs Self-Hosted LiteLLM Proxy
- Published
- November 21, 2026
- Reading time
- 8 min read
Summary
Self-hosting LiteLLM trades vendor fees for ops and security duty.
A fully managed LLM gateway is the alternative to self-hosted LiteLLM for teams that need centralized routing, fallbacks, credentials, and spend controls without operating the proxy. With LiteLLM offering those features, the choice is where to spend engineering capacity. Once services scatter provider keys, retry logic, and cost records across applications, a gateway addresses the fragmentation, but its deployment model determines who operates and secures that shared dependency.
What LiteLLM actually gives you as a self-hosted proxy
Its virtual keys take the place of raw provider API keys in application code, so teams can rotate credentials without redeploying services. Its adoption extends beyond small experimental deployments. The project has crossed 40,000 GitHub stars, has a large contributor community, and is used by organizations including Netflix to ship new models to users within a day of release.
The proxy also centralizes decisions that otherwise spread across applications. Routing strategies include simple-shuffle, least-busy, latency-based, usage-based, and cost-based selection, with fallback chains and configurable cooldowns. Spend tracking covers keys, users, teams, and organizations, while hard budget caps stop requests when a limit is reached. Semantic caching through Redis, Qdrant, or Valkey avoids repeated charges for identical or semantically similar prompts. These are substantive production controls.
The data plane uses a Rust core, with Python, FastAPI, and AsyncIO handling authentication, callbacks, and remaining routes. Redis supports caching and rate limits, while PostgreSQL stores virtual-key management data and spend ledgers. Reported proxy overhead is modest under typical production workloads, and published benchmarks show low P95 latency at high request volumes. The open-source version is free, with paid Enterprise features including SCIM, detailed audit logs, JWT authentication, RBAC, and dedicated support with an SLA. BerriAI added the LiteLLM Agent Platform in May 2026, providing a Kubernetes-native control plane with isolated agent sandboxes and persistent sessions across pod restarts.
What "self-hosted" actually means operationally
Self-hosting assigns deployment, scaling, patching, certificate rotation, incident response, and database upkeep to the team running the proxy. Redis and PostgreSQL become part of its production estate. The endpoint is only the visible service boundary. Behind it, upgrades, schema migrations, and Redis failover require engineering time that a request-latency benchmark does not measure.
High availability requires the same treatment as any other stateful production service. Multiple replicas, health checks, and a load balancer support availability, while a runbook defines the response when the service fails at 2 a.m. Someone still has to answer the page. For self-hosted LiteLLM, that responsibility belongs to the platform team. A managed gateway instead supplies an uptime guarantee and a vendor paging contact, shifting gateway incident response outside the customer's engineering function.
A platform team already operating stateful infrastructure may have the skills and processes to absorb the work. Conversely, a team without that function must account for those responsibilities when making the deployment decision. Running the Agent Platform adds Kubernetes expertise to the prerequisites. The relevant cost comparison is therefore not a free package against a service bill, but software, infrastructure, and continuing engineering ownership against a managed service.
The two 2026 supply-chain attacks and what they changed about the self-hosting calculus

Two separate supply-chain attacks in 2026 showed that teams running LiteLLM had to take care of dependency integrity. On March 24, 2026, compromised packages litellm==1.82.7 and litellm==1.82.8 were live on PyPI from 10:39 UTC for a brief window before quarantine. The attack formed part of the broader TeamPCP campaign, which Google tracks as UNC6780. CISA added the associated ecosystem vulnerability, CVE-2026-33634, to its Known Exploited Vulnerabilities catalog on March 26, 2026.
In October 2026, a poisoned LiteLLM 1.107.0 release pushed a credential stealer to both PyPI and the project's official container registries. Both attacks reached production CI/CD pipelines. By late 2026, the self-hosting decision included evidence that both package and container release channels could become attack surfaces. Operational competence alone was no longer an adequate description of the work involved.
For a self-hosting team, that work includes pinned dependency hashes, automated integrity checks in CI/CD, and monitoring of PyPI and container registry digests for the versions in use. The team also needs a rollback procedure that it has tested. The team needs security engineering capacity to sustain them and respond when a dependency becomes suspect.
With a managed gateway, the vendor takes care of package integrity, container signing, and dependency vetting. It does not make supply-chain risk disappear. Teams then have to judge that risk by how well the vendor handles security. The comparison is between two owners of the security practice.
Compliance and data security when you own the proxy
Self-hosting gives a team custody of the gateway's data plane and responsibility for its compliance controls. That custody does not replace decisions about what reaches a model provider. The accepted approach described for 2026 SOC 2 audits applies redaction before logging, so raw prompt content never enters the log store. An audit record should identify the data category, guardrail event, model, team, and trace ID.
Runtime redaction rewrites the live payload and stores the redacted form, while logs_only sends the original to the model and stores reversible placeholders in logs. The runtime_reversible mode redacts both, with placeholders that permitted users can reveal. These modes are not interchangeable privacy guarantees. LiteLLM makes PII masking through Presidio available in open source, while Secret detection and redaction require Enterprise.
The EU AI Act requires a deployer to keep high-risk system logs under its control for at least six months, while HIPAA requires six-year retention of the Security Rule documentation that it calls for. SOC 2 evidence must cover the full audit period. These rules apply to different records, so a single retention setting cannot cover them all. A self-hosted logging stack must meet the rules that apply to it.
Access controls also affect the licensing decision. RBAC and SCIM are Enterprise-only, while open-source SSO is free for up to 5 users and requires Enterprise beyond that threshold. LiteLLM's official enterprise page lists SOC 2 Type II auditing but does not list a HIPAA BAA. A managed gateway can enforce routing policies that block providers without required SOC 2 Type II, HIPAA BAA, or zero-data-retention coverage before data leaves the gateway. The team still defines its requirements, but the vendor operates the enforcement infrastructure.
Routing, fallbacks, and what reliability actually costs at the gateway layer
Provider failures are a forcing function for gateway adoption because a request with nowhere else to go becomes a user-facing failure. Centralized routing replaces inconsistent retry logic spread across application code. That is a useful change in control. It does not, however, turn reliable fallback into a one-time configuration task. The team still has to define and test the routing policy, then keep it up to date in production.
A representative LiteLLM configuration uses a virtual model alias such as smart-chat, a priority-ordered provider list, and a cooldown_time parameter. The alias gives applications a target that stays the same, while the provider list sets the fallback chain. The cooldown prevents repeated attempts against a degrading provider. This is the appropriate pattern for the problem.
Failures during streaming are harder to handle than failures when first routing a request. When a provider fails partway through a response, handling that failure requires specific implementation to avoid sending a truncated response to the user. A configured fallback chain alone does not establish that behavior. Semantic caching introduces another dependency when Redis supports the cache, because its capacity and availability also need monitoring. Each reliability mechanism has an operational counterpart.
The deployment models differ decisively in who owns those counterparts during an incident. Self-hosted proxy uptime depends on the availability the team can provide, including the stateful services behind the endpoint. Managed gateways supply their own uptime guarantees and incident response functions. Those commitments change who maintains the gateway behavior that contains provider failures, and whose engineers respond when that behavior fails.
Spend visibility and budget control — what each model actually delivers for finance and security teams
Finance, security, and product teams often need granular AI cost data without operating the infrastructure that produces it. Those teams need usage records in a form they can use and in time to use them. With direct provider integrations, each service may track costs differently, leaving finance to export CSVs from several dashboards. A gateway provides a shared accounting point before that fragmentation reaches month-end reconciliation.
LiteLLM's per-key, user, team, and organization tracking adds detail to that accounting point. Hard budget caps also turn a spending policy into an enforced request limit. These controls depend on a functioning proxy. Finance must additionally have somewhere to see the data, which makes the logging and reporting pipeline part of the service the platform team provides. A capability in the proxy is not automatically a dependable workflow for another department.
The gateway sees exact token counts before provider-side summarization, making its data more reliable than reconstructing usage from invoices after the fact. The standard finance needs is real-time visibility by team, project, key, model, and provider. Security stakeholders likewise need access to the relevant spend controls without reconstructing application behavior.
A managed model transfers maintenance of that reporting infrastructure to the gateway operator. Finance can then evaluate the service on the visibility it delivers rather than the platform team's availability to maintain it. Pricing still needs a separate comparison. Teams still have to pay for infrastructure and engineering work with the free open-source license, and Enterprise controls come in a paid tier. Total cost includes those obligations as well as inference spend, because the dashboard and its controls have to remain available throughout the billing period.
How to frame the decision for your team's actual situation
Self-hosted LiteLLM fits teams that already have a platform engineering team, must have data-plane custody, and can keep doing dependency-integrity work. Existing experience with Redis, PostgreSQL, and Kubernetes makes that ownership more practical. Custody should be a defined requirement. Where regulation prohibits traffic from transiting a third-party gateway network, the deployment boundary can determine the choice before feature comparisons begin. Enterprise access and compliance features must also be budgeted where required, without assuming an Enterprise license supplies a BAA that is not listed.
A managed gateway fits teams that are short on engineering time, especially startups and scale-ups focused on shipping product. It is a stronger fit when keeping the service reliable for customers calls for outside help with incident response and finance needs real-time reporting without depending on the platform team to maintain it. Regulated teams also need policy enforcement before sensitive data reaches an unsuitable provider. Contract coverage still needs explicit evaluation. Required redaction, audit logs, SSO, RBAC, and BAA terms are selection criteria to verify when evaluating a “managed” service.
Concentrate AI is one fully managed option, providing one API across a broad range of models from about 30 providers with no proxy, Redis, or PostgreSQL for the customer to deploy or maintain. It also provides automatic fallbacks, real-time spend tracking, PII and PHI redaction, zero data retention, audit logs, and a HIPAA BAA on the paid plan.
The final comparison is about ownership of production work. A team choosing self-hosting is allocating capacity to gateway operations, dependency security, compliance infrastructure, and reporting as well as routing. A team choosing managed service is allocating capacity to vendor evaluation and policy while transferring the underlying operation. The decision is whether that work is the best use of the engineering hours the team has.
How to cite
Marcus Delacroix-Webb. Managed LLM Gateway vs Self-Hosted LiteLLM Proxy. HIPAA Model Index. November 21, 2026. hipaamodelindex.com/posts/managed-llm-gateway-vs-self-hosted-litellm-proxy
© 2026 HIPAA Model Index