TECHNOLOGY

Ray Serve multiplexing: a cached-model count is not a memory limit

In this article
THE QUICK TAKE

Multiplexing limits cached model count per replica; model sizes, loading peaks and resource release still determine the memory envelope.

The cache fits small models but fails on a larger mix

A multiplexed endpoint serves several specialized classifiers. Its cache-count limit works with small models, then a newly introduced larger model causes a memory failure while the number of cached objects remains within the configured limit. Object count was used as if it were a byte budget.

Describe the allowed model population, not only the maximum count. A cache policy needs to be evaluated against which model combinations and loading transitions can actually occur in the running replica.

Multiplexing caches models by identity

The multiplexing guide describes model-ID-aware routing and loading models into replica-local caches. When the configured model-count limit is exceeded, the least recently used model is evicted.

This policy decides which cached identity to retain. It does not establish equal object sizes or reserve a fixed physical-memory slice for each loaded model. Routing locality also does not guarantee that every request finds an already-loaded model under all traffic conditions.

The loader owns the returned model object

The multiplexed API documents the asynchronous model loader and resource cleanup on unload. Ensure the returned object represents the resources whose lifetime must follow eviction, rather than leaving additional hidden owners elsewhere in the process.

Allocation lifetime provides related background on resource ownership. Dropping a cache entry is not a universal guarantee that every underlying framework allocation immediately disappears from the device’s reported usage.

Placement resources describe another layer

The resource-allocation guide explains assigning resources to replicas. Resource placement and cache-count policy are separate controls; neither alone proves that the largest supported model-loading transition will fit.

Reserved accelerator memory helps interpret runtime allocation behavior. Measure the resident mixture and temporary loading footprint rather than multiplying a representative small model’s size by the configured cache count.

Exercise eviction and reloading deliberately

Send a recognizable sequence of model identities that forces eviction, then request an evicted model again. Record load events, output identity and memory peaks, including a mixture containing the largest supported models.

A valid deployment policy explains which combinations fit, how resources are released and what happens during cache misses. LRU remains a useful reuse policy, but a configured count should not be advertised as an independent guarantee of accelerator-memory safety.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles