LiteLLM Redis requirements and sizing

Redis holds the shared state that keeps rate limits, budgets, key revocations and cooldowns consistent across LiteLLM pods. This page explains what breaks without it and how to size it.

On this page

Why LiteLLM Redis sizing matters once you run more than one pod

Redis is the shared state layer that lets several LiteLLM proxy instances behave as one gateway, and the production guide requires Redis 7.0 or newer once more than one proxy instance runs. Without it, each pod keeps its own view of rate limits, router state and cache, so a single gateway quietly becomes several independent ones. The sizing question is how much traffic that shared layer must absorb, which depends on how many pods you run, how many requests per second they serve and whether you use the spend transaction buffer. Answer those three inputs first, then size Redis against them rather than copying a default.

The state Redis holds falls into four groups: shared rate limits (RPM and TPM counters for virtual keys, users and teams), router state such as cooldowns after repeated failures, response cache entries, and the spend transaction buffer that queues cost updates before they reach PostgreSQL. Each group is read or written on the request path, so Redis load grows with request volume across every pod, not with the number of pods alone. The production guide pairs this with a baseline of 1 vCPU and 4 GiB of memory per worker, and it recommends one Uvicorn worker per pod on Kubernetes, scaling horizontally. That means each pod's capacity is a predictable unit, and your Redis plan should be checked against the total request rate of all pods combined.

Before you choose an instance class, confirm three things with your own environment: the sustained requests per second you expect at peak, whether the transaction buffer is enabled, and which Redis deployment your platform team will operate. Those answers determine whether the sizing bands in the vendor's sizing guidance apply to you, and they decide how much eviction, persistence and failover risk you must plan for in the sections that follow.

What breaks across pods when Redis is missing

Each LiteLLM pod or worker holds its own view of limits, revocations and router health unless Redis gives them a shared state. The cards below describe the failures that appear when that shared state is absent, and each one maps to a control your security team will ask you to prove. Use them to decide what Redis must do before you run more than one proxy instance.

Rate limits multiply per worker

Without Redis, each worker keeps its own request counters. A limit of 100 requests per minute spread across 4 workers can let 400 requests through in the same window, because every worker counts only what it sees. For a control that caps abuse or runaway agent loops, this turns a configured limit into a number you cannot state. Check that your tests send traffic through every worker and that the effective limit is measured at the gateway, not per process.

Revoked keys stay usable

A revocation written on one worker does not reach workers that did not process it. A key your team has disabled after a suspected leak can keep working on other pods until their state is refreshed by a shared store. Treat key revocation as a control with a measurable propagation path. Ask the vendor how revocation is distributed across instances, then test it by revoking a key and sending requests through every pod.

Budgets drift across workers

Spend limits on virtual keys, users and teams depend on a running total. When each worker tallies spend separately, a key can exceed its budget before any single worker sees the limit reached. Finance-facing controls and chargeback reports then disagree with provider bills. Before go-live, compare the sum of per-worker spend with the database record over a test run, and confirm which component holds the authoritative total.

Cooldowns differ between pods

The router takes a model deployment out of rotation after repeated failures and retries elsewhere. If that cooldown lives only in one worker, other workers keep sending traffic to a failing provider endpoint, and failover behaves differently depending on which pod receives a request. This affects availability and the predictability of which provider handles regulated data. Simulate a provider error on one pod and confirm that all pods stop routing to that deployment.

Router state and cache diverge

Routing decisions based on usage, latency or least-busy signals need a view across all instances. Without shared router state, each pod optimizes against a partial picture, and response caches can serve different results depending on the pod. For a security reviewer, this means the route a request took and the content it received cannot be reconstructed reliably from any one pod's logs. Confirm which routing strategy you use and whether its state must be shared before you accept multi-pod traffic.

How LiteLLM pods share state through Redis and PostgreSQL

The diagram starts with client requests entering the client-controlled network and reaching several LiteLLM pods behind a load balancer. Each pod reads and writes shared rate limit counters, cooldown state and cache in Redis, so limits hold across pods. Spend and key data live in PostgreSQL, and spend updates collect in a transaction buffer that is flushed to the database on the 60 second batch cadence. Check that Redis is reachable from every pod, that persistence is enabled if the buffer is used, and that Redis memory is sized so eviction does not drop spend updates.

Pods share rate limits, cooldowns and cache through Redis, and spend and keys through PostgreSQL.

Redis sizing tiers and deployment options compared

This table sets LiteLLM's Redis sizing tiers beside the persistence, transaction buffer and topology choices that come with each. The tiers come from LiteLLM's Redis sizing guidance for Redis 7.0 or newer, so read the vCPU and memory columns as a starting floor and confirm the throughput you actually expect before committing to a size.

OptionWhat it sets or asks forFits whenTrade-off to weigh
Up to 1K RPS2 vCPU and 8 GB, sized so eviction does not happen in normal operationSingle gateway region with modest sustained traffic and a small number of proxy instancesLittle headroom; a traffic rise can push Redis into eviction, which risks losing spend updates
1K to 5K RPS4 vCPU and 16 GB, per LiteLLM's Redis sizing guidanceShared rate limits, budgets and cooldowns across several proxy pods at growing volumeLarger instance cost and more memory to monitor; confirm your RPS estimate against load tests
Above 5K RPS8+ vCPU and 32 GB+, per LiteLLM's Redis sizing guidanceHigh sustained throughput where vCPU is the limit on Redis command processingLargest footprint; may justify a managed tier or cluster mode for scale and failover planning
Persistence enabledRedis persistence turned on so queued writes survive a failoverTransaction buffer is used and dropped spend updates are unacceptableDisk I/O and snapshot overhead; confirm the persistence mode your managed service supports
Transaction buffer without persistenceSpend updates queued in Redis with no durable record during failoverLow-stakes environments where approximate spend reporting is acceptableA failover can discard queued spend updates, which weakens budget and chargeback accuracy
Standalone RedisOne Redis instance serving all proxy podsTest and small production environments where a Redis outage is tolerableNo automatic failover; a single instance becomes a shared point of failure for limits and budgets
Sentinel high availabilityAutomatic failover that promotes a replica to primary, with at least three Sentinel instancesProduction without the need to shard data, where failover should be automaticMore components to run and monitor; clients must support Sentinel discovery
Cluster modeData sharded across nodes, with replication and failover per shardVery high throughput or data volume beyond what one primary handles wellOperational complexity and multi-key constraints; confirm LiteLLM's supported client and key behavior first

Why vCPU, not memory, usually caps Redis throughput

The tiers scale core count with request rate, so vCPU is the throughput limit to plan around. LiteLLM's sizing guidance suggests 2 vCPU and 8 GB up to 1K RPS, 4 vCPU and 16 GB from 1K to 5K RPS, and 8+ vCPU and 32 GB or more above that, on Redis 7.0 or newer. In each tier the core count rises faster than a memory figure would need to for a comparable dataset, because every shared rate limit check, budget update, cooldown record and cache operation is a command that Redis executes on a single main thread for its data work. When the gateway's request rate grows, Redis runs out of command capacity before it runs out of RAM. Size the instance from the request rate you expect at peak, then treat the memory figure as the floor that protects against eviction.

Memory still has to be sized so that eviction does not happen in normal operation. Evicted keys can include rate limit counters, cooldown state and spend records, which weakens the controls that Redis exists to share across pods. Check the used memory, the eviction counter and the memory policy in your provider's metrics during a sustained run, and confirm that the instance keeps headroom above the working set as traffic grows. If you use the transaction buffer, add headroom for queued spend updates as well.

Do not assume a tier fits your workload. Load test your own request mix, including streaming calls, long prompts, key lookups for many virtual keys and any caching you enable, because these change the command rate per request. Ask your Redis provider which CPU and memory metrics, command throughput and latency percentiles they expose, then confirm headroom at your target peak with a margin for growth. If you run a managed service, confirm whether the tier you choose sets vCPU or only memory, since a plan that looks large on paper can still saturate its core under your traffic.

Setting up Redis for a multi-pod LiteLLM gateway

