Add Windows (PowerShell) support
- scripts/setup.ps1, scripts/pull-models.ps1, run.ps1 — PowerShell equivalents of the bash setup/pull/run scripts - README + docs/DEPLOY.md: Windows quickstart and Task Scheduler autostart Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9938d46a67
commit
95da8fb38d
@@ -0,0 +1,37 @@
|
||||
# One-time setup on Windows: create the Python 3.12 venv and install LiteLLM + Pillow.
|
||||
# The router itself is stdlib-only; this is for the LiteLLM backend.
|
||||
# Run: powershell -ExecutionPolicy Bypass -File .\scripts\setup.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
Set-Location (Split-Path $PSScriptRoot -Parent) # repo root
|
||||
|
||||
function Find-Py312 {
|
||||
if (Get-Command py -ErrorAction SilentlyContinue) {
|
||||
try { if ((& py -3.12 --version 2>&1) -match "3\.12") { return @("py", "-3.12") } } catch {}
|
||||
}
|
||||
foreach ($c in @("python3.12", "python")) {
|
||||
if (Get-Command $c -ErrorAction SilentlyContinue) {
|
||||
try { if ((& $c --version 2>&1) -match "3\.12") { return @($c) } } catch {}
|
||||
}
|
||||
}
|
||||
return $null
|
||||
}
|
||||
|
||||
$py = Find-Py312
|
||||
if (-not $py) {
|
||||
Write-Error "Python 3.12 not found. Install it: winget install Python.Python.3.12 (or python.org)"
|
||||
exit 1
|
||||
}
|
||||
$exe = $py[0]
|
||||
$baseArgs = if ($py.Count -gt 1) { $py[1..($py.Count - 1)] } else { @() }
|
||||
Write-Host ">> using Python 3.12 via '$($py -join ' ')'"
|
||||
|
||||
if (-not (Test-Path ".venv")) { & $exe @baseArgs -m venv .venv }
|
||||
$vpy = ".\.venv\Scripts\python.exe"
|
||||
& $vpy -m pip install -q --upgrade pip
|
||||
& $vpy -m pip install -q -r requirements.txt
|
||||
& $vpy -c "import litellm, PIL; print('>> deps OK (litellm, pillow)')"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Next:"
|
||||
Write-Host " .\scripts\pull-models.ps1 # pull a model fleet (edit the list first)"
|
||||
Write-Host " .\run.ps1 # start LiteLLM + router"
|
||||
Reference in New Issue
Block a user