What vLLM sleep mode does and when teams need it for GPU memory
vLLM sleep mode releases GPU memory held by a running vLLM server so another workload can use the device, without stopping the process. A team on a shared GPU host can put the server to sleep, load or run something else, then wake the same server back up. The choice between the two sleep levels decides what is kept, what is discarded, and how much work the server must do on wake-up.
Sleep level 1 offloads the model weights to CPU RAM and discards the KV cache. The weights can be restored from host memory on wake-up, so this level suits a team that wants to switch away from a model for a while and come back to it. Sleep level 2 discards both the weights and the KV cache and keeps only the model buffers. Because the weights are not kept anywhere, this level fits switching to a different model or loading updated weights into the server. A common case is a reinforcement learning loop, where a training step produces new weights that must be loaded before the next rollout. Confirm the CPU RAM available on the host before choosing level 1, since the offloaded weights must fit there.
Sleep mode is a development-oriented control path, not a general cost-saving switch. The feature needs --enable-sleep-mode, which defaults to False and is supported only on CUDA and HIP platforms, together with the VLLM_SERVER_DEV_MODE=1 environment variable before the sleep endpoints are available. Check the platform support for your accelerator in the vLLM engine arguments reference before planning around it. Treat the sleep, wake-up and status endpoints as operator tools that belong behind your own administrative access, and confirm with your serving team how those controls will be called and logged before any production use.
Sleep levels, flags and endpoints compared
This table compares what each sleep level keeps and discards, then lists the flag, environment variable and endpoints that must be set before any sleep control works. Read the level rows to choose a sleep depth, and the control rows to confirm the server is configured correctly and kept off the public API.
| Item | Details | What to confirm |
|---|---|---|
| Sleep level 1 | Offloads model weights to CPU RAM and discards the KV cache. Weights can be restored without reloading from storage. | Enough host RAM exists to hold the offloaded weights for every model you keep warm. |
| Sleep level 2 | Discards both model weights and the KV cache, keeping only model buffers. Weights must be reloaded when the server wakes. | Your workflow loads new weights on wake, such as switching models or updating weights during a training loop. |
| --enable-sleep-mode | Engine argument that enables the sleep feature. Defaults to False and is supported only on CUDA and HIP platforms. | Your GPUs run on NVIDIA CUDA or AMD HIP, not on another accelerator or CPU-only host. |
| VLLM_SERVER_DEV_MODE=1 | Environment variable that turns on the development endpoints, including the sleep endpoints. | Set on the server process only where needed, and confirm it is absent from production images and manifests. |
| /sleep | Puts the engine to sleep at the level you request, releasing GPU memory without stopping the server process. | Only trusted operators or internal automation can reach it. It must not be routed to end users. |
| /wake_up | Restores the engine after sleep so it can serve requests again. | Plan for reload time at level 2 and confirm GPU memory is available before waking the engine. |
| /is_sleeping | Reports whether the engine is currently asleep, so a control script can check state before acting. | Your orchestration checks this state before sending traffic or switching models. |
How to enable sleep mode on a vLLM server
This sequence takes a vLLM server from a normal serving state to a sleeping state that releases GPU memory, then back to serving, with a check at each step so the team knows the change took effect. Run it on a non-production host first.
Confirm the GPU platform supports sleep mode
The engineer checks the accelerator platform on a non-production host before changing anything. The sleep mode flag is supported only on CUDA and HIP platforms, and it defaults to off. Confirm the GPU vendor stack and driver version against the vLLM installation guide for the release you run, and record the result. The step is done when the host reports an NVIDIA CUDA or AMD HIP stack and the team has noted the vLLM version in use.
Enable the flag and development mode
On the test host, the engineer sets the sleep mode engine argument and the development mode environment variable, VLLM_SERVER_DEV_MODE=1, in the launch configuration. The sleep endpoints do not exist without both settings. Check the engine argument reference for the exact flag name in your release. The step is done when the launch command or service file shows both settings and nothing else in the configuration has changed.
Start the server and confirm it serves requests
The engineer starts vllm serve with the test model and sends one completion request through the OpenAI-compatible endpoint. This establishes a baseline before any memory is released. Keep the server bound to a private address on the test network. The step is done when the request returns a normal response and the team has recorded the GPU memory in use from the host's monitoring tool.
Check sleep state with the status endpoint
The engineer calls the /is_sleeping endpoint on the test server. A running server that has not been put to sleep should report that it is awake. This confirms the development endpoints are reachable on the test host and that the server is in the expected state. Do not expose this endpoint through any public route. The step is done when the response shows the server is not sleeping.
Sleep the server at the chosen level
The engineer calls the /sleep endpoint at the level selected for the workload. Level 1 moves model weights to CPU memory and discards the KV cache. Level 2 discards both the weights and the KV cache and keeps only model buffers, so it suits a model switch or a weight update that will load new weights. Record the level used. The step is done when the sleep call succeeds and /is_sleeping reports sleeping.
Verify GPU memory dropped
The engineer compares GPU memory on the host with the baseline recorded earlier, using the same monitoring tool. Level 1 should show memory freed on the GPU, while CPU RAM use rises because weights are offloaded there. Level 2 should free more GPU memory because weights are discarded. Confirm the drop with your own measurements, since the amount depends on the model and hardware. The step is done when the freed memory is recorded for each level tested.
Wake the server and confirm it serves again
The engineer calls /wake_up and then checks /is_sleeping, which should report that the server is awake. After a level 2 sleep, the weights must be reloaded or supplied before requests succeed, so confirm that step in the procedure for your setup. The engineer then sends the same test request used at the baseline. The step is done when the response matches the baseline behavior and memory use returns to the expected range.
Document results before any production decision
The engineer writes down the vLLM version, flags, level, memory figures before and after sleep, wake timing observed and any errors. These notes decide whether the team repeats the test under a real workload and whether the development endpoints can stay off the public path. Production hosts should only receive the change after the same sequence passes on a non-production host with the same versions. The step is done when the record is filed with the change request.
How the sleep and wake cycle changes memory and request handling
A model switch or training loop on a shared vLLM server follows a fixed sequence: in-flight requests finish or are stopped, the server enters sleep, GPU memory is released, the weights are reloaded or updated, the server wakes, and serving resumes. The order matters because the sleep call releases memory only once the engine is idle, so the calling process should drain traffic at the proxy before it issues the call. Plan for the fact that a sleeping server is not serving, and that the caller, not vLLM, decides when traffic returns.
The sleep level sets what you pay on wake. Level 1 offloads model weights to CPU RAM and discards the KV cache, so wake-up restores weights from host memory. Level 2 discards both weights and the KV cache, keeping only model buffers, so the weights must be loaded again or supplied by an update, which is the expected path for switching models or pushing new weights from a training run. Confirm the host RAM headroom for level 1 on each node, because offloaded weights occupy CPU memory for as long as the server sleeps. The vLLM sleep mode documentation describes these behaviors, and the wake-up time is something to measure on your own hardware rather than assume.
Requests that arrive during sleep need a defined response. The sleep and wake endpoints are development endpoints, so your gateway should hold or reject user traffic while the server is asleep, and your team should decide whether queued requests are retried or returned as errors. Check the vLLM sleep mode documentation for the current behavior of in-flight requests before you build the switch logic, and test the sequence end to end with a sleep, wake and request cycle in a staging environment that matches production GPUs.
Where the development endpoints sit relative to users
The diagram starts with users and applications sending OpenAI-compatible requests to a reverse proxy that allowlists only the endpoints meant for them. The proxy forwards those calls to the vLLM server, where the model runs on the GPU and offloaded weights can sit in CPU RAM after sleep level 1. The administrator path reaches /sleep, /wake_up and /is_sleeping directly on the server, outside the public route. Check that the trust boundary holds: the proxy should block every development endpoint, and nothing on the user side should reach the server's control paths.
User traffic passes a proxy allowlist, while administrators reach sleep endpoints directly.
Why development endpoints must stay off the public API
Sleep mode works through endpoints that change what the server holds in GPU and CPU memory. Those endpoints sit beside the user-facing API on the same server, so the exposure decisions below need to be made before the feature is switched on.
Sleep endpoints are development endpoints
The routes /sleep, /wake_up and /is_sleeping only exist when --enable-sleep-mode is set and VLLM_SERVER_DEV_MODE=1 is present. The vLLM docs state that development endpoints should not be exposed to users. Treat them as operator tooling for the team that runs the server, and confirm with your own configuration that a production image does not set the development flag by default.
The API key does not cover every control route
The --api-key option protects only the /v1, /v2, /inference and /cohere paths. It does not protect /invocations, /pause, /resume, /abort_requests, /metrics or /health. A caller who can reach /pause or /resume can change server behavior without holding the key, so a key alone cannot be the control for these routes.
Allowlist user endpoints at the proxy
The vLLM security docs recommend a reverse proxy that forwards only the endpoints meant for users. Configure the proxy to pass the OpenAI-compatible paths and deny everything else by default, including sleep, wake, pause, resume and abort routes. Test the rule from outside the cluster and from any internal network segment that can reach the pod or host port, since a denied path on the public listener is still open on the bare port.
Isolate multi-node traffic
The vLLM security docs state that communication between nodes in a multi-node deployment is insecure by default, with no authorization or encryption. Sleep and wake calls that reach a worker node change the same model state as the head node, so the inter-node network must be isolated from users and from any route that can reach the control endpoints. Confirm the isolation with a network scan from a user subnet.
Record every model state change
Each sleep, wake and weight-update action changes what the server can serve, and the metrics endpoint at /metrics exposes request counts and throughput but does not by itself record who triggered a change. Put the control routes behind an authenticated admin path, log each call with the caller identity and time at the proxy or gateway, and keep those logs with the rest of your change records so a serving change can be traced.
Questions teams ask before using vLLM sleep mode
What does a vLLM sleep mode setup cost?
vLLM itself has no paid edition and is licensed under Apache-2.0, so the cost comes from GPU or other accelerator capacity, the surrounding infrastructure, implementation work and the people who operate the server. Sleep mode adds configuration, a reverse proxy rule set and testing of the wake and sleep cycle on your hardware. Ask a partner for a quote that separates one-time work (design, configuration, proxy rules, testing and documentation) from recurring work (version tracking, retesting after upgrades and proxy maintenance). Also ask who pays for the GPU hosts and whether they stay reserved while the server sleeps, because sleeping releases GPU memory but the hardware is still billed.
How long does it take to set up sleep mode on vLLM?
The duration depends on how many models are involved, whether the GPU hosts already run vLLM, and how much proxy and access control work the shared server needs. Sleep mode itself is enabled with a server flag and an environment variable, so the configuration step is short. Most of the time goes to deciding which endpoints users may reach, building the allowlist, testing sleep and wake under real load, and writing the runbook for model switching or training loops. Ask for a timeline in the written scope with named milestones and a list of what the client must have ready on day one.
What must our team provide before a sleep mode engagement starts?
You need GPU hosts that run CUDA or HIP, since sleep mode is supported only on those platforms, along with a model or set of models to test with. Provide administrative access to the servers and the container or process manager, plus access to the reverse proxy or API gateway where endpoint rules are set. Name an owner for the proxy, a person who can approve endpoint exposure decisions, and a test model that matches production sizes. Confirm network paths between the proxy, the vLLM server and any monitoring system before work begins.
Can our in-house team set up sleep mode without a partner?
Yes, if the team already operates vLLM and has someone who can manage GPU memory, container configuration and a reverse proxy. The configuration itself is small, so the risk lies in the surrounding work: leaving development endpoints reachable through the public API, testing wake behavior under load, and keeping the proxy rules aligned with each vLLM release. An in-house team that has not run vLLM in production should first build a baseline deployment and then add sleep mode. A partner is most useful when you need a documented, reviewed setup in a short window or an independent check of exposure.
What recurring work follows a sleep mode deployment?
Two recurring tasks matter most. The first is version tracking: vLLM ships new minor releases about every two weeks, for example v0.31.0 on October 5, 2026, and sleep mode behavior, flags and endpoints can change between releases, so each upgrade needs a retest of sleep, wake and the proxy rules. The second is proxy maintenance: the vLLM security documentation says the --api-key option does not protect every endpoint, and it recommends a reverse proxy that allowlists only user-facing endpoints, so that allowlist must be reviewed whenever routes change. Ask a partner whether these tasks are included in a retainer and how often they would retest.
Why must the sleep endpoints stay off the public API?
The sleep, wake up and sleep status endpoints are development endpoints that require the server to run with development mode enabled, and the vLLM documentation says they should not be exposed to users. The --api-key option does not cover every operational endpoint, so a request that reaches the server directly could change GPU memory state for every user on the box. Keep these routes off the public listener, block them at a reverse proxy that allowlists only user-facing paths, and restrict access to administrators on an internal network. Confirm the exact endpoint list against the current vLLM documentation for your release.
When is sleep mode the wrong answer?
Sleep mode suits a shared server that switches between models or pauses GPU use between training or evaluation steps. It is the wrong choice when a model must answer user traffic with low latency at all times, because waking a model takes time and an unexpected wake under load can cause delays. If the models do not fit GPU memory even when the others are offloaded, quantization, a larger GPU or a separate server may be the better answer. If the workload needs strict tenant separation, separate server instances or a gateway may be a better fit than one process with sleep controls. Ask a partner to compare these options against your latency, memory and isolation targets before committing to sleep mode.
Choosing sleep mode over a restart or a second server
Sleep mode is the right tool only when the GPU memory needs to be returned to other work while the server process stays alive. If a restart costs little and the workload tolerates a short outage, a restart is simpler, because it avoids the dev-mode endpoints, the extra flags and the operational rules that come with them. The same applies when the model rarely changes. A second GPU, or a separate vLLM instance per model, is usually the simpler answer when each model has its own dedicated capacity and the hardware budget allows it, since every instance keeps its own weights resident and no one has to reason about what is currently asleep.
Sleep mode fits a narrower case: one host you control, one or a few GPUs, and a loop that alternates between models or repeatedly updates weights. Level 1 offloads model weights to CPU RAM and discards the KV cache, so the wake-up path restores weights from host memory. Level 2 discards both weights and KV cache and keeps only model buffers, which suits a switch to a different model or a weight update that will overwrite the old weights anyway. Confirm in your own environment how much CPU RAM the offloaded weights need and how long wake-up takes on your hardware, because the documentation describes the behavior but does not give a general timing for it.
Before choosing, check the platform constraints. The --enable-sleep-mode flag is supported only on CUDA and HIP platforms and defaults to False, so teams on other accelerators need a different approach. The control endpoints also require VLLM_SERVER_DEV_MODE=1, which is why they must stay off the public API. Decide who is allowed to call them before the loop goes live, and plan the proxy rules that keep them internal. The vLLM sleep mode documentation is the place to confirm the current behavior for your vLLM version.
How DeployOpen works on this
DeployOpen starts by deciding whether sleep mode fits the workload, then builds it on a self-hosted vLLM server inside infrastructure you control. The work covers the flags, the proxy rules that keep development endpoints private, and the checks that show the GPU memory is actually released and restored.
How we scope
- Confirm the GPU type and driver stack, since sleep mode is supported only on CUDA and HIP platforms.
- Document the model switching or reinforcement learning loop that needs memory released between runs.
- Agree in writing which sleep level, serving flags and proxy rules are in scope, as engagements are fixed-scope.
How we build
- Set --enable-sleep-mode and the development mode variable on a staging server, then record the baseline memory use.
- Test sleep level 1 and level 2 against your model sequence, checking CPU RAM use and wake-up behavior.
- Configure the reverse proxy so /sleep, /wake_up and /is_sleeping are reachable only from the trusted control path.
How we hand over
- Deliver the configuration, proxy allowlist and startup scripts as versioned files in your repository.
- Provide a runbook covering sleep, wake-up, failed transitions and how to confirm the endpoints are closed to users.
- Walk your platform and security teams through the test results and the evidence for the access controls.
How we support
- Retest sleep behavior after each vLLM minor release, which ships about every two weeks, before you upgrade.
- Review proxy rules and endpoint exposure whenever the serving configuration or network layout changes.
- Offer ongoing support, upgrades and continuous testing as a retainer, priced from the written scope.