This sequence takes a multi-pod LiteLLM gateway from a pod count and traffic estimate to a Redis deployment that shares rate limits, budgets and revocations across every pod. Each step ends with a check you can run before moving on.

  1. Confirm pod count and sustained request rate

    The platform team records how many LiteLLM pods will run at peak and the sustained requests per second they must handle, measured as a steady load rather than a short burst. Use the figure from your load test or your current traffic logs, and state whether it covers peak hours or an average. This number selects the sizing tier in the next step. The step is done when the pod count, the RPS figure and its source are written down and approved by the team that owns the gateway.

  2. Choose the Redis sizing tier

    Map the sustained RPS to the tier in LiteLLM's Redis sizing guidance: 2 vCPU and 8 GB up to 1K RPS, 4 vCPU and 16 GB from 1K to 5K RPS, and 8 or more vCPU with 32 GB or more above that. Treat vCPU as the throughput limit, so choose by CPU first and memory second. Confirm the memory headroom with your Redis vendor so the dataset never reaches the eviction threshold during normal operation. The step is done when a tier is selected and the sizing note names the RPS figure it was based on.

  3. Select Redis 7.0 or newer or a compatible engine

    Pick a Redis build at version 7.0 or newer, or a compatible engine such as Valkey, which LiteLLM can use as a drop-in for Redis OSS 7.2 and earlier. Check the license before you choose: Redis 7.4 through the 7.8 line uses RSALv2 or SSPLv1, while Redis 8.0 and later can be used under AGPLv3 at your option. Confirm with your legal or procurement team which license terms apply to a self-hosted gateway, and confirm that the engine and version are supported by LiteLLM for your release line. The step is done when the engine, version and license are recorded in the design record.

  4. Enable persistence if the transaction buffer is used

    If your LiteLLM configuration uses the Redis transaction buffer for spend updates, enable Redis persistence so that a failover does not discard queued updates that have not yet reached PostgreSQL. Decide between snapshotting and append-only logging with your operations team, and size the disk for the chosen mode. If you do not use the transaction buffer, record that decision and skip this configuration. The check is a restart test: write a test spend entry, restart the Redis node, and confirm the entry is still present after the node returns.

  5. Configure Sentinel or cluster mode for failover

    Choose Sentinel for high availability when you do not need Redis Cluster, which means one primary with replicas and automatic promotion. Deploy at least three Sentinel instances, as the Redis and Valkey Sentinel documentation recommends, and place them on separate failure domains. Use Redis Cluster only when the data set or throughput needs sharding, and confirm with LiteLLM's documentation that your release supports cluster mode for the features you use. The check is a controlled failover: stop the primary and confirm Sentinel promotes a replica and reports the new primary.

  6. Point LiteLLM at the Redis endpoint

    Set the Redis host, port, password and TLS settings in the LiteLLM configuration for every pod, using the same values so all pods read and write the same counters. For Sentinel, supply the Sentinel addresses and the service name rather than a single host. Keep the Redis credentials in your secret manager and inject them at deploy time. The step is done when every pod starts, logs show a successful Redis connection, and no pod reports a local-only fallback.

  7. Verify that rate limits hold across pods

    Create a test virtual key with a low requests-per-minute limit, then send requests in parallel so that they land on different pods. Count the successful responses and compare them with the configured limit. If the count matches the limit within the expected concurrency window, the shared counter works. If the count is close to the limit multiplied by the number of pods, Redis is not shared and the configuration must be fixed before go-live. Record the test result with the pod names and timestamps.

  8. Verify that a revoked key fails on every pod

    Revoke the test virtual key through the proxy, then send requests to each pod in turn and confirm that every one returns an authentication failure. A pod that still accepts the key indicates that the revocation did not reach the shared state. Repeat the check after a Sentinel failover so you know revocations survive a primary change. Keep the test output as evidence for your operations and security reviews. The step is done when every pod rejects the revoked key in every run.

Choosing Redis Open Source, Valkey or a managed Redis service

