diff --git a/install-windows.ps1 b/install-windows.ps1 index 0bc62f3..ac5a418 100644 --- a/install-windows.ps1 +++ b/install-windows.ps1 @@ -218,6 +218,31 @@ if ($LASTEXITCODE -ne 0 -or -not $ChatModel -or -not $MemModel) { Write-Fail "Could not read the default models from synapse\nexus_config.py - the venv install is broken" } +# Models live in the project's own store on both platforms, so `ncp models list` +# and a NexusOS-spawned `ollama serve` agree on where they are. Without this the +# installer pulled into %USERPROFILE%\.ollama and NexusOS looked somewhere else. +Write-Step "Pointing Ollama at the project model store" +$ModelStore = Join-Path $RepoRoot "models" +New-Item -ItemType Directory -Path $ModelStore -Force | Out-Null +# An existing install has GBs already downloaded in the default store. Move it +# rather than make the user fetch it again; on the same volume this is instant. +$LegacyStore = Join-Path $env:USERPROFILE ".ollama\models" +if ((Test-Path (Join-Path $LegacyStore "blobs")) -and + -not (Test-Path (Join-Path $ModelStore "blobs"))) { + Write-Host " Moving models from $LegacyStore (no re-download)..." -ForegroundColor DarkGray + try { + foreach ($sub in @("blobs", "manifests")) { + $src = Join-Path $LegacyStore $sub + if (Test-Path $src) { Move-Item -Path $src -Destination (Join-Path $ModelStore $sub) -Force } + } + Write-OK "Existing models moved into $ModelStore" + } catch { + Write-Warn "Could not move the old model store - the pull below will refetch." + } +} +$env:OLLAMA_MODELS = $ModelStore +Write-OK "Model store: $ModelStore" + Write-Step "Pulling models ($ChatModel for chat, $MemModel for memory)" Write-Host " Downloads a few GB; press Ctrl+C to skip and pull them later from the Models tab." -ForegroundColor DarkGray # No pipe: 'ollama pull' draws a progress bar with cursor control, and piping it