Deploying a 26B LLM Locally: VRAM Budgeting and Tool-Calling Evaluation
This article presents a practical workflow for deploying a 26B-parameter LLM on two 32 GB GPUs, covering VRAM budgeting for model weights, KV cache, and runtime buffers; context-length and slot accounting; reproducible throughput measurement; structured evaluation of tool-calling reliability; auxiliary model placement; and canary rollout and rollback procedures.
Local LLM deployment starts with a VRAM budget. Three components must fit in VRAM at the same time: model weights, KV cache, and the inference framework’s own compute buffers. Counting only the weights is not enough. Many failed configurations overlook the latter two.
Start With the VRAM Budget
Consider a dual-GPU setup with two 32 GB cards, for about 64 GB of total VRAM. The two GPUs do not automatically merge into a single unified memory pool. Weights and caches must be distributed across both cards through tensor-splitting parameters, and each card also needs headroom for compute buffers. The usable budget is therefore usually lower than the nominal total. Use the framework startup logs as the source of truth for actual numbers.
For a 26B-parameter model using Q8_0 quantization, each weight takes about 1.06 bytes, so the weights are roughly 27 GB in total. The remaining VRAM is what is available for KV cache and system overhead. Before deployment, subtract the weight footprint from the VRAM budget to determine how much room is left for cache.
Estimating KV Cache
KV cache size can be estimated with the following formula:
Bytes per token = 2 × layers × KV heads × head_dim × bytes per element
The factor of 2 represents the K and V caches. Read the layer count, KV head count, and head_dim from the model configuration file (config.json) or GGUF metadata; do not fill them in from memory. The KV head count is often smaller than the attention head count. This is the benefit of grouped-query attention (GQA), which can significantly reduce cache usage.
KV cache itself can also be quantized. When K and V are stored with q8_0, each element takes about 1.06 bytes, roughly half the size of f16.
Here is an illustrative calculation using assumed parameters: the model has 48 layers, 8 KV heads, and head_dim of 128, with KV cache stored in q8_0. Under these assumptions, each token takes about 102 KB, and a 262,144-token context requires about 25.5 GiB. These parameters are only for demonstrating the formula and do not represent any real model. Readers should substitute their own model’s parameters and use the result to decide the context limit.
Using the same assumed parameters, about 780k tokens of KV cache would require roughly 75 GiB. That exceeds the 64 GB total of the dual-GPU setup, even if the weights took up no VRAM at all. This shows that total size must be checked during estimation, not after the service starts.
Document Context Limits Clearly
In frameworks such as llama.cpp, the -c parameter sets the total context length shared by all slots, not the length of an individual slot. The -np parameter sets the number of parallel slots. The usable length per slot is approximately the total context divided by the number of slots. For example, if -c is set to 786432 and -np is set to 3, each slot can use only 262144 tokens.
This point is easy to misunderstand. If a configuration note says only “3 slots, 780k total context,” readers may assume each slot can use the full amount. When documenting a configuration, record the total context, the number of slots, and the per-slot limit together.
Below is a llama.cpp startup parameter skeleton. Check the --help output for the version you use to confirm the exact parameter names:
llama-server \-m /models/model-Q8_0.gguf \-ngl 99 \-ts 1,1 \-c 262144 \-np 1 \-fa \--cache-type-k q8_0 \--cache-type-v q8_0
The parameters mean the following. -ngl 99 places as many layers as possible on the GPU. -ts 1,1 splits the weights evenly across the two cards. -fa enables Flash Attention, which is required for V cache quantization. --cache-type-k and --cache-type-v set the quantization type for the K and V caches, respectively.
A deployment record should also include the ROCm version, driver version, and inference framework commit hash. Without this information, others cannot reproduce your results, and you will not know which version to roll back to.
Report Performance Numbers With Test Conditions
Generation speed and prefill speed are different metrics. The prefill phase processes a large input at once, involves heavy computation, and is mainly limited by compute throughput. The generation phase outputs one token at a time, repeatedly reads weights and KV cache, and is mainly limited by memory bandwidth. The throughput of the two phases often differs substantially, so a single “tokens/s” number should not be used to describe overall performance.
A throughput number is meaningful only when accompanied by the following conditions: model file and quantization method, concurrency, input length, output length, and measurement tool. Without this information, others cannot verify the number or use it for selection.
This article does not cite throughput numbers that lack measurement conditions. Readers can use llama-bench with fixed parameters; it reports prefill and generation speeds separately. When the service is running, responses from llama-server also include timing statistics, which can be used to observe behavior under real load.
Evaluate Tool-Calling Stability
Tool-calling capability varies widely across models, and their names, architecture descriptions, and official documentation differ. For model selection, use the model’s official name and version directly, and verify its official tool-calling format rather than relying on a colloquial architecture abbreviation.
There are three common categories of tool-calling failure. The first is invalid JSON, such as missing braces or quotes, which causes downstream parsing to fail. The second is parameter hallucination, where the model generates undefined parameter names or parameters of the wrong type. The third is incorrect invocation timing, where the model emits a call when no tool is needed or fails to call one when it is needed.
For evaluation, prepare a fixed test set containing samples where tools should be called and samples where they should not be called. Several hundred samples or more are preferable. For each sample, record at least the following metrics: JSON parse success rate, schema compliance rate, tool selection accuracy, exact parameter match rate, and false invocation rate. The smaller the sample size, the less reliable the conclusion. Report the sample size together with the results.
Place Auxiliary Models Based on Measured Headroom
After the main model is loaded with a long context, the remaining VRAM is usually limited. Without measured data, do not assume that a second model can also be loaded. The correct approach is to calculate the budget using the method above, start the main model with the real context length, and use monitoring tools to read the free VRAM on both GPUs. Consider deploying an auxiliary model only after confirming that enough headroom remains.
The auxiliary model should use a smaller specification and quantization, and its VRAM usage should be recorded separately in the budget table. If VRAM is insufficient, the framework may exit with an error, or it may fall back to a slower path after allocation fails, causing service performance to degrade suddenly. Both cases should be checked through stress testing before launch.
Canary Rollout and Rollback
A common engineering practice for running old and new models in parallel is to start two independent service instances and use a gateway to route traffic by percentage. Do not place two models in the slots of the same service, because their context, VRAM, and format behavior differ.
Set explicit thresholds before increasing traffic. For example, on a regression set of 300 samples, pause the rollout if the new model’s format validity rate is more than 2 percentage points lower than the old model’s. Adjust the threshold according to business tolerance, but write it down in advance to avoid making judgments by feel after launch.
Rollback also needs preparation. Keep the old model’s GGUF file, startup script, and framework version. When switching, update the gateway route first, then check whether the old service’s health endpoint responds normally. Stop the new service only after confirming that everything is working.
Conclusion
To deploy a 26B model on two 32 GB GPUs, calculate the VRAM budget first, then decide the context limit and auxiliary model placement. KV cache size is determined by model architecture and quantization method; plug the real parameters into the formula to get the result. Performance numbers and tool-calling conclusions must include measurement conditions and sample sizes so that they can be reproduced and compared. Completing these steps makes local deployment results reliable and allows a fast return to a stable version when problems occur.