Redis Open Source 8.0 and later can be used under a license you choose from three options: the Redis Source Available License v2 (RSALv2), the Server Side Public License v1 (SSPLv1) or the GNU AGPLv3. The license applies from the general availability release of Redis 8, which was published on May 2, 2025. Redis Ltd. has said it plans to keep Redis Open Source under AGPLv3, but your organization should not assume that the choice available today will hold for every future release.

  • Choice of license: Your team selects one license for the software you use, so the selection should be recorded in your open-source inventory.
  • Current line: Use a release in the Redis 8 line that LiteLLM documents as supported, and track patch releases, since security fixes are published separately.
  • Feature scope: The Redis Query Engine, JSON, time series and probabilistic structures ship with Redis Open Source, but LiteLLM needs only the core data types and pub/sub behavior it documents.
  • Platform limits: Redis Open Source runs on Linux and other Unix-like systems, and on Windows only through Docker.
  • Network service rule: If you modify Redis code and offer it as a network service, the license terms can require you to publish the modified source. Confirm this with counsel before any modification.

Confirm with counsel which license your organization will accept and whether the Redis version you select is one that LiteLLM currently supports.

Security controls for the Redis tier

The Redis tier holds shared rate-limit counters, budget state, cooldowns and cache for every LiteLLM worker, so a weak control here affects every key and team. The cards below cover access, transport, placement, service account scope, persistence files and secret handling. Confirm each control in the Redis product you choose, because managed services and self-managed installs expose these settings differently.

Authentication to Redis

Require a password or ACL credential for every client connection, and give LiteLLM its own user rather than the default account. Redis 7.0 or newer, which LiteLLM requires once more than one proxy instance runs, supports per-user ACLs, so the LiteLLM user can be limited to the commands and key patterns it needs. Confirm in your product whether the default user is disabled and how credentials rotate without restarting every pod.

LiteLLM Redis requirements

TLS for traffic in transit

Encrypt connections between the LiteLLM pods and Redis, since rate-limit and budget state crosses the network on every request. Ask whether your Redis endpoint accepts TLS connections, whether the client configuration in LiteLLM can be pointed at a TLS port, and who manages the certificate chain and its renewal. Test the connection path after every certificate change, because a failed handshake can look like a Redis outage from the gateway's side.

Private subnet placement

Place Redis in the same private subnet tier as the gateway, with no public IP address and no route from the internet. Allow inbound connections only from the security group or network policy that the LiteLLM pods use, and block administrative access from workstations except through a bastion or a privileged access path you already audit. Confirm that the managed service or cluster endpoint is reachable from the gateway subnets and not reachable from anywhere else.

Scoped LiteLLM service account

Restrict the LiteLLM Redis user to the commands the proxy uses for counters, cache and queued spend updates, and to the key prefixes it writes. Deny administrative commands such as configuration changes, key flushes and replication controls to that account. Ask the vendor for the exact command set LiteLLM issues in your version, and test that a flush or configuration command from the LiteLLM account is refused before go-live.

Backup and persistence file protection

Persistence files hold the queued spend updates that LiteLLM recommends preserving when the transaction buffer is used, so RDB snapshots and AOF files need the same protection as the database. Store them encrypted, restrict read access to the Redis operators, and set a retention period that your data handling policy allows. Confirm where backups land, who can restore them, and whether a restored copy can be replayed into a live cluster by mistake.

Credentials kept out of configuration

Keep the Redis password and TLS material in a secret manager and inject them into the LiteLLM pods at runtime, rather than writing them into config files, Helm values, or environment files committed to source control. Rotate the secret on a schedule and after any staff change, and confirm that the chosen secret manager integration works with your deployment method. Check that logs and the admin UI never echo the connection string.

Questions buyers ask about LiteLLM Redis cost, effort and sizing

What drives the cost of running Redis for LiteLLM?

The main driver is the throughput you expect, measured in requests per second, because that sets the vCPU and memory Redis needs. LiteLLM's sizing guidance suggests 2 vCPU and 8 GB up to 1K RPS, 4 vCPU and 16 GB from 1K to 5K RPS, and 8+ vCPU and 32 GB+ above that. Other cost components are the hosting model (self-managed, a cloud managed service or Redis Software), high availability with replicas or Sentinel, persistence storage, and network placement next to the gateway. Setup is a one-time cost, while the instances, managed service fees and support contracts recur. Ask any quote to break these out separately.

Can a small platform team size LiteLLM Redis on its own?

