Running Out of Quota? A GPU Selection Guide for Local LLM Deployment
This guide explains how to choose GPU hardware for running coding models locally when cloud AI coding quotas run out. It covers how to estimate VRAM for model weights, KV cache, and runtime overhead, compares single-GPU and dual-GPU setups, and outlines practical software tips for quantization, inference servers, and context length.
1. Why Quota Limits Hurt Development Productivity
AI coding tools have changed how many developers write code. Completion, refactoring, and reading unfamiliar codebases can all become much faster. At heavy usage, however, a monthly quota can run out quickly. Large-scale project analysis and long-context pair programming consume a lot of tokens per session. Once the quota is exhausted, the service may throttle or pause requests, and the developer loses their train of thought. That disruption often costs more than the subscription fee itself.
There are two common workarounds. One is to switch between multiple accounts or tools to pool enough usable quota. This takes effort to manage, and it can introduce code leakage and compliance risks. The other is to deploy a model locally. Local deployment requires a one-time hardware investment, but the code never leaves the machine, and work does not stop when a quota runs out. This article focuses on the second approach, with an emphasis on working out what the hardware can actually run.
2. Calculate VRAM First, Then Choose Hardware
Before choosing hardware, answer one question: can the model fit in VRAM? If VRAM is insufficient, the model cannot be loaded, and fast inference does not help.
VRAM usage has three main components.
- Model weights. The estimate is: number of parameters × bits per parameter ÷ 8, which gives the size in bytes. For example, a 32-billion-parameter (32B) model quantized to 4 bits has weights of roughly 16GB. The common GGUF Q4_K_M format uses mixed precision, so its actual size is about 19GB.
- KV cache. It grows with context length and the number of concurrent requests. The formula is: 2 × number of layers × number of KV heads × head dimension × bytes per element, multiplied by the context length. Take a typical 70B-class architecture with 80 layers, 8 KV heads, a head dimension of 128, and FP16 storage. Each token takes about 0.3MB, so an 8K context uses about 2.5GB and a 32K context uses about 10GB. Exact values depend on the model’s configuration file.
- Runtime overhead. The CUDA context, framework buffers, and activations typically need 1 to 2GB of reserved space.
The table below shows estimated weight sizes for common GGUF quantization formats. Treat these values as reference figures only.
| Model size | Quantization | Approx. VRAM for weights |
|---|---|---|
| 32B | Q4_K_M | 19GB |
| 32B | Q6_K | 26GB |
| 32B | Q8_0 | 34GB |
| 70B | Q4_K_M | 42GB |
| 70B | Q5_K_M | 50GB |
| 70B | Q6_K | 57GB |
The table shows two things. First, a 32B model fits at the Q6 level on a 32GB GPU, but Q8 does not fit. Second, a 70B model on 48GB of VRAM can only run at Q4. Q5 and Q6 both exceed the capacity.
3. Single-GPU Options: What 24GB and 32GB Can Do
Current flagship consumer GPUs have between 24GB and 32GB of VRAM. The RTX 4090 and RTX 3090 have 24GB, and the RTX 5090 has 32GB.
On a 24GB GPU, the Q4 version of a 32B model can be loaded, but the remaining 4GB or so must cover the KV cache and runtime overhead. That limits the context to a few thousand tokens, and the setup runs short of memory quickly when several users send requests at once. On a 32GB GPU, the Q6 version of a 32B model can be loaded. The extra space supports longer contexts, and the precision loss is smaller.
Some articles quote speeds such as “about 30 tokens/s.” Without the model, quantization level, context length, inference framework, and batch size, such a number cannot be reproduced or compared. The same card can differ by several times in speed depending on the framework or the level of concurrency. Readers should measure performance themselves. The llama-bench tool included with llama.cpp and the benchmark scripts for vLLM can both measure generation speed. Record all the parameters used in each test.
Choose the quantization level carefully. INT8 is generally considered to lose little quality, while INT4 can noticeably reduce quality on complex reasoning. Code tasks are sensitive to precision, because a single wrong symbol can stop a program from running. Test with tasks from your own project. For example, ask the model to fix a set of known bugs, or generate functions and run their unit tests, then measure the pass rate. If Q4 passes noticeably less often than Q6, move to a higher quantization level, or switch to a smaller model with better precision.
The single-GPU setup is simple to deploy and does not require multi-GPU splitting. Its limitation is that the VRAM ceiling is the card’s own capacity.
4. Dual-GPU Setup: 48GB Is Not a Automatically Merged Memory Pool
Two RTX 3090 cards connected with an NVLink bridge is a common dual-GPU combination among consumer cards. The 3090 is the last GeForce model to support NVLink, and later consumer cards no longer offer this feature. Two cards together provide 48GB of VRAM, which is accurate. However, several conditions need to be clear.
First, the VRAM does not merge automatically into one pool. Each GPU can directly access only its own memory. The inference framework must split the model across both cards, either by tensor (tensor parallelism) or by layer (pipeline parallelism). vLLM supports tensor parallelism, llama.cpp supports splitting the model by layer or by row, and ExLlamaV2 supports multiple GPUs. Parameter names differ across frameworks and versions, so check the documentation for your specific version before use.
Second, NVLink improves communication speed between the cards. It reduces the data transfer overhead after the model is split, but it does not increase VRAM capacity. Without NVLink, two cards can still run inference over PCIe, but performance is lower.
Third, the failure mode when a single card runs out of VRAM is straightforward. If the framework does not split the model, loading fails with a CUDA out-of-memory error. If the split succeeds but the context is set too long, the KV cache keeps growing during generation, and the run fails partway through with an out-of-memory error. The second case is harder to spot, so check it with long-text tests.
Based on the VRAM estimates above, the dual-GPU setup can run the following models. A 70B model at Q4 needs about 42GB for weights, which leaves about 6GB for the KV cache and runtime overhead. An 8K context can run, though barely. Longer contexts or multiple simultaneous requests exceed the available memory. The Q5 and Q6 weights need about 50GB and 57GB, which exceed 48GB. These cannot run on this hardware. In short, a 48GB dual-GPU setup cannot run a 70B model at Q6.
Whether a dual-GPU setup offers a price advantage depends on actual market prices. Used prices fluctuate significantly, so check recent sales records before buying, and compare the cost with a new flagship single GPU. Used cards carry additional risks. Mining cards may show heavy wear, so inspect the fans and heatsinks. Most used cards have no warranty. After purchase, run a VRAM stress test to check for memory errors.
Power consumption also matters. The 3090 has an official power rating of about 350W, so two cards at full load draw close to 700W. With a CPU and other components, a power supply of 1200W or more is usually needed, and the case cooling must keep up.
5. Software Engineering Practices
1. Quantization Methods
When VRAM is tight, quantization is a necessary tool. AWQ and GPTQ preserve the precision of key weights better than simple integer truncation. Keep three points in mind. First, both rely on calibration data, and calibration data closer to your target task usually gives better results. Second, the inference framework and GPU model must be supported, so confirm this before deployment. Third, evaluate the quantized model on your own coding tasks, and prepare a fallback plan. If a quantized version does not meet your precision requirements, move to a higher quantization level or a smaller model.
2. Inference Frameworks
PyTorch’s native generate method suits debugging and experiments, but it is not suitable as a long-term service. The server implementations of vLLM and llama.cpp use PagedAttention or efficient KV cache management, and they support continuous batching. Throughput is higher when multiple requests arrive at the same time.
For example, a dual-GPU tensor-parallel launch command for vLLM looks roughly like this. Confirm the exact parameters for your version:
vllm serve <model_path> --tensor-parallel-size 2 --max-model-len 8192 --gpu-memory-utilization 0.90
--max-model-len directly limits the maximum context length, which in turn caps the KV cache’s maximum usage. --gpu-memory-utilization sets the share of VRAM the framework can use. If it is set too high, the system and display output may have no headroom.
The llama.cpp server can also run inference across two GPUs. A common command looks like this:
llama-server -m <model_file> -ngl 99 -c 8192 -sm layer
Here, -ngl sets the number of layers offloaded to the GPU, -c sets the context length, and -sm sets the multi-GPU split mode. Before deployment, record the framework version, driver version, and launch parameters so that you can reproduce the setup if problems occur.
3. Context Length Management
Code scenarios often require long contexts. RoPE scaling methods, such as linear interpolation, NTK, or YaRN, can extend the context window without retraining. However, different models support different scaling methods, and answer quality usually drops beyond the training length. Cross-file reasoning, references, and fine details in long functions are the most likely to fail. Before enabling a long context, test it with real long files and long conversations.
The VRAM used by the KV cache grows linearly with context length, and concurrent requests multiply that usage. Within a fixed VRAM budget, you can balance only two of three factors at once: context length, number of concurrent requests, and quantization level.
6. Limitations and Risks
Local models are usually less capable than the latest cloud models, especially for complex architecture design and reasoning across many files. After deployment, you are responsible for maintaining drivers, framework versions, and model updates. When several people use the system at once, the throughput of a single machine is limited, and wait times increase.
Keeping data on your own machine helps with compliance and privacy, but it does not eliminate security concerns. Access control, log management, and system patching still need attention. Noise, heat, and electricity costs should also be counted in the total cost, especially under sustained high load.
7. Summary
If cloud quotas often run short, local deployment is a viable direction. Before choosing hardware, estimate the weights, KV cache, and runtime overhead using the formulas above, and confirm that the target model and quantization level fit in VRAM. A single 32GB GPU suits the higher quantization levels of 32B models. A dual 48GB setup can run 70B models, but only at Q4 with short contexts, and only if the inference framework supports multi-GPU splitting. NVLink improves communication speed but does not add VRAM. Before buying, base your decision on actual market prices, your own coding tasks, and measured speeds.
