Running Local LLMs on PCs with Limited VRAM: A Practical Guide

    Learn how to estimate memory requirements, choose a model that fits your hardware and workload, and organize local inference as a reusable service. This guide also explains how an agent or workflow layer can connect a local model to practical tasks while leaving precise calculations to deterministic tools.

    1. Assess What Your Hardware Can Handle

    The first step in running a large language model locally is evaluating your hardware. Model weights occupy GPU memory—or unified memory—and inference also requires memory for the context cache. Together with runtime overhead, these requirements determine whether the model can run reliably.

    Use this rough estimate:

    1. Required VRAM ≈ Parameter count × Bits per parameter ÷ 8 + Context cache + Runtime overhead

    For an 8-billion-parameter (8B) model with 4-bit quantization, the weights alone require approximately:

    1. 8 × 10⁹ × 4 ÷ 8 ≈ 4 GB

    The context cache and runtime overhead typically add another 1–2 GB. A discrete GPU with around 5 GB of VRAM may therefore barely accommodate a 4-bit 7B or 8B model, with limited room for context length and concurrent requests.

    Thin-and-light laptops often have only integrated graphics or limited dedicated VRAM. They are better suited to very small models or occasional question-answering tasks. When hardware is constrained, define your use case around those limits rather than pursuing a larger parameter count.

    2. Choose a Model for Your Tasks

    Model selection should start with the workload. Tasks such as organizing data, summarizing documents, explaining spreadsheets, and generating formulas or scripts depend primarily on:

    • Language comprehension, including Chinese where required, and instruction following.
    • Reliable structured output, such as table fields or step lists in JSON.
    • Support for tool calling.
    • Response times suitable for interactive use.

    Larger models generally require more memory and run more slowly. On a VRAM-constrained PC, a well-instruction-tuned 8B model is often more practical than a 32B model that barely runs.

    Evaluate four areas:

    1. Ecosystem: Look for active community maintenance, reliable quantized releases, and comprehensive documentation.
    2. Quantization: 4-bit quantization minimizes weight storage and can offer fast inference, usually with an acceptable loss of accuracy. 8-bit quantization preserves more accuracy but requires roughly twice the weight memory.
    3. License: Confirm that the license permits your intended use, particularly commercial use or internal distribution.
    4. Evaluation: Test the model with samples from your own workflows rather than relying solely on public benchmark scores.

    3. Use a Local Inference Service as Reusable Infrastructure

    A standalone chat interface is sufficient for a quick trial. If multiple applications need to share the same model, use a separate inference service to handle:

    • Model downloads, loading, unloading, and version switching.
    • GPU and system memory monitoring.
    • A consistent request interface.
    • Request logging and error handling.

    Applications can connect to this interface without individually managing model paths, parameters, or runtime environments. Switching models then requires little or no application code changes.

    When choosing an inference service, check whether it supports multiple operating systems, provides a standardized HTTP interface, allows model switching without restarting the application, and exposes resource usage. Also verify whether data is processed locally by default.

    The following illustrates the structure of a request to a local service. Consult the relevant documentation for the actual endpoint path, port, and field names.

    1. POST http://127.0.0.1:<port>/<chat-endpoint-path>
    2. Content-Type: application/json
    3. {
    4. "model": "<loaded-model-identifier>",
    5. "messages": [
    6. {"role": "system", "content": "You are a data analysis assistant. Support your conclusions with evidence."},
    7. {"role": "user", "content": "Summarize the month-over-month changes for each region in the following monthly sales records."}
    8. ],
    9. "temperature": 0.2
    10. }

    A lower temperature helps produce more consistent output for analysis and data organization tasks.

    4. Add an Application or Agent Layer for Practical Work

    A model on its own generates text. Completing real tasks also requires reading files, calling tools, breaking work into steps, validating results, and saving outputs to the intended location. These responsibilities belong to an agent or workflow orchestration layer.

    For spreadsheet analysis, a reasonable workflow is:

    1. Read the spreadsheet and identify headers, data types, and anomalous values.
    2. Have the model generate analysis steps based on the task objective.
    3. Use deterministic computational tools to perform aggregations and statistical calculations.
    4. Have the model generate chart configurations or plotting scripts.
    5. Manually review key figures and conclusions.

    The central principle is to let the model handle planning, explanation, and code or formula generation, while deterministic tools perform precise calculations.