Yes, if the team has someone comfortable operating Redis and can measure real traffic. The sizing inputs are sustained request rate, peak bursts, whether the transaction buffer is enabled, and how many gateway workers and pods will share state. A team that lacks Redis operations experience usually finds the harder parts are eviction behavior, failover testing and persistence settings, not the initial instance choice. Confirm internally who will own patching, failover drills and capacity reviews after go-live.

How long does a Redis sizing and load test take?

No researched figure for this is available, so confirm the duration in writing with whoever runs the work. The length depends on how much production traffic data already exists, how many gateway pods and workers run, how many test scenarios are needed (rate limits, budget updates, cooldown behavior, failover), and whether the test environment matches production network paths. Ask for the list of test cases, the load profile used, the metrics captured and the acceptance criteria before agreeing a timeline.

What does the work need from our team before it starts?

The work needs recent request metrics (requests per second at average and peak, model call volume and worker counts), a description of which features use Redis (shared rate limits, budgets, cooldowns, cache, transaction buffer), and the planned gateway topology. It also needs network access from the gateway pods to the Redis endpoints, a test environment that can generate load, and a named contact who can approve Redis version and license choices. Agree how credentials and TLS settings will be handled before testing begins.

When is Redis cluster mode needed instead of Sentinel?

Sentinel covers high availability for a single primary with replicas, and it is the usual choice when data fits on one primary and the bottleneck is availability rather than capacity. Cluster mode is for datasets or throughput that one primary cannot hold or serve, which is the case when sizing moves into the largest tier. Sentinel deployments need at least three Sentinel instances for a robust setup, according to the Redis Sentinel documentation. Confirm with the LiteLLM sizing guidance whether your key prefixes and operations work correctly with cluster mode before choosing it.

Can Valkey replace Redis for LiteLLM?

Valkey is a practical alternative to check, because it is BSD-3-Clause licensed and was forked from Redis before the source-available license change. Valkey is compatible with Redis OSS 7.2 and earlier, and existing Redis client libraries connect without code changes. Migrating from Redis Community Edition 7.4 or later needs a different method than the one the Valkey migration guide covers. Confirm with LiteLLM's current documentation that the Redis version and features you plan to use are supported on Valkey before committing.

Which Redis license applies to a self-hosted LiteLLM gateway?

The license depends on the Redis version you install. Redis 7.2 and earlier use BSD-3-Clause, Redis 7.4 through 7.8 use the dual RSALv2 or SSPLv1 terms, and Redis Open Source 8.0 and later can be used under RSALv2, SSPLv1 or AGPLv3 at your choice. Your legal team should review the Redis licenses page against how your organization uses the software. Teams that offer a modified Redis as a network service have additional obligations, so confirm that position before deployment.

How DeployOpen scopes and delivers LiteLLM Redis work

DeployOpen plans, implements, tests, documents and supports self-hosted open-source platforms inside your own infrastructure, including the Redis layer that a multi-instance LiteLLM gateway depends on. Each engagement starts with a written scope that sets the Redis topology, sizing basis, persistence choice and handover deliverables before any build begins.

How we scope

  • Confirm how many LiteLLM proxy instances run and which features depend on shared Redis state.
  • Estimate requests per second from your own traffic data to choose the sizing tier.
  • Agree in writing whether the transaction buffer and Redis persistence are in scope.
  • Record the Redis license and edition decision, including Redis 7.x or 8.x or a Valkey alternative.

How we build

  • Deploy Redis 7.0 or newer in your cloud account, data center or restricted network, with the agreed topology.
  • Configure Sentinel or cluster mode, TLS and authentication according to the agreed design.
  • Test shared rate limits, cooldowns and revoked key behavior across several LiteLLM workers.
  • Run a load test at the agreed request rate and check that eviction does not occur in normal operation.

How we hand over

  • Provide a written sizing record with the chosen tier, memory limits, eviction policy and persistence settings.
  • Document the failover procedure, the restore steps and the Redis version upgrade path.
  • Walk your platform and security teams through the configuration and the load test results.

How we support

  • Engagements are fixed-scope, so changes to traffic or topology are scoped and quoted as separate work.
  • Ongoing upgrades, monitoring reviews and retesting are available as a retainer.
  • Confirm with DeployOpen which support response terms apply before the engagement starts.

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.