When CPU weight offloading makes vLLM CPU offloading worth trying
Use --cpu-offload-gb when a model is close to fitting on the GPUs you already have. The flag keeps part of the model weights in CPU memory on each GPU, measured in GiB, and the default of 0 means nothing is offloaded. vLLM's documentation points to memory-conservation options when a model is too large for one GPU, and CPU offloading is one of the ways to close a small gap without buying hardware. It is a fit tool, not a speed tool: every offloaded weight has to cross the PCIe or equivalent link again on the way to the GPU, so the decode path gets slower as the offload amount grows. Treat it as a way to make a deployment possible, then measure whether the latency is acceptable for your users.
Before you set a value, confirm three things against your own environment: the exact vLLM version you will run, since engine behavior changes between releases, the GPU memory each card reports after the model loads with the cache you need, and the host RAM available for every GPU's share. Start with a small offload amount, load the model, and check the memory headroom that remains for the KV cache, because offloading weights does not free space for long contexts or high concurrency. If the offload you need is large, or the workload has strict latency targets, the more likely answer is quantization or an additional GPU, which the sections below compare in detail.
The decision comes down to what you can afford to lose. If your traffic is batch-oriented, the latency penalty may be acceptable and the setup avoids a hardware purchase. If the service is interactive and users notice token speed, plan for a test that uses your real prompt lengths and concurrency before committing. Ask whoever maintains your vLLM platform to record the offload setting, the vLLM version and the measured results together, so that an upgrade or a hardware change does not silently alter the trade-off.
Configuration options and when each fits
This table compares the options that shape a decision about offloading weights with --cpu-offload-gb: no offload, a small offload to close a gap, a larger offload as a last resort, and quantization or more GPUs. Read each row against your measured memory headroom, and treat the offload as a fit check that you verify under real load before you commit.
| Option | Situation it suits | Main cost | What to verify |
|---|---|---|---|
| No offload (default 0) | The weights and KV cache fit comfortably on the GPUs you have, or the model is well under available memory | No added latency from moving weights, but the model may not start at all if it is too large | Startup succeeds and the KV cache leaves enough room for your target concurrency |
| Small offload to close a memory gap | The model is only slightly larger than GPU memory and a few GiB of weights can move to CPU memory per GPU | Weights are fetched from CPU memory during forward passes, which adds latency and lowers throughput | Time to first token and per-token latency against your targets, and that host RAM covers the offloaded amount on every GPU |
| Larger offload as a last resort | A large share of weights must sit in CPU memory because no smaller option fits the hardware | Throughput drops sharply as more weights cross the PCIe or interconnect path, and host memory pressure increases | Load testing at realistic concurrency, and whether a quantized or multi-GPU layout would meet the same goal at lower cost |
| Quantized weights | The model has a quantized checkpoint that keeps acceptable quality for your workload and your GPU generation supports the format | Checkpoint preparation and an accuracy review, with no offload latency once the model fits on GPU | Output quality on your own evaluation set and which quantization formats your GPU supports |
| Additional GPUs with tensor parallelism | The workload needs low latency or high throughput that offloading cannot deliver, or the model must stay fully on GPU | More accelerator capacity to buy or rent, plus inter-GPU communication overhead | Interconnect between GPUs, the parallelism layout and the NCCL and CUDA behavior on your hosts |
| Memory-conservation settings in the troubleshooting guide | The model fails with out-of-memory errors and you have not yet tried the lower-cost settings | Usually a smaller context length or batch limit, which reduces capacity for some requests | Which memory-conservation option the troubleshooting guide recommends for your error, and its effect on your traffic |
How to set up offloading and verify it before production
This sequence takes a model that is slightly larger than GPU memory from a sizing estimate to a measured result, with a checkpoint at each stage so you know whether offloading is the right fix before users depend on it. The output is a tested offload value, a working OpenAI-compatible endpoint and a latency and throughput record to compare against your alternatives.
Confirm the model and vLLM release
Confirm the exact model checkpoint, its precision and the vLLM release you will run, and pin that release in your build so it does not change under you. Check the model's release notes and the vLLM release notes for support of that architecture. Done means you have a written record of the checkpoint identifier, its hash or revision, the vLLM version and the accelerator driver stack, and an engineer has confirmed the model architecture loads on that version in a test environment.
Measure free GPU memory and weight footprint
Record the total and free memory on each GPU that will serve the model, with no other workloads running, and the size of the model weights as they will be loaded on each GPU. Compare the two to find the shortfall. Remember that KV cache and activations also need memory, so a weight shortfall of a few GiB is only the starting point. Done means you have a per-GPU table of available memory, weight size and the gap, and you have confirmed the gap is small enough that offloading is a reasonable option rather than a sign you need more GPUs.
Set cpu-offload-gb in small increments
Set
--cpu-offload-gbto a value that covers the measured gap plus a margin, in GiB per GPU. The default is 0, which means no offloading. Start with the smallest value that should fit and increase it only if the server fails to start or runs out of memory. Each increase moves more weights into CPU memory, so it lowers GPU headroom for KV cache and increases per-token transfer work. Confirm that the host has enough RAM for the total offloaded weights across all GPUs on that node, and record the final value with the reason for it.Start the server with vllm serve
Start the model with
vllm serveusing the offload value and the other arguments your deployment needs, such as the served model name, context length and parallelism settings. Watch the startup log for the offload allocation, any out-of-memory messages and the final KV cache size that vLLM reports. Done means the server reports that it is ready and the logged KV cache is large enough for your expected concurrency and context length. If startup fails, reduce the offload value or the context length and try again, and keep a note of what changed.Check the model answers chat and completion requests
Send a short test request to
/v1/completionsand to/v1/chat/completions, and check that each returns a well-formed response. The chat endpoint needs a chat template, so confirm the model ships one or supply it with--chat-templatebefore you test. Use a fixed prompt and compare the output against the same model run without offloading, or against a reference output from the model's own documentation, to confirm the offloaded weights produce sensible text. Done means both endpoints return complete responses and the outputs are consistent with the baseline.Benchmark against a non-offloaded or quantized baseline
Run the same load test against three configurations where possible: the offloaded model, a quantized version of the model on the same hardware, and the model on an additional GPU if you have one. Measure time to first token, per-token latency, requests per second and token throughput at the concurrency you expect in production. Vary the concurrency and prompt length, since offloading costs are usually paid on every decode step. Done means you have a table of results and a decision: whether the latency cost is acceptable for the workload, or whether quantization or another GPU is the better answer.
Confirm metrics and sign off for production
Check that the
/metricsendpoint returns Prometheus data for request counts, token throughput, latency histograms and KV cache use, and that your monitoring picks these up. Keep/metricsand the other operational endpoints off the public path using a reverse proxy that allowlists only user-facing routes. Record the final configuration, the benchmark results and the alert thresholds for KV cache pressure, then have the accountable owner approve the setup. Done means the configuration is versioned, the dashboards show live data and the approval is recorded before real traffic reaches the server.
Choosing offloading, quantization or another GPU
Offloading, quantization and a second GPU each close the gap between model size and GPU memory in a different way, and each one moves cost into a different place. The cards below cover the conditions that favor each option and the measurements that should decide between them before you commit hardware or a model format.
Small gap that offloading can close
When the model's weights overflow GPU memory by a modest amount, --cpu-offload-gb can hold the remainder in CPU memory, set per GPU in GiB with a default of 0. Check that the host has enough free RAM for the offloaded amount on every GPU, plus headroom for the rest of the process. Measure time to first token and output tokens per second at your real concurrency, because the offloaded layers are transferred on each forward pass.
- Default offload
- 0 GiB
Gap too large for offloading
When the overflow is large, the share of weights read from CPU memory grows and latency can become unacceptable for interactive use. Offloading is a way to make a model start and serve, not a way to add capacity. Treat a large gap as a sign to change the hardware or the model format, and confirm with a load test that latency stays within your target at expected concurrency before accepting offloading as a production setting.
Quantized checkpoint that fits natively
A quantized checkpoint of the same model may fit entirely in GPU memory with no CPU transfers. Confirm that the format is supported on your GPU generation, the accuracy is acceptable for your evaluation set, and the KV cache still leaves room for your context lengths. Compare accuracy on your own tasks before switching, since a smaller footprint does not guarantee the same output quality.
Second GPU with tensor parallelism
Splitting the model across two GPUs in one node with tensor parallelism removes the need for CPU offloading, at the cost of a second accelerator, its power and rack space, and interconnect traffic between cards. Ask your hardware team whether the node has the GPU interconnect and power budget for this layout. Measure throughput and latency on both configurations so the cost of the extra card is weighed against the performance it actually buys.
Parallelism and scalingStrict latency targets
Workloads with tight time-to-first-token or per-token latency targets rarely tolerate weight transfers from CPU memory on the critical path. For these services, plan for enough GPU memory from the start, or use a quantized or larger accelerator. Set the latency target in writing before testing, then run the benchmark at peak concurrency, because offloading penalties often appear only under load.
Where weights sit and how requests reach them
The diagram starts with a client request arriving at the vLLM API server, which hands work to the engine running on each GPU. Each GPU holds the part of the weights it keeps in GPU memory, while the offloaded share sits in host CPU memory and is moved across the PCIe link as the forward pass needs it. The trust boundary separates the API server and the host memory it uses. Check that the endpoints reachable by clients are limited to the ones meant for users, and that the metrics endpoint is not exposed to them.
Request path, GPU-resident weights, CPU-offloaded weights and the metrics endpoint.
Security and operational considerations for offloaded deployments
Offloaded weights move memory pressure from the GPU into host RAM, so the security and operations work changes with it. The cards below cover host memory, endpoint exposure, access control and the metrics that show whether offloading is hurting latency or cache capacity.
Host memory sizing and contention
Offloaded weights sit in CPU memory on every GPU worker, so the host must hold the offload total for all GPUs plus the other processes it runs. Ask who else shares the node, such as log shippers, sidecars, other model servers or a database, and size the host with those included. Check for swap use under load, because paging weights out of RAM will hurt latency far more than the offload itself.
vLLM troubleshootingKeep metrics and admin endpoints private
The /metrics and /health endpoints, along with pause, resume and abort controls, are not covered by --api-key. Route them only to your monitoring network and keep them off any public load balancer. Confirm this with a request from outside the trusted network before go-live, since a single exposed path can reveal load patterns and let an outsider interrupt serving.
vLLM security docsLimits of the API key
The --api-key option protects the /v1, /v2, /inference and /cohere paths, but it is not a complete access control. The vLLM security docs warn against relying on it alone. Treat it as one layer beneath user authentication, and verify that /invocations is not reachable by users who should not call the model.
Reverse proxy allowlist
Place a reverse proxy in front of vLLM and allow only the paths meant for users, such as the chat and completions endpoints your applications call. Deny everything else by default. Test the allowlist with each unlisted path, including the control endpoints, because a route added in a later release can appear without a matching rule in your proxy.
KV cache and latency in Prometheus
vLLM exposes Prometheus metrics covering request counts, token throughput, latency histograms and KV cache use. Offloading shrinks the GPU space left for the KV cache, so watch cache utilization and time-to-first-token together. Ask your team to set histogram buckets that match your latency targets, and alert when cache use stays near its ceiling.
vLLM metrics docsTest under production concurrency
Offloading changes memory pressure, so a single-request test will not show how the server behaves under load. Run load tests at the concurrency, prompt lengths and output lengths you expect in production, while recording host memory, PCIe traffic and the metrics above. Repeat the test after every vLLM upgrade or change to the offload value.
Questions buyers ask about offloading cost, effort and staffing
How much effort does a team need to test CPU weight offloading?
Expect a bounded test cycle rather than an open-ended project: one engineer or a small pair can usually stand up a single-node test, load the model with a chosen --cpu-offload-gb value, and measure startup, time to first token and throughput. The effort grows with the number of configurations you need to compare, the number of GPUs in the node, and how many workloads you must represent in the benchmark. Plan time for reading the engine arguments, reconciling the vLLM version you run with the flags you plan to use, and recording results so the decision can be reviewed later. Confirm the scope of testing with your own team before you commit to a number.
What drives the cost of running vLLM with offloaded weights?
vLLM is free under Apache-2.0, so the cost comes from four places: GPU or other accelerator capacity, host memory on each server, engineering time for setup and benchmarking, and ongoing operations. Offloading moves part of the weight footprint into CPU memory, which can let a model run on hardware you already own, but the host needs enough RAM to hold the offloaded share for every GPU it serves. Slower responses can also mean you need more replicas to meet the same load, which raises the capacity bill. Ask your team to model these four components side by side with the cost of a second GPU before choosing.
Can our own engineers do the offloading work in-house?
Often yes, if you already run GPU servers and have someone comfortable with Python services, container images and Linux memory limits. The in-house work is mostly configuration, benchmarking and monitoring: choosing the offload amount per GPU, confirming the model loads, and watching latency and KV cache use through the /metrics endpoint. A team with no GPU operations experience should expect a learning curve, and the people who understand the host memory layout and the serving stack should be involved in the decision. DeployOpen plans, implements and documents self-hosted platforms in your own infrastructure, so a partner can take on the build while your staff keep ownership.
How long does validation take for a larger model or a heavier load test?
Validation time depends mainly on model size, the number of offload settings under test, and how closely the load test matches production. A larger model takes longer to load on every restart, so each test cycle is slower, and a heavier load test needs more time to run and to read the results. Plan separate runs for cold start, steady traffic and peak traffic, because offloading often shows its cost under concurrency rather than in a single request. No duration is given here because it depends on your hardware and workload; ask any vendor or partner to state the test matrix and the time each step takes before you agree to a plan.
What should a fixed-scope quote for offloading include?
A fixed-scope quote should list the written deliverables, the environments covered and the exact test matrix. Ask for the following items to be stated:
- The vLLM version and the model and checkpoint to be served
- The GPU and host configurations in scope, including host memory per node
- The offload settings to be tested and the metrics to be recorded
- The load profiles used for validation and the acceptance criteria
- Documentation of the chosen configuration and the rollback path
- What is excluded, such as hardware procurement, model licensing or application changes
- Support terms after handover, and whether retesting after a vLLM upgrade is included
DeployOpen agrees scope, deliverables and timelines in writing before work starts, and does not publish a price list, so a quote follows from this written scope.
When should we stop offloading and buy more GPU capacity?
Stop offloading when measured latency or throughput no longer meets the workload's targets, when the host memory needed for offloading starts to compete with other services, or when restarts and cold loads cause unacceptable downtime. Offloading suits a model that is slightly too large for one GPU, and the trade-off gets worse as the offloaded share grows. Quantization, a second GPU with tensor parallelism, or a different model size may then be the better answer. Compare the recurring cost of extra capacity with the engineering and operating effort that offloading keeps requiring, and decide with measured data from your own load tests.
What makes offloading cheaper or more expensive to run
vLLM has no paid edition, so the cost of CPU weight offloading is the cost of the infrastructure and the people around it. The software itself is licensed under Apache-2.0, according to its GitHub repository, so the budget lines are GPU or other accelerator capacity, the host servers that supply CPU memory for the offloaded weights, the engineering time to benchmark and operate the server, and the upgrades that follow vLLM's release cadence. The release cadence matters here: vLLM ships new minor releases about every two weeks, so a configuration tuned for one release needs retesting when you move to another. Offloading also changes the hardware you buy. Each GPU that offloads weights pulls them over the host link on every forward pass, so the host memory size, the CPU-to-GPU bandwidth and the number of GPUs you run all shape both the latency you get and how many servers you need.
Costs fall into two groups. One-time costs include the benchmark work that finds a workable --cpu-offload-gb value per GPU, the hardware validation, and the initial integration with your gateway and monitoring. Recurring costs include accelerator and host capacity held for steady traffic, the time spent re-benchmarking after vLLM or driver upgrades, and the on-call effort for latency regressions that offloading makes more likely. Offloading tends to be the cheaper option in capital terms when it lets a model run on hardware you already own, but it can be the more expensive option in operating terms if it forces lower throughput and you need more replicas to meet the same service level. Ask any partner or internal team to show both figures side by side.
When you request a quote, ask for the scope of benchmarking, the hardware and host memory assumed, the number of vLLM upgrades included in the support period, and who owns the regression tests after handover. Confirm the accelerator and host specifications with your hardware vendor, since vLLM's own documentation does not set a price or a capacity figure for your environment. A quote that omits the re-benchmark cost for future releases is incomplete.
How DeployOpen scopes and delivers offloading work
DeployOpen treats CPU weight offloading as a configuration decision that needs measurement before it goes into production. We scope the model, hardware and latency targets in writing, build and test the offloaded setup in your infrastructure, and hand over the configuration with the evidence your team needs to run it.
How we scope
- Confirm the model, GPU models, GPU count and CPU memory available on each host before choosing any offload amount.
- Agree the latency and throughput targets the workload needs, so offloading is judged against measured results.
- Compare offloading with quantization and additional GPUs, and record the option chosen and the reasons in the written scope.
How we build
- Configure the --cpu-offload-gb value per GPU, starting from a measured baseline and adjusting in documented steps.
- Benchmark time to first token and token throughput with and without offloading on your hardware and representative prompts.
- Check memory headroom for the KV cache, host RAM use and the effect of concurrent requests on the offloaded setup.
How we hand over
- Deliver the launch configuration, the chosen offload values, and the benchmark results that justified them.
- Document the operating limits, including the latency cost observed, the conditions that would call for a larger GPU or quantization.
- Walk your platform and operations team through restarts, configuration changes and how to repeat the measurements.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and re-benchmarking after vLLM release changes are available as a retainer.
- Quotes follow from the written scope, so ask for the hardware, benchmark and documentation items to be listed separately.

