Running Large Language Models Locally: Quantization Choices and Cloud-Edge-Device Routing

    Deploying LLMs on local hardware starts with one question: will it fit in VRAM? This guide walks through the key decisions for on-device and local deployment—estimating memory requirements, choosing between model compression techniques, matching model size to hardware, routing requests between local and cloud inference with a hybrid orchestrator, and designing graceful fallback and monitoring strategies for production.

    Whether a large language model can run locally comes down to whether the memory is sufficient. Many developers estimate requirements based on parameter count alone on their first deployment, and end up with a model that either doesn’t fit or runs far too slowly. This article walks through the key decisions for edge and local deployment in order: memory estimation, model compression, hardware-based model selection, hybrid request routing, and fallback handling.

    1. Estimate VRAM Before Choosing a Quantization Format

    Model weight size can be roughly estimated as parameter count multiplied by bytes per parameter. FP16 uses 2 bytes per parameter, INT8 uses 1 byte, and INT4 uses 0.5 bytes. Converting from FP16 to INT8 roughly halves weight memory; converting to INT4 brings it down to roughly a quarter.

    Take a 12B-parameter model as an example: FP16 requires about 24GB for weights alone, INT8 about 12GB, and INT4 about 6GB. These figures represent weights only. In practice, the KV cache grows with context length, and activations plus the inference framework consume additional memory. Grouped quantization also stores scaling factors, which slightly increases file size. Always leave headroom in your estimates—never treat weight size as the total memory requirement.

    2. Model Compression: What Distillation, Pruning, and Quantization Each Solve

    Model compression follows three main paths.

    The first is knowledge distillation. A smaller student model learns from the probability distribution over candidate tokens produced by a larger teacher model. This contains more information than learning only the final answer, so the student retains a portion of its reasoning ability even after a substantial reduction in parameters.

    The second is structural pruning. It removes neurons, attention heads, or entire layers that contribute little, directly reducing computation. Distillation determines what a model can learn; pruning determines how much structure it keeps. The two can be combined.

    The third is quantization, the most direct way to reduce memory footprint. Common weight quantization methods such as GPTQ and AWQ use a small batch of calibration data to prioritize protecting the weights that most affect the output. They can keep accuracy loss within an acceptable range, but the loss is not zero. Math reasoning, code generation, and long-context tasks are more sensitive to precision, and degradation after quantization typically appears in these tasks first.

    INT4 saves more memory but may lose accuracy on sensitive tasks. INT8 is more stable but uses more memory. Which to choose depends on benchmarks on your target hardware—some hardware provides no acceleration for INT4 at all, and throughput after quantization can even drop. Compressed models must also be re-evaluated on your own business data. A high score on general benchmarks does not guarantee good performance on code generation, customer-support Q&A, or in-car command understanding.

    3. Match the Model to the Hardware: Phones, In-Car Systems, and PCs

    Compute and memory vary widely across devices, so selection should work backward from each device’s hardware ceiling.

    Phones suit small models in the 0.5B–3B range. These can handle short tasks such as real-time speech transcription, on-device text summarization, and keyboard suggestions. Quantized to INT4, a 1B model’s weights are roughly 0.5GB—small enough to stay resident on memory-constrained devices.

    For in-car systems, the core requirement is handling basic commands even on weak or no network—adjusting the air conditioning or understanding simple navigation prompts, for example. In-car models should prioritize response speed and stability, leaving complex Q&A to the cloud.

    Consumer PCs are the main platform for running large models locally. A 12B-class model quantized to INT4 can run on many mid-to-high-end laptops. For 30B-class models, a GPU with 24GB of VRAM holds roughly 15GB of INT4 weights, leaving room for the KV cache and framework overhead. Whether it runs smoothly depends on context length, batch size, and the inference framework’s implementation—benchmark on the target machine.

    Local multimodal models are also maturing. These models can accept screenshots or photos and answer questions combining text and images—for example, identifying an error dialog on screen and suggesting a fix. The cost is that images convert into a large number of visual tokens, so memory usage and time-to-first-token are significantly higher than for text-only models. Higher image resolution means longer processing time, and small text and fine icons are easily misrecognized. Local multimodal features are therefore best suited to low-resolution, single-image scenarios; complex document parsing still belongs in the cloud.

    4. How a Hybrid Inference Orchestrator Routes Requests

    A purely local model has limited capability, while a purely cloud-based approach brings latency, cost, and privacy concerns. A hybrid inference orchestrator allocates requests between the two. It is a routing layer that makes a decision on every incoming request.

    Four dimensions drive the decision: task complexity, privacy level, latency budget, and device state. Below is a set of starting policies—the actual thresholds must be measured against your own hardware and business data, not copied as-is:

    • Requests containing sensitive content such as ID numbers, medical records, or proprietary code are forced to local processing.
    • Low-complexity requests—short Q&A, text polishing, voice commands—are routed to the local small model first.
    • Requests whose input exceeds a set length, or that require retrieval over a large knowledge base, are forwarded to the cloud.
    • When device memory is tight, temperature is high, or battery is low, the local model switches to a smaller version. If the privacy policy allows, requests can also be forwarded to the cloud.

    5. Cloud Nodes and the Fallback Plan

    The cloud handles complex tasks. You can run large-parameter models on container platforms with GPU instances and use autoscaling to absorb traffic peaks. Which cloud provider to choose depends on your organization’s existing infrastructure, regional requirements, and budget.

    The fallback plan matters more than the cloud node itself. When the network drops, the cloud times out, or the service misbehaves, the orchestrator should proceed in this order:

    1. Set timeouts and circuit breakers. After consecutive failures reach a threshold, pause forwarding to the cloud to prevent request pileup.
    2. Switch to the local model. If the local model’s capability is insufficient, clearly tell users the system is in a degraded state and explain the possible limitations.
    3. For questions that hit the local cache, return cached results directly, marked as potentially outdated.
    4. Once the cloud recovers, ramp traffic back up gradually rather than switching everything over at once.

    Hold two lines during degradation. First, privacy policy must not loosen because of a failure. When the cloud is unavailable, sensitive requests should be rejected or completed locally only—never temporarily forwarded to another cloud service. Second, cap the cost. Retries, long contexts, and large batches combined can drive cloud spending up quickly. Set quotas and rate limits per user and per API endpoint.

    Finally, benchmark on target hardware before launch. Memory estimates, quantization choices, and routing thresholds all need to be validated with real measurements on the machines and data you will actually run in production.