@echo off setlocal cd /d "%~dp0" set "PHILL_OLLAMA_HOST=http://127.0.0.1:11435" echo [PhillSwarm] Setting persistent user OLLAMA_HOST=%PHILL_OLLAMA_HOST% setx OLLAMA_HOST "%PHILL_OLLAMA_HOST%" >nul set "OLLAMA_HOST=%PHILL_OLLAMA_HOST%" powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$existing = Get-CimInstance Win32_Process | Where-Object { ($_.Name -like 'python*' -or $_.Name -eq 'py.exe') -and $_.CommandLine -like '*launch_ollama_bridge.py*' -and $_.CommandLine -like '*11435*' }; if (-not $existing) { Start-Process -FilePath 'py' -ArgumentList @('-3','launch_ollama_bridge.py','--model','.','--port','11435') -WorkingDirectory '%~dp0' -WindowStyle Minimized }" echo [PhillSwarm] Waiting for bridge... powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$ready=$false; for($i=0;$i -lt 30;$i++){ try { Invoke-RestMethod -Uri '%PHILL_OLLAMA_HOST%/api/tags' -TimeoutSec 2 | Out-Null; $ready=$true; break } catch { Start-Sleep -Seconds 1 } }; if(-not $ready){ exit 1 }" if errorlevel 1 ( echo [PhillSwarm] ERROR: bridge did not become ready at %PHILL_OLLAMA_HOST% echo [PhillSwarm] Try: py -3 launch_ollama_bridge.py --model . --port 11435 exit /b 1 ) echo [PhillSwarm] Bridge ready. echo [PhillSwarm] Testing Ollama CLI... ollama list echo. echo [PhillSwarm] Setup complete. Open a new CMD/PowerShell, then use: echo ollama run phillswarm-4b:full echo. echo [PhillSwarm] In this CMD window you can use it now: echo ollama run phillswarm-4b:full "What is 2+2?" endlocal