This article was originally published on runaihome.com
500 Internal Server Error in Ollama v0.30.4 with Non-ASCII Windows Username Paths
Ollama v0.30.4 crashes with a 500 Internal Server Error when running on Windows systems where the user profile path contains non-ASCII characters. This occurs because the llama-server process fails to properly handle paths containing Unicode characters in the C:\Users\<username> directory structure. The model loading process terminates prematurely, leaving the server unable to initialize models stored in the default path.
Fix 1: Redirect Models Directory via Environment Variable
Set a custom models path that avoids the user profile directory entirely:
PowerShell (temporary):
$env:OLLAMA_MODELS = "C:\ollama-models"
ollama run llama2
PowerShell (persistent):
[System.Environment]::SetEnvironmentVariable("OLLAMA_MODELS", "C:\ollama-models", "User")
Create the directory and move existing models:
New-Item -ItemType Directory -Path "C:\ollama-models"
Copy-Item -Path "$env:LOCALAPPDATA\Ollama\models\*" -Destination "C:\ollama-models" -Recurse
Fix 2: Create NTFS Junction Point
Preserve the default Ollama behavior while redirecting the physical storage location:
# Stop Ollama service first
Stop-Service Ollama
# Remove existing models directory
Remove-Item "$env:LOCALAPPDATA\Ollama\models" -Recurse
# Create junction point from user profile to ASCII-only path
cmd /c 'mklink /J "%LOCALAPPDATA%\Ollama\models" C:\ollama-models'
# Start Ollama service
Start-Service Ollama
Fix 3: Update to Ollama v0.1.23 or Later
Later versions (v0.1.23+) addressed Unicode path handling in Windows builds. Verify your version:
ollama --version
If below v0.1.23, download the latest release from https://ollama.com/download and reinstall. The update process preserves existing models in %LOCALAPPDATA%\Ollama\models.
Which Fix to Use
Use Fix 1 for immediate temporary testing
Top comments (0)