Local LLM Deployment in Practice: A Guide to Open Weights, GPU Sizing, and Quantization

    When a large language model's full weights are released, the real industry signal is a shift from API-only distribution to a dual track of APIs plus downloadable weights. This article walks through what open weights do and do not give you, how to estimate VRAM and GPU count before deployment, how to choose an inference runtime, how quantization trades accuracy for cost, what engineering layers a production service needs, the three customization paths from prompt engineering to full continued pretraining, and how to split workloads between local infrastructure and cloud services. The goal is a reproducible balance point among VRAM limits, latency targets, and accuracy requirements.

    1. What Releasing Full Weights Actually Means

    A research team recently released the full weights of a large language model, which triggered wide discussion in overseas technical communities; an official account from a chip vendor also publicly congratulated them. Setting the specific product aside, the real industry signal behind this move is that LLM distribution is evolving from “API only” to a dual track of “API plus weights.”

    For developers and enterprises, the difference between the two models is fundamental:

    • API access: The model is hosted by the provider, and callers pay per request. There is no need to worry about compute, VRAM, or concurrency scheduling, but data leaves your perimeter and deep customization is difficult.
    • Open weights: Once you have the weight files, you can load, run inference on, and fine-tune them on your own compute. Data stays inside your network the whole time and behavior is auditable, at the cost of owning the entire engineering burden yourself.

    It is worth stressing that open weights do not mean “usable with zero effort.” Weights are usually only part of the model; the companion tokenizer configuration, inference code, chat template, and license terms matter just as much. What actually consumes engineering time is rarely downloading the weights themselves, but turning them into a stable, observable, and scalable online service.

    2. Compute and Capacity Assessment Before Deployment

    The easiest mistake in self-hosting is underestimating VRAM requirements. A rough rule of thumb:

    1. weight VRAM ≈ parameter count × bytes per parameter
    2. peak inference VRAM ≈ weight VRAM + KV Cache + activations and temporary buffers

    At FP16 precision, each parameter takes 2 bytes, so a 70B-class model needs about 140GB for weights alone, before counting KV Cache. The size of the KV Cache is roughly proportional to context length and the number of concurrent requests, so in long-context scenarios this overhead can quickly exceed the weights themselves.

    A recommended assessment flow:

    1. Define the workload profile: average input length, average output length, peak concurrency, acceptable time-to-first-token, and overall throughput.
    2. Work backward to VRAM and GPU count: compute the lower bound from the chosen precision first, then reserve 20%–30% headroom for KV Cache and fragmentation.
    3. Confirm inter-GPU interconnect: multi-GPU tensor parallelism is sensitive to interconnect bandwidth, and scaling efficiency drops noticeably when that bandwidth is insufficient.
    4. Plan for elasticity: for workloads where peak and average diverge widely, a hybrid form of “small always-on footprint plus peak scale-out” is preferable.

    3. Choosing an Inference Framework and Runtime

    Once you have the weights, you need a runtime layer to turn them into a callable service. Common industry options fall into three categories:

    • Building on a general-purpose deep learning framework: the most flexible, suitable when you need to modify the model architecture, but throughput and scheduling must be optimized yourself.
    • A dedicated high-performance inference engine: improves throughput through continuous batching, paged attention caching, and operator fusion; suited to service-oriented goals.
    • A lightweight local inference option: aimed at single machines or edge devices, emphasizing low resource usage and fast validation.

    When choosing, do not look only at peak numbers in benchmarks. Look at whether the option matches your constraints: does it support the precision and quantization format you need, tensor and pipeline parallelism, a usable streaming output interface, and how active is the community and how fast does it respond to issues.

    4. Quantization and Compression: Balancing Accuracy and Cost

    Quantization is the core technique for fitting a large model onto limited compute. Common approaches include quantizing weights to 8-bit or 4-bit, as well as schemes that quantize activations at the same time. The benefit is a significant drop in VRAM usage and bandwidth pressure; the cost is possible accuracy loss.

    Practical advice:

    1. # Illustrative: load a quantization config and run a small accuracy regression
    2. config = {
    3. "quantization": "w4a16", # 4-bit weights, 16-bit activations
    4. "group_size": 128, # group quantization granularity
    5. "keep_layers": ["lm_head"] # keep sensitive layers at higher precision
    6. }
    7. def regression_check(model, eval_set, baseline, tol=0.01):
    8. metrics = evaluate(model, eval_set)
    9. for key, base in baseline.items():
    10. assert abs(metrics[key] - base) <= tol, f"{key} accuracy regression exceeds threshold"
    11. return metrics

    The key principle: quantization must be paired with evaluation-set regression. Build a small evaluation set from real business samples, compare accuracy, structured-output compliance rate, and long-text consistency before and after quantization, and keep regressions within an acceptable threshold rather than judging “seems fine” by subjective impression.

    5. Service Packaging and Engineering Support

    Getting the model running is only the starting point; supporting production traffic requires a ring of engineering capabilities:

    • Ingress layer: a unified gateway handles authentication, rate limiting, quotas, and canary routing, decoupling the model service from business systems.
    • Batching and scheduling: continuous batching significantly improves GPU utilization; latency-sensitive and throughput-sensitive traffic should be deployed in separate pools.
    • Storage and caching: keep model weights and datasets in object storage, distribute the runtime via a container image registry, and add caching for high-frequency prefixes to reduce repeated computation.
    • Observability: a logging service collects request traces, while monitoring and alerting cover VRAM usage, queue time, time-to-first-token, failure rate, and output length distribution.
    • Elastic scaling: the container platform scales automatically based on queue length or latency metrics, avoiding long-term resource occupation sized for peak.

    A minimal viable server skeleton can be described like this:

    1. def handle_request(payload, runtime):
    2. if not limiter.acquire(payload.tenant_id):
    3. return {"code": 429, "msg": "rate limited"}
    4. result = runtime.generate(
    5. prompt=payload.prompt,
    6. max_tokens=payload.max_tokens,
    7. temperature=payload.temperature,
    8. )
    9. metrics.observe(payload, result)
    10. return {"code": 0, "data": result}

    6. Three Customization Paths and Risk Control

    With the weights in hand, the customization space genuinely opens up. Common paths, from lightest to heaviest:

    1. Prompt engineering and retrieval augmentation: no parameter changes; use template design and external knowledge retrieval to cover time-sensitive knowledge. Lowest cost, fastest iteration.
    2. Parameter-efficient fine-tuning: train only a small number of additional parameters, letting the model adapt to vertical phrasing and output formats under limited compute.
    3. Full-parameter continued pretraining: for scenarios where domain corpora differ drastically. Highest cost and risk, and it requires strict data governance.

    Risk control cannot be skipped either: whether the license permits commercial use and redistribution, whether training data contains sensitive information, whether outputs pass through safety filtering, and whether model versions are traceable and rollback-able. It is advisable to manage the model as a documented asset, recording versions, evaluation conclusions, and reasons for changes.

    7. How to Divide Work With Cloud Capabilities

    Full self-hosting is not the only answer. A more pragmatic approach is layering: hand elastic peaks, temporary validation, and large-scale data processing to general cloud capabilities (such as container platforms, object storage, message queues, and monitoring and alerting), and keep core inference that demands strong compliance, low latency, and data residency inside your own network on-premises. General compute and supporting services from cloud vendors such as Baidu AI Cloud can serve as the foundation for this hybrid architecture, with enterprises flexibly drawing the boundary according to their own compliance and cost constraints.

    8. Conclusion

    Open weights hand the choice back to engineering teams, and hand the complexity over along with it. Real competitiveness lies not in “whether it can run,” but in whether you can find a stable, reproducible balance point among VRAM constraints, latency targets, and accuracy requirements. The recommended sequence is: start with a small-scale feasibility check, then establish a quantization and accuracy regression baseline, then fill in service packaging and observability, and finally introduce customization and elastic scheduling step by step. Following this path is what turns open weights into business value at a controlled cost.