How to Configure Custom Installation Paths and Model Storage Locations for Local LLM Frameworks on Windows

    This guide explains how to keep your Windows system drive clean when deploying a local LLM inference framework. It covers why disk planning matters, how to install the framework software into a custom directory using command-line installer arguments, how to redirect model file storage via environment variables (such as OLLAMA_MODELS), how to migrate existing models, and how to troubleshoot common configuration issues.

    1. Why Installation and Model Storage Paths Matter

    When deploying a local LLM inference framework on Windows, disk space planning is an often-overlooked step that can cause serious problems later. There are two main reasons:

    1. The software itself takes up significant space. These frameworks typically bundle the inference engine, runtime dependencies, and default base models or components, easily occupying several GB after installation. If you click through the installer with default settings, all of this lands on your C: drive under Program Files and user data directories.

    2. Model files are the real space hogs. Large language model files consist mainly of weight parameters. A quantized 7B model usually requires 4–8 GB, 13B and larger models often take tens of GB, and higher-precision or larger models can reach dozens or even hundreds of GB per file. Once you start comparing multiple models in experiments, storage consumption grows rapidly.

    A full system drive causes more than just “out of space” warnings: when free space on the system drive runs low, Windows may suffer from insufficient virtual memory, failed updates, and sluggish application response—in severe cases, even boot and login issues. Planning your paths at installation time is the lowest-cost, highest-payoff approach.

    The overall strategy has two steps: first, install the framework software itself into a designated drive; second, redirect the default model storage location to a data drive. The two steps are independent, and both are required.

    2. Step 1: Specify the Software Installation Location via Command-Line Arguments

    Most Windows software distributed as installer packages (.exe) does not expose an explicit “custom path” screen by default, but installers typically support standard silent arguments that let you pass in a target directory at launch.

    Follow these steps:

    1. Open a command prompt in the installer’s directory. Locate the folder containing the downloaded installer (assume it’s Installer.exe). Type cmd in the folder’s address bar and press Enter to open a command prompt with that folder as the working directory, avoiding a manual cd.

    2. Run the installer with arguments. Enter:

    1. Installer.exe /DIR="E:\DEVTOOLS\LLMRuntime"

    The /DIR argument specifies the installation target directory; adjust the quoted path to match your disk layout. If the path contains spaces, it must be wrapped in quotes, or the argument will be parsed incorrectly.

    1. Confirm in the graphical installer. The regular installation UI appears after running the command. Click “Install” to begin. On the progress screen, the target directory should already display your specified path—double-check it here.

    2. Finish and verify. After installation completes, confirm the files are in place in your target directory, and check that no large installation folder was created on the C: drive.

    Important reminder: at this point only the software itself has been relocated. If you start downloading models immediately, model files will still be written to the user directory on the C: drive by default, so you must complete step 2.

    3. Step 2: Redirect the Model Storage Location

    The model storage path is usually not controlled by the installer UI, but through an environment variable. This variable (commonly named following the model-directory convention, e.g., OLLAMA_MODELS) is read at framework startup and determines the root directory for model downloads and loading.

    Option 1: Use the Graphical Settings Panel

    Newer versions often provide a settings panel inside the app with a model storage path option. Open the app’s settings, find the storage path option, click “Browse” to select a new target directory (e.g., D:\ollama\models), and save. This approach and the environment variable approach below are functionally identical—either works.

    Option 2: Use System Environment Variables

    If you prefer system-level configuration, or your version has no visual setting, use environment variables:

    1. Press Win + R, type sysdm.cpl, and press Enter to open System Properties quickly (you can also go to Settings → System → System Info → Advanced system settings);
    2. Switch to the Advanced tab and click Environment Variables;
    3. Under User variables or System variables, click New, enter OLLAMA_MODELS as the variable name and the target path as the value, e.g., D:\ollama\models;
    4. Click OK in every open dialog to save.

    User variables apply only to the current user; system variables apply to all users. Either meets the need; on shared machines, system variables are recommended.

    Making the Configuration Take Effect and Verifying It

    How environment variables take effect is the most common pitfall. Pay close attention to the following:

    • You must restart the application process. If the framework is running, after modifying the variable you must fully exit it—including background tray processes and resident services—and start it again before the new path is read. Closing only the window while the process keeps running in the background is the most common cause of “the configuration didn’t work.”
    • You must reopen command-line windows. Already-open PowerShell or CMD windows inherit an old snapshot of environment variables; close and reopen them.
    • Verify the variable. In a newly opened PowerShell, run:
    1. echo $env:OLLAMA_MODELS

    or in CMD:

    1. echo %OLLAMA_MODELS%

    If the configured path is printed, the variable is set correctly.

    • Verify with a real test. A correct environment variable doesn’t guarantee everything works. The most reliable verification is to pull a small model and check whether a model folder appears in the target directory, while confirming no new model files appear in the original default directory on the C: drive.

    4. Migrating Existing Models and Cleanup

    If you already installed the framework and downloaded models, handle the existing files in addition to configuring the new path:

    1. Manually migrate the model files. Copy everything from the default model directory on the C: drive (copy first, and only delete the original directory after confirming everything works) to the new storage path, preserving the internal directory structure.
    2. Confirm the framework recognizes them. After migration, restart the framework and run the model list command to confirm the migrated models are listed and load correctly.
    3. Clean up the C: drive. Once everything runs properly, delete the model files from the original C: drive directory to free up space.

    5. Common Problems and Troubleshooting

    • Models still download to the C: drive after configuration: First check whether any background process failed to fully exit; then confirm the variable name is spelled correctly and the path exists with write permissions.
    • Paths containing non-ASCII characters or spaces cause errors: Use pure-English, space-free directories for storage paths to avoid path-parsing compatibility issues in some components.
    • Multi-disk planning tips: Choose a drive with ample free space and good read/write performance—preferably an SSD. Loading large models from a mechanical hard drive takes noticeably longer.

    6. Summary

    Disk planning for local LLM deployment boils down to a fixed routine: specify the software directory with the /DIR argument at install time → redirect storage via a model-directory environment variable (e.g., OLLAMA_MODELS) → restart the process and verify with a real test → migrate existing models and clean up the C: drive. After this configuration, both the software and tens-of-GB model files will live stably on your data drive, your C: drive stays protected, and you leave ample headroom for future multi-model experiments and expansion. Making a habit of planning storage paths at installation time is one of the smallest-investment, highest-return practices in local AI development environment management.