# Packaging DPS Coach (Advanced Build)
These steps produce the single **Advanced** distribution: Analyze logs, run the SQL-first MCP tooling, and chat with the embedded AI coach. There is no Insights-only variant.
## Prerequisites
- Windows 10/11
- Python 3.11 installed and registered with the `py` launcher
- PowerShell 7+ (for `pwsh`)
## Build Steps
1. Open PowerShell at the project root (`tl-dps-mcp`).
2. Execute the build script:
```powershell
pwsh -ExecutionPolicy Bypass -File app/build_windows.ps1
```
The script will:
- Create (or reuse) a `build_env` virtual environment.
- Install everything listed in `requirements_build.txt` (PySide6 + duckdb + PyInstaller + llama-cpp-python cp311 wheels via `--only-binary :all:`).
- Run PyInstaller (`app/pyinstaller.spec`) to emit `dist/DPSCoach`.
3. When the command completes, the packaged app lives at `dist/DPSCoach/DPSCoach.exe`. All runtime dependencies are inside that folder; no additional installers are required for end users.
4. Zip for distribution if needed:
```powershell
Compress-Archive -Path dist/DPSCoach -DestinationPath dist/DPSCoach.zip -Force
```
Ship `DPSCoach.zip`; recipients extract and launch `DPSCoach.exe` directly.
## Why the model is not bundled
The EXE deliberately omits GGUF weights. On first launch the UI offers a one-click download or lets the user select an existing file, then stores it under `%APPDATA%\DPSCoach\models\model.gguf`. This keeps the installer under 200 MB while still providing a deterministic coach once the model is present.
## Verifying the Build
1. Launch `dist/DPSCoach/DPSCoach.exe` on a clean machine.
2. Use `Analyze` against the bundled sample log (or your own directory) and wait for the summary tables to populate.
3. Click “Download Model” in the Coach tab if the weights are missing. The UI validates GGUF magic, size, and a deterministic “Say OK.” self-test before unlocking chat.
4. Ask a question such as “Top 10 damage skills and their damage share.” Confirm that the SQL trace shows the planner’s query and that the answer references the returned rows.
5. No `pip install` prompts should appear at runtime; everything except the model download is already packaged.