Local AI Model Selection and Pre-Flight Checks: A Practical Guide

    This guide explains why a model's file size is not the same as its runtime memory requirement, and how to evaluate local AI models before deployment. It covers four independent deployment constraints, how vendor-quoted sizes differ from downloadable assets, a breakdown of runtime memory usage, a 12-item pre-flight checklist, a task-driven selection path, and common mistakes to avoid during acceptance testing. Readers will gain a reproducible framework for checking model assets, memory budgets, and tool permissions without running inference.

    1. The Core Problem: Treating “the File Fits” as “the Model Will Run”

    “One 27-billion-parameter model is compressed to about 6 GB—can it run smoothly on a regular PC?” This is one of the most frequent questions in local deployment consultations. It is popular because it reduces a multi-variable engineering problem to a single variable: file size.

    A real deployment chain involves at least four independent constraints:

    1. Weight file size: the actual number of bytes on disk, which determines whether you can download and store the model.
    2. Runtime memory usage: resident memory after loading weights, building the compute graph, and allocating activations and cache, which determines whether the model can start.
    3. Context and state budget: KV cache, attention state, and intermediate vision encoding results grow with context length, which determines how long it can run and how many conversation turns it can sustain.
    4. Tool and permission boundaries: whether the model can read and write files, access the network, and call external interfaces, which determines what it can do and how much risk it carries.

    These are not four ways of describing the same thing. They are four bottlenecks in series, and if any one is insufficient, the whole chain fails. The stance of this article is therefore deployment decision research, not model performance benchmarking. Without actually downloading the weights and running inference, no measured figures for generation speed, peak memory, or task accuracy are provided. What this article offers is a reproducible verification method and a pre-flight framework.

    2. Calibrating the Numbers: Vendor Claims vs. Minimum Usable Assets

    A research organization recently released a ternary quantization scheme for memory-constrained devices, with roughly 27 billion parameters and a claimed compact size of about 5.93 GB, aimed at running high-parameter models in multi-turn tool-use scenarios. Such claims are not wrong in themselves, but they usually correspond to a “vendor-defined compact quantization measure,” not the smallest file you can actually download from a repository.

    Read-only verification against public assets yields three different levels of numbers:

    • Vendor measure: about 5.93 GB;
    • Actual minimum downloadable weight file: 5,993,834,848 bytes, about 5.99 GB (decimal) / 5.58 GiB (binary);
    • 2-bit quantized asset under a general-purpose inference framework: about 7.67 GB.

    The reason the same model shows both 5.58 GiB and 7.67 GB is not that “someone is mislabeling,” but that the quantization format and the runtime may not match. A custom ternary format requires matching dequantization and compute kernels. If you use a standard 2-bit asset from a general-purpose framework, the size rises by about 37%. This leads to a direct conclusion: the first step in selection is not picking a parameter count, but confirming that the “weight format–runtime” pair is closed.

    1. # Illustrative: shows verification dimensions only, not any specific tool
    2. asset_manifest
    3. ├── quantization # quantization type (ternary / 2-bit / 4-bit ...)
    4. ├── file_bytes # exact byte count; divide by 1024^3 for GiB
    5. ├── arch # attention structure (standard / linear / hybrid)
    6. ├── vision_module # whether a vision encoder is included
    7. └── runtime_required # which dequantization and compute kernels are required

    3. The Memory Ledger: Why 6 GB of Weights Needs Far More Than 6 GB of RAM

    Loading weights into memory is only the starting point. A session that can actually perform inference draws on roughly six sources of memory:

    • Resident weights: roughly equal to the file size (including alignment and metadata overhead);
    • Context cache: grows linearly with token count, number of layers, and attention head dimension;
    • Runtime overhead: compute graph, temporary activations, memory fragmentation;
    • State structures: linear attention / state-space structures need to maintain recurrent state;
    • Add-on modules such as vision: if multimodal is enabled, the encoder and projection layers take memory separately;
    • Operating system and host processes: on desktop environments this part is often completely ignored.

    A handy estimation formula for self-checking:

    1. required_ram ≈ weight_bytes
    2. + layers × 2 × kv_heads × head_dim × ctx_len × bytes_per_elem
    3. + runtime_overhead
    4. + vision_module
    5. + os_reserve

    In practice, for long-context scenarios (such as 32K and above), the context cache can take up space on the same order as the weights. So the real whole-machine memory threshold for “5.9 GB of weights” is usually significantly higher. Treating the advertised size directly as the memory threshold is the most common cause of local deployment failure.

    4. A 12-Item Deployment Pre-Flight Checklist (Runnable at the Selection Stage)

    All checks below are lightweight, read-only, and reproducible, and do not require actually running inference:

    1. Record the exact byte count of the weights, and give both decimal GB and binary GiB;
    2. Confirm whether the quantization type and the runtime’s support matrix are closed;
    3. Verify the model structure (number of layers, attention type, whether hybrid linear attention is used);
    4. Measure available physical memory and currently used memory;
    5. Estimate cache usage at the target context length;
    6. Confirm whether a vision/multimodal module is enabled and its extra overhead;
    7. Reserve memory for the operating system and host processes (leave a larger margin in desktop environments);
    8. Check remaining disk space and whether memory-mapped loading is needed;
    9. Define the inference device (CPU-only / partial operator offload / full offload) and operator support;
    10. Define a tool permission whitelist: file read/write scope, network egress, callable interfaces;
    11. Set a context limit and truncation/summarization policy to avoid unbounded growth;
    12. Build an acceptance test set: validate usability with real tasks, not general Q&A.

    Item 10 is especially critical. Local does not automatically mean secure: once a model has file and network permissions, the risk surface expands from “generating content” to “executing actions.” A workable approach is to reduce permissions to the minimum set and keep human confirmation for high-risk actions.

    1. policy.yaml (illustrative)
    2. tools:
    3. filesystem: { read: ["./workspace"], write: ["./workspace/out"] }
    4. network: { allow: [] } # outbound network off by default
    5. exec: { mode: "confirm" } # high-risk actions require confirmation
    6. context: { max_tokens: 16384, overflow: "summarize" }

    5. Selection Decision Path: Work Backward from the Task to the Machine

    The recommended order is “task → context budget → weight format → runtime → machine,” rather than starting backward from hardware specs:

    • If the task only needs short Q&A and single-turn extraction: prioritize a small parameter count plus 4-bit-level quantization, with minimal memory pressure;
    • If the task needs multi-turn tool calls: context and state overhead rise, so prioritize memory headroom and stable runtime support;
    • If the task involves mixed text and images: budget the vision module and projection layers separately;
    • If the task requires data to stay within an intranet: prioritize fully local inference, turn off network egress, and use general cloud categories such as object storage or logging services for cold backup and auditing (enable only when truly needed).

    6. Common Mistakes and Acceptance Recommendations

    • Mistake 1: using the vendor’s stated size as the whole-machine memory threshold;
    • Mistake 2: comparing only parameter counts, not quantization format and runtime compatibility;
    • Mistake 3: ignoring cache expansion from context growth;
    • Mistake 4: equating “local deployment” with “inherently secure,” overlooking tool permissions and data-at-rest risk;
    • Mistake 5: substituting general Q&A results for real-task acceptance.

    For the acceptance stage, fix three things: the same set of real-task test cases, the same context limit, and the same permission configuration. Only when these three are consistent are different selections comparable. More compact weights do open new space for private deployment and data self-governance, but privacy and data security are ultimately guaranteed by storage, network, tool permissions, and real-task acceptance together—not by a size number.