Compute Requirements and Local Deployment Practices in the Open-Weight Era

    Open-weight models let developers run LLMs on their own infrastructure, but they also shift responsibility for hardware, inference configuration, and operations to the team. This article explains where compute requirements come from—VRAM capacity, memory bandwidth, and concurrency—how to estimate them before deployment, how to apply 4-bit and 8-bit quantization in practice, and how to choose between cloud, on-premises, and edge deployment options.

    1. What Developers Gain from Open Weights

    In the past, most developers could only access large models through API calls. This approach is fast to integrate, but data must be sent to an external service, response latency depends on the network, model behavior is hard to customize deeply, and long-term costs grow with request volume. Once full weights are open, teams with sufficient compute can download the model to their own servers or cloud instances and perform fine-tuning, quantization, and inference optimization based on their business data.

    The essence of this change is a shift in deployment responsibility. Whether the model runs reliably now depends on hardware selection, inference framework configuration, and operational monitoring—work that used to be handled by the service provider and must now be done by the team itself.

    Before choosing a specific model, check its model card for the license, weight scope, and release date. The license determines whether commercial use is allowed. The weight scope determines whether you are downloading the base model, an instruction-tuned version, or a quantized version—these serve different purposes.

    2. Where Compute Requirements Come From

    Compute requirements for local deployment come mainly from three factors: VRAM capacity, memory bandwidth, and concurrent request volume.

    VRAM capacity determines whether the model fits on the device. Weight memory equals the number of parameters multiplied by the bytes per parameter. FP16 uses 2 bytes per parameter, INT8 uses 1 byte, and INT4 uses roughly 0.5 bytes. The table below estimates weight memory for common model sizes using this rule:

    Model size FP16 INT8 INT4
    7B ~14 GB ~7 GB ~4 GB
    13B ~26 GB ~13 GB ~7 GB
    70B ~140 GB ~70 GB ~35 GB

    The table only accounts for weights. Actual usage also includes the KV cache, activations, the inference framework, and the CUDA runtime. The KV cache grows with context length and concurrency, and can be roughly estimated with the following formula:

    KV cache bytes per token ≈ 2 × number of layers × number of KV heads × dimension per head × bytes per element

    The factor of 2 corresponds to the K and V caches. If the model uses grouped-query attention (GQA), the number of KV heads is smaller than the number of attention heads, which significantly reduces KV cache usage.

    Memory bandwidth determines generation speed. When a single request generates tokens one by one, all weights must be read once for each token generated. Therefore, the theoretical speed ceiling is roughly memory bandwidth divided by weight size. For example, with 1000 GB/s of bandwidth and 14 GB of weights, the theoretical limit for a single request is about 70 tokens per second. Real-world speed is lower because attention computation, scheduling, and memory access all add overhead.

    Concurrency determines unit cost. Serving multiple requests on the same GPU lowers the amortized cost per token, but increases VRAM usage and time to first token. When selecting hardware, estimate based on target concurrency and context length rather than just checking whether the model can load.

    Local versus cloud costs can be compared using: hardware cost or cloud instance hourly rate × runtime ÷ actual output tokens. Cloud instance pricing varies by provider and region, so refer to current quotes.

    3. A Four-Step Pre-Deployment Estimate

    1. Determine the target model size and precision, and calculate weight memory.
    2. Determine the maximum context length and concurrency, and calculate the KV cache.
    3. Reserve roughly 20% headroom for activations, the framework, and memory fragmentation. This is a rule of thumb and should be calibrated with real measurements.
    4. Run load tests with real requests on the target hardware, recording peak VRAM, time to first token, and output tokens per second.

    Estimation is only a starting point; final decisions should be based on load test data.

    4. Quantization and Inference Optimization

    Quantization reduces weight precision within an acceptable loss of accuracy. INT8 usually incurs only a small accuracy loss. INT4 significantly reduces VRAM usage, but quality degradation is more likely on math reasoning, code generation, and long-text tasks. Whether it is acceptable should be judged against your own business evaluation set, not just general benchmarks.

    The example below uses the bitsandbytes library to load a model in 4-bit NF4 format. Before running it, install transformers, accelerate, and bitsandbytes, and make sure an NVIDIA GPU is available.

    1. import torch
    2. from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
    3. # Path to model weights in local or cloud storage
    4. model_path = "/data/models/open-weights-llm"
    5. tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
    6. # 4-bit NF4 quantization config, computing in FP16
    7. quant_config = BitsAndBytesConfig(
    8. load_in_4bit=True,
    9. bnb_4bit_compute_dtype=torch.float16,
    10. bnb_4bit_quant_type="nf4",
    11. )
    12. model = AutoModelForCausalLM.from_pretrained(
    13. model_path,
    14. quantization_config=quant_config,
    15. device_map="auto", # relies on accelerate to shard across available devices
    16. trust_remote_code=True,
    17. )
    18. input_text = "Explain the core advantages of local LLM deployment."
    19. # Move inputs to the model's device instead of hardcoding "cuda"
    20. inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
    21. with torch.no_grad():
    22. outputs = model.generate(**inputs, max_new_tokens=100)
    23. response = tokenizer.decode(outputs[0], skip_special_tokens=True)
    24. print(response)

    When using this code, keep the following in mind:

    • For INT8, change the config to BitsAndBytesConfig(load_in_8bit=True); the rest of the code stays the same.
    • trust_remote_code=True executes custom code from the model repository. Only enable it after reviewing the code and confirming the source is trustworthy.
    • After loading with quantization, verify output quality with your business evaluation samples—do not just check that text generation works.

    5. Choosing Between Cloud and On-Premises Deployment

    • If data must not leave the internal network, or you need sustained high-load operation: on-premises or private cloud deployment is more suitable.
    • If workloads fluctuate significantly, or the work is mainly short-term experiments: elastic cloud instances are more flexible and avoid idle costs.
    • If you need to switch model versions frequently: container images and container platforms usually reduce switching costs.

    Cloud deployment typically involves object storage, container platforms, and logging/monitoring services. Object storage works well for keeping multiple versions of weight files, but weights often reach tens of gigabytes. Pulling weights from object storage on every cold start makes startup slow, so weights should be cached locally on inference nodes.

    6. Constraints of Edge Deployment

    The main bottlenecks on edge devices are usually memory, power consumption, and thermal limits rather than peak compute. Before launch, check the following items by device type:

    • Mobile phones: accounting for runtime memory, confirm the system will not kill the app process due to insufficient memory. Run inference continuously for 10 minutes and check device temperature and throttling behavior.
    • PCs: confirm the capacity of unified memory or dedicated VRAM, and check sustained performance under load.