Local LLM Deployment on Windows: Controlling Install Paths and Storage Locations

    This article explains why path planning should be the first step in local LLM deployment, not an afterthought. It covers hardware and system prerequisites, the three layers that determine where files land, and how to redirect the model repository to a non-system drive using environment variables. You will also find a step-by-step deployment checklist, a troubleshooting order for common failures, and engineering practices for keeping local inference maintainable over time.

    1. Why Path Planning Comes First in Local Deployment

    Between data privacy concerns, per-token API costs, and unreliable network connectivity, running large model inference on a local machine has shifted from an experiment to a routine engineering decision. Keeping data on the device, avoiding usage-based billing, and working offline are the three most immediate benefits. But the first obstacle in practice is rarely compute. It is disk space.

    The reason is that a local inference stack consumes space in two places: the runtime itself and the model weight files. The runtime is bounded in size. Weights are not — they range from hundreds of megabytes to tens of gigabytes, and they accumulate as new model versions arrive. Default installers typically place the working directory under the user profile on the system drive. On a system drive with only about a hundred gigabytes free, already being consumed by the operating system and various caches, this quickly produces an “out of space” error. Worse, the error usually surfaces halfway through a download, wasting both the bandwidth and the time already spent.

    Path planning therefore belongs at the start of the deployment process, not as a repair step afterward. There are three goals: a controllable install directory, a relocatable model repository, and a verifiable configuration.

    2. Pre-Deployment Resource and Compatibility Check

    2.1 Hardware Baseline

    Lightweight models have fairly modest hardware requirements, but “it runs” and “it is usable” are separate assessments:

    • Processor: Two cores are enough to start inference; four or more give a noticeably more stable experience under concurrent interaction. CPU-only inference works, at the cost of significantly longer time to first token.
    • Memory: This is a tighter constraint than the GPU. Judge by available memory rather than nominal capacity, and leave headroom for resident processes such as the operating system and a browser. Otherwise you get long stalls or the process being terminated by the system.
    • Disk: Beyond the model files themselves, reserve room for download temporary files, logs, and future versions. Planning for two to three times the model’s stated size is safer in practice.
    • Graphics acceleration: A discrete GPU with general-purpose compute capability can substantially shorten inference time. Not having one does not affect functional completeness. Older GPUs often cannot be recognized correctly by the runtime due to driver and compute capability limits; in that case, fall back to an older runtime version or use CPU mode rather than reinstalling repeatedly.

    2.2 System and Environment Prerequisites

    A 64-bit desktop operating system is required, on a supported and reasonably recent version. Virtualization-related components need to be enabled in some environments, or the runtime may fail to start. The built-in system command line is sufficient; no additional toolchain is needed. The network is only required to obtain the runtime and download weights — after that, the setup runs fully offline.

    3. The Core Mechanism of Path Control

    Understanding the mechanism matters more than memorizing commands. The directory behavior of a local inference runtime comes down to three layers:

    1. Program install layer: Determined by the installer. Most installers offer no directory selection UI and write to the user profile by default.
    2. Model repository layer: Determined by the runtime through an environment variable. This is where weights, manifests, and caches actually land.
    3. Temporary cache layer: Produced by the download process. If it sits on a different drive from the repository, peak space usage can stack up.

    The layer that genuinely needs precise control is the second one. The approach is to declare a directory variable in advance that points to a non-system drive, so the runtime reads that value at startup and uses it as the repository root. An illustrative configuration (PowerShell, run as administrator):

    1. # Create the target directory
    2. New-Item -ItemType Directory -Force -Path "D:\AI-Runtime\models"
    3. # Set a user-level environment variable; takes effect after restarting the terminal
    4. [Environment]::SetEnvironmentVariable(
    5. "OLLAMA_MODELS",
    6. "D:\AI-Runtime\models",
    7. "User"
    8. )
    9. # Verify the value is read back
    10. $env:OLLAMA_MODELS

    For the first layer, if the installer does not expose a directory choice, there are two general options. One is to accept the default install and relocate only the model repository — the best value, since the program itself takes up very little space. The other is to use a directory junction to point the default install directory at a non-system drive, transparently redirecting where the program writes. The latter requires care: do it before installing, and confirm the target drive letter is fixed, since a removable drive will break the path.

    4. Implementation Steps

    1. Plan the directory structure. Keep runtime, models, and logs separate — for example, models and logs under D:\AI-Runtime — to make later backup and cleanup easier.
    2. Set the environment variable and restart the terminal. Environment variables apply to processes at launch; an already-open window will not see the new value. This is the most common cause of “the configuration had no effect.”
    3. Install the runtime. After installation, run a version query first to confirm the service is registered and responding.
    4. Pull a model and watch where it lands. Monitor the target directory’s size during the download to confirm files are actually being written to the non-system drive.
    5. Run a minimal inference check. Send a short prompt to confirm the model loads successfully, not just that the download finished.
    6. Lock in the configuration. Record the environment variable, directory convention, and verification commands as a deployment checklist for the team, so the setup is reproducible on a new machine.

    One point worth stressing: the parameter size and quantization precision in a model identifier together determine the actual footprint, and precision makes a visible difference at the same parameter size. Choose based on a balance between quality and resource usage rather than simply chasing the smallest size.

    5. Common Problems and Troubleshooting Order

    • Variable is set but files still land on the system drive: Usually the terminal was not restarted, or a variable of the same name exists at both system and user level with the higher-precedence one winning. Align the levels and retry.
    • Download interrupted or checksum failure: Check free space on the target drive and network stability first, then consider switching the download source rather than retrying repeatedly.
    • Service exits immediately on start: Check the runtime’s log directory. Common causes are a port already in use or virtualization not enabled.
    • Inference speed drops sharply: Confirm whether it has fallen back to CPU mode, and check whether memory headroom is being squeezed by other processes.
    • Models “disappear” after relocating the directory: The environment variable was not updated, or the migration missed manifest and cache files, leaving the runtime unable to recognize existing weights.

    6. Engineering Recommendations

    Treat local inference as infrastructure that needs ongoing maintenance, not a one-time install. Three practices are worth keeping: put directories and variables under version control so configuration changes are traceable; store models in separate directories by purpose so test and production setups do not get mixed; and set capacity alerts on the system drive to proactively remove old weight versions before hitting the threshold. If you later need to share models across users or machines, place the repository on shared storage and connect to it through a consistent environment variable convention, while keeping the runtime itself independent on each machine. That controls space usage and reduces the impact of upgrades on one another.