<# .SYNOPSIS Builds the Windows runtime in Docker (no Visual Studio needed) and packs dist\leleka-windows-x64.zip. .DESCRIPTION 1. docker build -f deploy\Dockerfile.windows-build exports the mingw cross-compiled executables to dist\windows. 2. The zip holds bin\*.exe, Start-Leleka.ps1, README.txt and SHA256SUMS.txt. Model weights and OpenVINO are not included (the model is the user's own file; OpenVINO is only needed for -Mode npu). Docker Desktop must be running. Nothing is pushed or uploaded. #> [CmdletBinding()] param([switch] $SkipBuild) $ErrorActionPreference = 'Stop' $root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path $dist = Join-Path $root 'dist' if (-not $SkipBuild) { Push-Location $root try { docker build -f deploy/Dockerfile.windows-build --target export -o type=local,dest=dist/windows . if ($LASTEXITCODE -ne 0) { throw 'docker build failed' } } finally { Pop-Location } } $stage = Join-Path $dist 'leleka-windows-x64' if (Test-Path $stage) { Remove-Item -Recurse -Force $stage } New-Item -ItemType Directory -Force (Join-Path $stage 'bin') | Out-Null Copy-Item (Join-Path $dist 'windows\*.exe') (Join-Path $stage 'bin') Copy-Item (Join-Path $PSScriptRoot 'Start-Leleka.ps1') $stage @" Leleka gpt-oss runtime for Windows x64 (experimental build, see docs/windows-runtime.md in the repository) powershell -File Start-Leleka.ps1 -Model \gpt-oss-20b-MXFP4.gguf Serves http://127.0.0.1:8081/v1/responses. Needs about 12 GB of free memory for the model plus the KV caches (-Context, -CacheSlots) and an AVX2 CPU. -Mode igpu (default) prefills long prompts on the integrated GPU, -Mode cpu uses the CPU only, -Mode npu needs an unpacked OpenVINO runtime (-OpenVinoRoot) and an Intel NPU. "@ | Set-Content -Encoding ascii (Join-Path $stage 'README.txt') Get-ChildItem $stage -Recurse -File | ForEach-Object { '{0} {1}' -f (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower(), $_.FullName.Substring($stage.Length + 1).Replace('\', '/') } | Set-Content -Encoding ascii (Join-Path $stage 'SHA256SUMS.txt') $zip = Join-Path $dist 'leleka-windows-x64.zip' if (Test-Path $zip) { Remove-Item -Force $zip } Compress-Archive -Path (Join-Path $stage '*') -DestinationPath $zip "{0} {1:N1} MB" -f $zip, ((Get-Item $zip).Length / 1MB)