Start with the memory budget
A model can be too large for a GPU before it generates a single token. Weight storage is one part of the problem: the runtime also needs temporary buffers, cached attention state, and space for the display and other applications. Quantization reduces the representation size of selected tensors. It can make a model loadable while leaving more room for useful work, but the complete allocation still decides whether a request succeeds.
The first calculation is deliberately simple: parameter count multiplied by bits per parameter, divided by eight. For a hypothetical dense model with exactly three billion parameters, all stored uniformly, 16-bit weights require 6 billion bytes, about 5.59 GiB. Eight-bit storage is about 2.79 GiB; four-bit storage is about 1.40 GiB. These are calculated weight-only lower bounds. Scales, group metadata, tensors retained at higher precision, and runtime allocations increase real usage.
Use the calculator to explore this arithmetic. Its reserve is a user-entered allowance, not an automatic estimate of any particular serving engine. A positive remainder does not establish that a model fits. The cache calculation must come from the actual architecture, context length, precision and concurrency.
Explore a weight-only budget
Calculated illustration: no GPU is contacted. The allowance must cover cache, buffers, metadata and other allocations; this calculator does not predict those costs or throughput.
What changes during GPU processing
Lower precision reduces the number of bytes needed to represent selected weights. The GPU may transfer fewer bytes from device memory for those weights, and some hardware and kernels perform low-precision arithmetic directly. Other paths unpack or convert values during execution. The resulting speed depends on the supported kernel, tensor shapes, batch size and the balance between arithmetic and memory traffic.
Consequently, a smaller checkpoint and a faster request are separate outcomes. A low-concurrency decoding workload can behave differently from processing a long prompt or a large batch. Compare the same prompts, output limits and concurrency on the same machine. Report time to first token separately from generation speed, and include end-to-end latency. A single best-case tokens-per-second number hides the differences a reader needs to understand.
The practical benefit may simply be avoiding an out-of-memory failure. Another benefit may be room for more concurrent requests or a longer context, provided the remaining memory supports their cache. Neither follows automatically from the weight compression ratio. Reserve headroom and test the worst request shape you intend to support.
Choose a format the runtime can execute
Weight precision, activation precision and attention-cache precision are different choices. A four-bit weight format does not imply a four-bit cache. Record the exact format rather than describing everything as a four-bit model. The format must match the checkpoint, GPU architecture, serving implementation and installed software version.
vLLM documents multiple quantization backends and a hardware compatibility matrix. Check that matrix for the intended GPU and backend before downloading a large checkpoint. A filename that includes a precision label is not sufficient evidence that the chosen engine has a compatible execution path. Consult the checkpoint documentation as well as the runtime documentation, and retain the model license and any required attribution. Source: vLLM quantization documentation.
For a Transformers-based workflow, bitsandbytes provides quantized linear layers and integration for eight-bit and four-bit loading. This is one implementation choice, not a universal conversion recipe for every serving stack. Loading a model successfully through one library does not establish that an exported checkpoint can be served by another. Source: Transformers bitsandbytes documentation.
Fine-tuning is a separate memory problem
Inference generates outputs with fixed model parameters. Training introduces gradients, optimizer state and saved intermediate activations. Do not use an inference weight estimate as a training memory forecast. Even a small adapter needs memory for the forward and backward pass; sequence length and microbatch size matter.
QLoRA combines a frozen quantized base model with trainable low-rank adapters. Its paper describes backpropagation through the frozen four-bit model into adapters, alongside techniques for reducing memory overhead. That makes an adapter experiment a sensible direction to investigate on a limited GPU. It does not prove that a particular model, sequence length or training configuration fits in eight gigabytes. Source: QLoRA paper.
For a local experiment, begin with a small base model and short synthetic examples. Stop the training process before starting the serving engine, so the two processes do not compete for the same device memory. Keep the original baseline and the adapter version available for comparison. An adapter that memorizes generated training templates is not evidence of broader capability.
Test whether the savings are useful
Define a generic task before choosing the winning configuration. One option is to map synthetic symbol sequences into a fixed JSON schema using explicit labeling rules. Generate a held-out set from different templates, freeze it before tuning, and keep decoding settings identical across runs. This provides a reproducible check without publishing personal or industry-specific data.
| Question | Evidence to record |
|---|---|
| Does it fit? | Peak device memory, context limit, concurrency, and allocation failures |
| Is it correct? | Held-out task accuracy, JSON validity and example failure categories |
| Is it responsive? | Warmup policy, time to first token, output speed and p50/p95 latency |
| Can it be reproduced? | Model revision, precision, package versions, seed, prompt lengths and sample count |
Compare a higher-precision baseline with the quantized version only where both can run. If the baseline does not fit locally, record that fact rather than inventing its latency. A smaller model can supply a separate local reference, but it is a different comparison. State what changed and avoid attributing all differences to quantization when the model or runtime also changed.
No training or vLLM benchmark results are presented here. The calculator is a transparent arithmetic model. A measured follow-up requires a working runtime and recorded runs; its result may include unsuccessful configurations. Publish aggregate measurements and synthetic examples, while excluding credentials, private paths, machine identifiers and personal data.