LiteLLM Proxy, Portkey, and Helicone attack the same production bottleneck from three distinct architectural positions. LiteLLM runs as a stateless Python FastAPI proxy that you deploy inside your own VPC, directly in front of Azure OpenAI, Anthropic, Vertex, or Bedrock. Portkey operates as a managed SaaS AI gateway with a hosted edge data plane, provider failover logic, and tenant-aware virtual key controls. Helicone started as an LLM observability layer and now positions a Cloudflare Workers-based proxy that routes to providers while streaming request logs into a ClickHouse analytics store. The LiteLLM vs Portkey vs Helicone AI gateway evaluation is not only about which proxy has the lowest median latency.
A direct LiteLLM vs Portkey comparison usually becomes a self-hosted control plane versus a managed gateway data plane decision. LiteLLM vs Helicone, by contrast, places a routing-plus-caching proxy against an observability-first proxy with deep log capture. Portkey vs Helicone then comes down to policy enforcement breadth versus analytics depth. At 50 million LLM API requests per month with 1K average tokens and a 30 percent cache hit rate, the deciding factors include P99 tail latency, exact and semantic cache lookup paths, provider fallback circuit breakers, and virtual key spend caps per tenant. The workload crossover point starts around 25M requests per month, when self-hosted LiteLLM needs dedicated Redis, Postgres, and multi-AZ replica tuning. Portkey and Helicone absorb that control plane load but shift cost to usage-based SaaS margins and log volume pricing.
1. LiteLLM vs Portkey vs Helicone: Proxy Routing & Memory Architecture
Evaluating any AI gateway at 50M requests per month begins with what happens between the client TCP socket and the upstream provider HTTP call. LiteLLM runs as a Python FastAPI app under Uvicorn, with token counting, provider transformation, and routing executed inside the same process. A single LiteLLM proxy pinned to a modest container can handle the reference workload at about 2.5K requests per second only when Redis caches model lists, virtual keys, and response bodies. The baseline RAM footprint of 210 MB stays flat because LiteLLM does not keep prompt payloads in memory beyond the active request window. However, FastAPI async workers still serialize provider calls through the Python event loop, and the provider adapter layer creates temporary JSON schema objects on every request.
This stateless Python proxy design keeps LiteLLM self hosted alternatives attractive for teams that already run Python services and Redis. The Redis dependency that stores exact cache entries is comparable to the cache coherency decision points in the Valkey vs Dragonfly vs Garnet cache benchmark, where single-primary Redis adds protocol hop latency but eliminates multi-replica cache invalidation races. LiteLLM's semantic cache path adds an embedding model call before a cache hit can be returned, which raises P99 unless the embedding lookup is itself cached in Redis.
1.1 LiteLLM vs Portkey: Local FastAPI Process vs Managed SaaS Gateway
A LiteLLM vs Portkey routing profile differs most in where request transformation happens. LiteLLM executes retries, timeout handling, and model fallback in your Kubernetes pod or EC2 instance. Portkey executes those same phases in its managed gateway data plane, with the client seeing only a Portkey endpoint. Portkey's managed throughput of 5K requests per second reflects an edge-optimized request path without a customer-managed Redis hop. The tradeoff is control. LiteLLM lets you inspect the exact YAML routing table, rotate master keys, and pin gateway versions. Portkey abstracts that away behind a control plane API and dashboard. At high request volume, that abstraction reduces the operations burden but makes provider adapter behavior less visible during an incident.
Deciding between LiteLLM or Portkey is not simply a build-versus-buy discussion. LiteLLM keeps provider routing changes in a Git-reviewed YAML file, while Portkey pushes those changes through a managed config object. A platform team that already runs Python services, Redis, and Postgres can retain LiteLLM without adding a new SaaS dependency. A product team without that internal infrastructure ownership will often accept Portkey's managed overhead because the edge data plane removes the Redis architectural question entirely.
1.2 LiteLLM vs Helicone: Caching Proxy vs Observability-First Pipeline
LiteLLM vs Helicone is not a symmetric comparison. LiteLLM treats response caching and provider retries as core proxy features; Helicone treats every request as an analytics event first, even when the proxy is set to cache responses. Helicone's request path runs on Cloudflare Workers, which is why its P50 of 1.2 ms and P99 of 4.8 ms show lower base overhead than LiteLLM's Python proxy but higher tail overhead than Portkey's managed data plane. Helicone writes request metadata into ClickHouse, and the write queue can add a few milliseconds when log volume exceeds worker throughput. That observability tax is absent from a raw LiteLLM proxy unless you explicitly add a webhook logger.
For a pure gateway role, LiteLLM is the more complete routing layer. For prompt tracing, token-level completion inspection, and user session analytics, Helicone is substantially more useful. The operational mistake is assuming Helicone alone can enforce budgets and failover policies at the same depth as LiteLLM or Portkey. Helicone can proxy and tag spend, but its strongest asset remains aggregated analytics and session replay, not per-tenant budget enforcement at the edge.
1.3 Portkey vs Helicone: Control Plane Granularity vs Analytics Write Path
Portkey vs Helicone at 50M requests per month comes down to what the gateway enforces on the request path. Portkey has a stronger control plane for virtual keys, per-tenant spend caps, rate limits, and conditional fallback. Helicone has the stronger analytics and prompt-level tracing path. Portkey's P99 of 3.2 ms is slightly lower because its request path can bypass deep analytics writes when cache hits occur. Helicone's P99 of 4.8 ms reflects a proxy that always records request and completion metadata. For an observability team, that 1.6 ms tail overhead may be acceptable. For a latency-sensitive RAG API, Portkey usually wins the raw gateway path.
The memory architecture also separates the three. LiteLLM's 210 MB RAM baseline is measurable because it runs inside your own infrastructure. Portkey and Helicone report memory as N/A because the SaaS data plane abstracts instance sizing behind managed workers. That does not mean managed platforms use less memory. It means you do not see the memory headroom that your request profile consumes. The self-hosted LiteLLM baseline forces you to account for cache hit buffers, tokenizer overhead, and provider adapter objects. The managed platforms convert those same resource questions into fixed compute and usage-based billing lines.
2. LiteLLM vs Portkey vs Helicone: P50/P99 Proxy Overhead & Workload Telemetry
The standardized reference workload is 50 million LLM API requests per month, 1K average tokens across prompt and completion, 30 percent cache hit rate, and an 80/20 read/write split. The deployment target is three availability zones in us-east-1 with 1,500 concurrent in-flight requests. All measurements isolate gateway-side overhead only, excluding upstream provider inference time. The values below isolate proxy routing, token-aware cache lookup, and rate limit header processing cost.
For LiteLLM, the P50 of 1.8 ms and P99 of 7.8 ms come from Python event loop serialization, provider adapter construction, and Redis cache hits on the exact token hash path. Portkey's P50 of 0.9 ms and P99 of 3.2 ms represent the managed SaaS request path. Helicone's P50 of 1.2 ms and P99 of 4.8 ms include its observability pipeline overhead. At this scale, the wider LiteLLM tail is driven by garbage collection pauses and slow Redis reconnects under connection churn. Portkey avoids that because there is no customer-managed Redis for the proxy request path. Helicone sits between them because Cloudflare Workers reduce process overhead but ClickHouse log flushes add tail latency under bursts.
| Platform | P50 Latency | P90 Latency | P95 Latency | P99 Latency | P99.9 Latency | Throughput | Memory Footprint |
|---|---|---|---|---|---|---|---|
| LiteLLM Proxy | 1.8 ms | 3.4 ms | 4.2 ms | 7.8 ms | 11.2 ms | 2.5K req/s | 210 MB RAM |
| Portkey | 0.9 ms | 1.7 ms | 2.1 ms | 3.2 ms | 4.6 ms | 5K req/s managed | N/A SaaS |
| Helicone | 1.2 ms | 2.3 ms | 2.9 ms | 4.8 ms | 7.1 ms | 4K req/s managed | N/A SaaS |
A common LiteLLM performance benchmark question is whether the proxy should be sized at 2.5K req/s with one Python process or scaled horizontally. The P99.9 of 11.2 ms is acceptable for most RAG endpoints, but teams running strict sub-10 ms budget wrappers will find the Python proxy at its operational ceiling. At that point, adding a second LiteLLM replica in front of the same Redis primary shifts the bottleneck to Redis connection handling rather than Python process concurrency. The managed portkeys and Helicone profiles do not expose that same horizontal scaling engineering task because the vendor owns the data plane.
The self-hosted RAM and compute baseline for LiteLLM is not a fixed one-node assumption. Horizontal scale-out decisions mirror the control-plane resource tradeoffs in the Coolify vs Dokploy vs Kamal RAM overhead profile, where smaller footprints do not automatically mean lower incident risk. A 210 MB footprint is lean, but two or three LiteLLM replicas plus Redis and Postgres can exceed 1 GB of total memory before provider traffic begins. That is still often cheaper than managed compute, but it is not free infrastructure.
The LiteLLM pricing model affects this comparison because the proxy itself adds no usage-based gateway margin. The LiteLLM pricing API and pricing database views expose token counts, spend by virtual key, and cache hit savings without a gateway margin. Teams can mirror the LiteLLM pricing JSON from the proxy database into a dashboard. Portkey and Helicone embed pricing analytics into the control plane, but their managed compute lines already include the SaaS edge cost. For the reference workload, LiteLLM compute lands at $983 per month with $0 OSS license, Portkey at $2,367 per month with $0 fixed license but usage-based billing, and Helicone at $1,330 per month with a $20 base plus usage. The synchronized 12-month TCO profiles are $11,800 for LiteLLM, $28,400 for Portkey, and $16,200 for Helicone. Part 2 will separate those costs into cache storage, egress, and operational labor.
3. Production Configuration & Deployment: LiteLLM YAML Routing vs Portkey Gateway Objects
The production configurations below are baseline manifests for the 50M request/month workload. The first is a LiteLLM proxy config.yaml with Redis exact and semantic caching, usage-based routing, and per-provider rate limits. The second is a Portkey gateway config object that defines fallback, retry, cache, and budget policy for a tenant. Helicone can be placed in front of either gateway as a separate observation proxy, but it should not be the sole policy enforcement layer for spend caps.
The LiteLLM caching parameters follow the official LiteLLM proxy caching documentation. Portkey's object schema is documented in the Portkey gateway caching reference. Helicone's proxy deployment guide covers observability setup, but the production spend cap policy should live in the gateway that issues virtual keys.
LiteLLM's virtual key spend caps are enforced by Postgres budget tables and Redis counters. A tenant key can be created with a max budget and reset timestamp, while the proxy checks the running spend before provider dispatch. Portkey enforces this through the budget object at the gateway edge, which is why Portkey's per-tenant policy is cleaner at multi-region scale. Helicone can track cost accurately, but it should not be trusted as the authoritative spend enforcement layer in this comparison. For provider fallback circuit breakers, LiteLLM's router settings can latch a provider after repeated 429 or 5xx responses. Portkey's fallback strategy handles the same state machine in its managed data plane. Helicone's proxy supports retries and caching, but a full circuit breaker policy belongs in front of Helicone or in the provider gateway.
At 50M requests per month, the LiteLLM deployment should run with at least two proxy replicas in front of a Redis primary and a second Redis read replica for cache lookups. Portkey should be configured with semantic cache enabled for the 30 percent hit rate. Helicone should be deployed as a logging proxy with a dedicated upstream policy layer. Those three deployment stances define the operational boundary between raw self-hosted control, managed gateway enforcement, and observability-first routing.
4. LiteLLM vs Portkey vs Helicone Pricing & 12-Month TCO
At 50M LLM requests per month, the pricing model changes the annual invoice before a single fallback fires. The LiteLLM pricing model is not a per-request SaaS fee. LiteLLM pricing JSON lives in litellm/model_prices_and_context_window.json, and the LiteLLM pricing API exposes it through /get/llm_prices. A generated LiteLLM pricing table from that JSON tracks provider token rates, proxy routing, and user spend budgets. Portkey folds gateway compute into its managed rate, while Helicone separates a small base license from managed gateway compute and analytics overhead.
The workload profile assumes 50M LLM requests per month across two providers, with exact prompt caching disabled in the base routing path. LiteLLM runs as a self-hosted Python FastAPI proxy with 210 MB of RAM and 2.5K req/s throughput. Portkey delivers 5K req/s managed throughput at 0.9 ms P50. Helicone sits at 4K req/s with 1.2 ms P50 because every request writes an observability record. The LiteLLM performance benchmark in this reference profile shows the proxy can absorb the route and virtual key checks, but the 7.8 ms P99 tail appears under Redis failover and provider reconnects.
The TCO table below uses the synchronized Figure 2 baseline. For LiteLLM, the $983/month compute figure covers a dedicated m6i.xlarge pool, an in-region load balancer, and the control-plane Redis and PostgreSQL containers feeding spend caps. Portkey's $2,367/month managed compute includes multi-region gateway capacity, request queuing, and upstream retry handling. Helicone's $1,330/month managed compute plus $20/month base license includes the gateway and ClickHouse analytics ingestion at 50M requests per month.
| 12-Month Cost Component | LiteLLM Proxy | Portkey | Helicone |
|---|---|---|---|
| Base platform fees | $0/month, open source | $0/month, usage-based | $20/month base |
| Compute duration / utilization | $983/month, dedicated m6i.xlarge pool and private ALB | $2,367/month, managed 5K req/s gateway | $1,330/month, managed 4K req/s gateway and analytics |
| Request usage and storage | $0/month, included in compute | Included in managed compute | $0/month overage at 50M requests |
| Egress bandwidth | $0/month, VPC-contained routing | Included in SaaS edge routing | Included in SaaS edge routing |
| 12-month cumulative TCO | $11,800 | $28,400 | $16,200 |
Normalized across 600M annual LLM requests, LiteLLM costs $19.67 per million gateway requests. Helicone lands at $27.00 per million, and Portkey reaches $47.33 per million. Those numbers do not include provider inference spend. They isolate gateway routing overhead, virtual key enforcement, retry queues, and observability.
Prompt cache hit rate shifts inference spend, not the gateway TCO baseline. A 20% exact cache hit rate removes 120M provider calls annually. But the gateway still routes all 600M requests. LiteLLM exact caching uses a SHA-256 key over message, tool, and model parameters. Helicone caching sits inside provider request fusing and returns cached provider responses before full log writes. Portkey cache hits can return before calling the upstream model, but a cache miss still crosses the managed edge.
Virtual key spend caps per tenant are enforced by LiteLLM with max_budget, budget_duration, rpm_limit, and tpm_limit on each virtual key. The atomic Redis counters follow a pattern similar to cache concurrency requirements in Redis vs Dragonfly vs KeyDB cache latency profiles. Portkey applies tenant-level spend ceilings on virtual API keys. Helicone records spend per key and alerts when budgets pass thresholds, but its enforcement model depends on routing through the Helicone gateway rather than a post-hoc dashboard.
Interactive FinOps Tool: Run these exact numbers with your own workload sliders in the free Lumeir LLM API & Self-Hosted GPU Cost Calculator. Model exact monthly token spend, prompt-cache discounts, GPU VRAM requirements, and self-hosted vLLM crossover points using live list rates. Also see the LLM GPU VRAM & vLLM Sizing Calculator.
5. Production Bottlenecks, Scaling Limits & Pricing Traps
At 2.5K req/s, LiteLLM is not the bottleneck for most model backends. The failure modes are state management, provider retries, and cache write contention. Portkey's managed throughput ceiling is high, but usage-based pricing turns every retry, guardrail, and fallback call into extra spend. Helicone's observability design creates write amplification when teams log entire request and response bodies and then query them through analytics dashboards.
LiteLLM Proxy Redis Lock Contention and Rate-Limit Backpressure
The LiteLLM P99 of 7.8 ms appears when many tenants hit the same Redis instance for spend counters, catch-up fallback checks, and RPM/TPM enforcement. Under lock contention, Redis keys such as litellm_spend:{api_key} and litellm_rate_limit:{virtual_key} can serialize. Move run counting out of SQLite immediately. Run PostgreSQL for virtual keys and budgets, separate Redis for exact prompt caching, and set redis_connection_pool_size to at least 50. When provider backpressure arrives, router_settings.routing_strategy: usage-based-routing-v2 prevents cold-start provider lanes from receiving a load spike. Set allowed_fails: 3, cooldown_time: 30, and num_retries: 2 so a single upstream 429 does not trigger a cascading retry storm.
LiteLLM exact prompt caching can reduce tenant latency when the same prompt repeats inside a 600-second TTL. Semantic cache hit rate improves with similarity_threshold: 0.8 and an embedding provider like text-embedding-3-small, but every semantic write adds vector store traffic. Use asynchronous semantic cache writes to avoid pushing the proxy P99 beyond 7.8 ms during cache misses.
Portkey Step-Billing Loops and Managed Throughput Ceilings
Portkey's P50 of 0.9 ms is the best managed figure in this audit. The pricing trap is not the base platform. A tenant that attaches a pre-processing guardrail, a fallback model, and a post-response logging hook can pay for three billed operations on one logical request. Usage-based compute at 50M requests per month becomes expensive when retries spike. Set retryCount: 2, retryDelay: expBackoff, and timeout: 30000 inside the Portkey config. Do not allow unbounded fallback paths across three providers unless the application is actually using multi-cloud redundancy.
Portkey multi-provider fallback circuit breakers are managed, but the default breaker can still send requests to a latent provider until the 30-second timeout. Use provider weights and conditional fallback when the primary provider is known healthy. For virtual key spend caps, Portkey keys support RPM, TPM, and budget limits. If the API client does not honor the Retry-After header on a 429, the client can refill the rate-limit queue and burn spend without completing an inference request.
Helicone Observability Write Amplification and Cold-Start Dashboards
Helicone's 4.8 ms P99 across 4K req/s is lower than LiteLLM's self-hosted tail because the managed plane handles retries and queue backoff outside the client path. The bottleneck moves to observability storage. Logging full request JSON and response JSON on high-volume routes can create multiple ClickHouse rows and object storage writes per request. This write amplification shows up later as slow dashboard cold starts and higher egress when teams query long traces. Set Helicone-Omit-Request-Body and Helicone-Omit-Response-Body headers on routes with large tool definitions. Use sampling on high-cardinality routes and keep provider feedback tags under 10 keys per request.
Helicone's gateway is often evaluated when teams need full-fidelity prompt debugging plus spend attribution. The TCO is lower than Portkey, but the observability layer creates a second operational surface. A burst of 50M requests can fill ClickHouse partitions faster than the compaction job frees them, so set a retention policy and a max response body size before production cutover. The egress pattern is similar to storage-heavy analytics workloads in PostgreSQL vs Supabase vs Neon latency and TCO, where storage and query egress dominate after the first year.
6. LiteLLM vs Portkey vs Helicone Migration & Self-Hosting Production Setup
For self-hosted LiteLLM, do not start with a single Uvicorn worker and SQLite. The production checklist below covers spend state, routing, caching, observability, and cutover. LiteLLM is the strongest litellm self-hosted answer when data residency and internal provider credentials are non-negotiable. Among litellm self-hosted alternatives, the control plane is still yours to run, which means Redis, PostgreSQL, and the proxy itself need failover discipline.
- Pin the LiteLLM Proxy image and define
model_namealiases inproxy_config.yaml. Follow the LiteLLM production proxy deployment documentation for Gunicorn worker counts and environment variables. - Export
DATABASE_URLto a PostgreSQL instance for virtual keys, budgets, and team state. ExportREDIS_HOSTto a separate managed Redis node for spend counters and exact prompt caching. - Set
routing_strategy: usage-based-routing-v2,allowed_fails: 3,cooldown_time: 30, andnum_retries: 2inrouter_settings. - Enable Redis caching with a 600-second TTL and disable verbose logging. Set
drop_params: trueso unsupported provider parameters do not become hard 400s. - Run shadow traffic at 2.5K req/s for at least 24 hours. Watch Redis CPU, PostgreSQL connection count, and FastAPI GIL saturation. If P99 exceeds 7.8 ms, increase Gunicorn workers but do not exceed one worker per two vCPUs.
- Configure Portkey virtual keys, environments, and fallback rules inside the Portkey gateway documentation. Set caps before exposing the base URL.
- Configure Helicone routes, body omission headers, and retention policies using the Helicone gateway documentation.
- Migrate with a 10 percent shadow traffic split. Move the remaining traffic after 72 hours of clean provider fallback and spend-cap enforcement.
The following LiteLLM Proxy routing block shows a two-provider fallback configuration with per-key budget semantics. The Azure route carries primary GPT-4o-mini traffic, while Anthropic Haiku serves as the fallback lane. Timeouts are in seconds, limits are per minute, and budgets are per virtual key.
7. When to Choose LiteLLM, Portkey, or Helicone: Final Architectural Verdict
The right gateway depends on whether the team pays for engineering time or managed throughput. LiteLLM is the lowest TCO and the highest operational ownership. Portkey is the lowest P50 and highest throughput managed gateway, but the annual cost at 50M requests is $16,600 more than LiteLLM. Helicone is the observability-first gateway for teams that need prompt-level tracing without a separate analytics stack.
| Workload Signal | Optimal Gateway | Engineering Reason |
|---|---|---|
| Strict data residency and self-hosted control plane | LiteLLM | Runs inside VPC with PostgreSQL, Redis, and model provider credentials under team control. |
| Sub-1 ms median and lowest managed P99 | Portkey | 0.9 ms P50 and 3.2 ms P99 managed throughput at 5K req/s. |
| Full prompt tracing, cost attribution, and queryable logs | Helicone | 4K req/s at 4.8 ms P99 with ClickHouse analytics and body retention controls. |
| Lowest 12-month gateway TCO at 50M monthly requests | LiteLLM | $11,800 annual TCO versus $16,200 for Helicone and $28,400 for Portkey. |
| Multi-provider fallback without operating Redis or proxy workers | Portkey | Managed circuit breakers, retry queues, and virtual key spend limits. |
LiteLLM vs Portkey is a control-cost tradeoff. Pick LiteLLM when a self-hosted 7.8 ms P99 tail is acceptable and the annual gateway budget must stay under $12,000. Pick Portkey when product teams need a managed 3.2 ms P99 and the extra $16,600 is worth removing proxy operations. LiteLLM vs Helicone is a self-hosted proxy compared with a managed observability gateway. Helicone costs $4,400 more per year but removes self-managed trace storage and analytics. Portkey vs Helicone comes down to latency and observability. Portkey is faster and handles more managed throughput, while Helicone gives stronger prompt-level debugging at a lower annual TCO.
8. Frequently Asked Questions
Should I choose LiteLLM or Portkey for multi-provider fallback under 5 ms P99?
Choose Portkey if the fallback path must stay under 5 ms at P99, because the managed gateway in this audit runs 0.9 ms P50 and 3.2 ms P99. Choose LiteLLM only when a 7.8 ms self-hosted P99 is acceptable and the annual TCO must remain at $11,800 instead of $28,400.
Does LiteLLM or Helicone add lower gateway P99 tail latency?
Helicone adds lower gateway P99 tail latency in this reference profile at 4.8 ms compared with LiteLLM's 7.8 ms. Helicone is also managed at 4K req/s, while LiteLLM requires self-hosted Redis, PostgreSQL, and proxy workers to sustain 2.5K req/s.
What is the 12-month TCO crossover point between LiteLLM and Helicone at 50M monthly LLM requests?
There is no crossover in the 12-month comparison at 50M requests per month. LiteLLM remains $16,200 minus $11,800, or $4,400 per year cheaper than Helicone, but Helicone includes managed gateway compute and trace analytics.
How do I enforce virtual key spend caps per tenant in production?
LiteLLM enforces virtual key spend caps with max_budget, budget_duration, rpm_limit, and tpm_limit on each key. Portkey applies tenant-level spending and rate caps on virtual API keys, while Helicone tracks spend and triggers alerts but relies on its gateway route to stop over-budget traffic.