11. Antivirus Considerations
Windows Defender (built into Windows Security) scans files on first access. For large model files (7 GB+), this causes two problems: download speed drops to 20-30% of available bandwidth while Defender scans the file in real time, and the first inference run is slow because the binary gets rescanned. In worst cases, Defender quarantines the Ollama or LM Studio executable, which silently breaks the tool with no visible error message.
Check Windows Security exclusions:
Get-MpPreference | Select-Object -ExpandProperty ExclusionPath
Add exclusions for known safe directories:
# Exclude Ollama model storage
Add-MpPreference -ExclusionPath "$env:LOCALAPPDATA\Ollama\models"
# Exclude Ollama program directory
Add-MpPreference -ExclusionPath "$env:LOCALAPPDATA\Programs\Ollama"
# Exclude Docker data directory
Add-MpPreference -ExclusionPath "C:\ProgramData\docker"
# Exclude WSL2 VHDX file
Add-MpPreference -ExclusionPath "$env:USERPROFILE\AppData\Local\wsl"
Third-party antivirus (Kaspersky, Bitdefender, Malwarebytes) has similar real-time scanning behavior. Most support "gaming mode" or "resource-intensive application" exclusions that pause scanning during active use. Setting an exclusion for the entire model directory is the most reliable solution.
Ollama binary signatures may not be trusted by Windows SmartScreen on first run. If SmartScreen blocks the installer, use:
Start-Process -FilePath "C:\path\to\OllamaSetup.exe" -ArgumentList "/S" -Verb RunAs
The /S flag runs the installer silently. If SmartScreen still blocks it, right-click the .exe, Properties, unblock, then run.
Local verification checkpoint
Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.
Run a large model download with Ollama, time it, then add the model directory to Windows Defender exclusions, delete the downloaded model with ollama rm, and time the same download again. Compare the two download durations.