packages: install-from-packages guide, Windows installer (Docker Desktop +...

packages: install-from-packages guide, Windows installer (Docker Desktop + WSL2 launcher, Inno Setup build under wine)
Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKm7Z56iKjHgNkHc6VhWKz
parent 70453cd6
...@@ -415,6 +415,12 @@ That's it. Open `http://127.0.0.1:8776/admin` and log in with `admin` / `admin`. ...@@ -415,6 +415,12 @@ That's it. Open `http://127.0.0.1:8776/admin` and log in with `admin` / `admin`.
## Installation ## Installation
**From the published packages (no build):** `docker pull ghcr.io/nextime/coderai:latest` and
`packaging/linux/run_oci.sh --nvidia -d` on Linux; `CoderAI-Setup-<version>.exe` (Docker Desktop +
WSL2, NVIDIA) on Windows — see [`docs/install-from-packages.md`](docs/install-from-packages.md)
for every package (the full image and the nineteen capability images), the plain `docker run`,
the offline tarball and the Windows notes. The rest of this section is the from-source install.
### Prerequisites ### Prerequisites
- Python 3.8+ - Python 3.8+
...@@ -577,6 +583,7 @@ The [`docs/`](docs/) directory carries the deep dives — one per engine and sub ...@@ -577,6 +583,7 @@ The [`docs/`](docs/) directory carries the deep dives — one per engine and sub
| [`frontend-engine-split.md`](docs/frontend-engine-split.md) | Front proxy, engine subprocesses, routing | | [`frontend-engine-split.md`](docs/frontend-engine-split.md) | Front proxy, engine subprocesses, routing |
| [`runpod.md`](docs/runpod.md) | Renting remote GPUs: pods, serverless, budgets, the reaper | | [`runpod.md`](docs/runpod.md) | Renting remote GPUs: pods, serverless, budgets, the reaper |
| [`remote-execution.md`](docs/remote-execution.md) | Running any model type elsewhere: the capability gateway, per-model placement, weights and adapters on a pod, test runs | | [`remote-execution.md`](docs/remote-execution.md) | Running any model type elsewhere: the capability gateway, per-model placement, weights and adapters on a pod, test runs |
| [`install-from-packages.md`](docs/install-from-packages.md) | The published images (full + nineteen capability images), Linux and Windows installs, the offline tarball |
| [`cluster.md`](docs/cluster.md) | Several machines as one: cluster nodes as engines, one GGUF over llama.cpp RPC, vLLM/SGLang multi-node, pools of hosts and remotes | | [`cluster.md`](docs/cluster.md) | Several machines as one: cluster nodes as engines, one GGUF over llama.cpp RPC, vLLM/SGLang multi-node, pools of hosts and remotes |
| [`vllm.md`](docs/vllm.md) | vLLM as a first-class engine node | | [`vllm.md`](docs/vllm.md) | vLLM as a first-class engine node |
| [`deepseek-ds4.md`](docs/deepseek-ds4.md) · [`glm-colibri.md`](docs/glm-colibri.md) · [`kimi-k3.md`](docs/kimi-k3.md) · [`ktransformers.md`](docs/ktransformers.md) | The native MoE engines | | [`deepseek-ds4.md`](docs/deepseek-ds4.md) · [`glm-colibri.md`](docs/glm-colibri.md) · [`kimi-k3.md`](docs/kimi-k3.md) · [`ktransformers.md`](docs/ktransformers.md) | The native MoE engines |
......
# Installing from the published packages
Everything CoderAI ships is a container image on GitHub Container Registry,
public, pulled without credentials. There is nothing to build.
## The packages
| Package | What it is | Pull |
|---|---|---|
| `ghcr.io/nextime/coderai` | **The full CoderAI** — every capability, every engine, the Web Studio and admin UI, the cluster head/node, llama.cpp with the RPC backend and `rpc-server`. One layer, ~28 GB. Tags: `latest`, `0.2.20`, … | `docker pull ghcr.io/nextime/coderai:latest` |
| `ghcr.io/nextime/coderai-images` | Image generation only (SDXL, Flux, Z-Image …) | `docker pull ghcr.io/nextime/coderai-images:latest` |
| `ghcr.io/nextime/coderai-video` | Video generation (Wan, LTX-2 …), upscale, interpolation | `…/coderai-video:latest` |
| `ghcr.io/nextime/coderai-text` | LLMs with transformers / llama.cpp, incl. local LoRA adapters | `…/coderai-text:latest` |
| `ghcr.io/nextime/coderai-llama` | llama.cpp GGUF server as a CoderAI pod (light core, CUDA for Ampere→Blackwell, RPC) | `…/coderai-llama:latest` |
| `ghcr.io/nextime/coderai-vllm` | vLLM as a CoderAI pod (its own venv, `+cu129` build, Ray worker mode) | `…/coderai-vllm:latest` |
| `ghcr.io/nextime/coderai-engines` | ds4, colibri, kimi-k3-in-c compiled for sm_80…sm_120a | `…/coderai-engines:latest` |
| `ghcr.io/nextime/coderai-engines-kt` | ktransformers (SGLang + kt-kernel) | `…/coderai-engines-kt:latest` |
| `ghcr.io/nextime/coderai-embeddings` | Embeddings and reranking | `…/coderai-embeddings:latest` |
| `ghcr.io/nextime/coderai-ocr` | Document OCR (docTR, Surya) | `…/coderai-ocr:latest` |
| `ghcr.io/nextime/coderai-ocr-paddle` | PaddleOCR (own CUDA runtime) | `…/coderai-ocr-paddle:latest` |
| `ghcr.io/nextime/coderai-tts` | Text-to-speech (Kokoro, F5-TTS …) | `…/coderai-tts:latest` |
| `ghcr.io/nextime/coderai-tts-xtts` | Coqui XTTS | `…/coderai-tts-xtts:latest` |
| `ghcr.io/nextime/coderai-stt` | Transcription (whisper.cpp, Wav2Vec2, Vosk) | `…/coderai-stt:latest` |
| `ghcr.io/nextime/coderai-stt-nemo` | NVIDIA NeMo Canary / Parakeet | `…/coderai-stt-nemo:latest` |
| `ghcr.io/nextime/coderai-stt-crisper` | CrisperWhisper | `…/coderai-stt-crisper:latest` |
| `ghcr.io/nextime/coderai-speaker` | Diarization and speaker recognition (pyannote) | `…/coderai-speaker:latest` |
| `ghcr.io/nextime/coderai-voice` | Voice cloning and conversion | `…/coderai-voice:latest` |
| `ghcr.io/nextime/coderai-audio` | Music / sound generation, stems | `…/coderai-audio:latest` |
| `ghcr.io/nextime/coderai-faceswap` | Face swap | `…/coderai-faceswap:latest` |
The capability images are the same codebase with only one capability's
dependencies (5–12 GB). They are what a RunPod pod, a `host` machine or a
cluster node that only needs one thing runs; the full image is what a
workstation runs. All of them expose the same API on port 8000 (capability
images) or 8776 (full image), and all of them can be a cluster node.
Every tag is also published with its version (`:0.2.20`); `:latest` moves
only after the image has completed a real request on real hardware.
A tarball of the full image (`docker save`, gzip, ~15 GB) is attached to
each GitHub release for offline installs: `docker load < coderai-base-<version>.tar.gz`.
## Linux
Requirements: Docker (or Podman) and, for NVIDIA cards, the NVIDIA
container toolkit. AMD/Intel cards use Vulkan (`--vulkan`).
```bash
docker pull ghcr.io/nextime/coderai:latest
curl -fsSLO https://raw.githubusercontent.com/nextime/coderai/master/packaging/linux/run_oci.sh
chmod +x run_oci.sh
./run_oci.sh --nvidia --data-dir ~/coderai-runtime -d # first run creates config/, models/, cache/
```
Then open `http://localhost:8776/admin` (first-run admin login is printed in
the log; `./run_oci.sh --help` lists every option: `--vulkan`, `--all`,
`--local` to use an existing `~/.coderai`, `--map` for model directories,
`--upgrade` to pull the production branch in place).
`packaging/linux/run_oci.sh` installs itself as `coderai-docker`
(`~/.local/usr/bin`) on first use, so afterwards it is simply
`coderai-docker --nvidia -d` and `coderai-docker --upgrade`.
Without the script, the plain `docker run` it builds is:
```bash
docker run --rm --name coderai --ipc=host --gpus all \
-e NVIDIA_DRIVER_CAPABILITIES=all -e CODERAI_HOST=0.0.0.0 -e CODERAI_PORT=8776 \
-p 8776:8776 \
-v ~/coderai-runtime/config:/config -v ~/coderai-runtime/models:/models -v ~/coderai-runtime/cache:/cache \
ghcr.io/nextime/coderai:latest
```
## Windows (NVIDIA, via Docker Desktop + WSL2)
CoderAI on Windows is the same Linux image under Docker Desktop's WSL2
backend with CUDA-on-WSL: text, images, video, audio, cluster head or node,
RunPod escalation — everything except the AMD/Intel Vulkan path, which WSL2
does not expose to Linux containers.
`packaging/windows/` holds the installer:
* `CoderAI-Setup.exe` (attached to each GitHub release) — installs the
launcher, adds it to PATH and the Start menu, and on first run enables
WSL2, installs Docker Desktop through `winget` if it is missing, checks the
NVIDIA driver, and pulls the image.
* Or, without the .exe, in an elevated PowerShell:
```powershell
irm https://raw.githubusercontent.com/nextime/coderai/master/packaging/windows/install-coderai.ps1 | iex
```
Afterwards: `coderai` (starts, opens the admin page), `coderai -Stop`,
`coderai -Upgrade`, `coderai -Logs`. Data lives under
`%LOCALAPPDATA%\CoderAI` (config, models, cache); keep it on the WSL/NTFS
drive with the most space — `coderai -DataDir D:\coderai`.
Windows notes: `.wslconfig` must give the WSL2 VM enough memory
(`memory=32GB` or more for video models); a Windows box works as a cluster
*head* out of the box, and as a *node*, RPC server or Ray worker once the
ports are published (Docker Desktop is NAT'd; `coderai -Port` and the
node's advertise host are the two settings).
## Other machines' capability images as hosts and nodes
A capability image on a machine you own is a `host` backend or a cluster
node exactly like a pod would be:
```bash
docker run -d --name coderai-images --gpus all -p 8000:8000 \
-e CODERAI_API_TOKEN=some-token ghcr.io/nextime/coderai-images:latest
```
then on the head: model → *Runs on: a machine of yours*, URL
`http://thatbox:8000`, token `some-token` — or Settings → Cluster → add it
as a node. `CODERAI_RPC_SERVER_PORT=50052` on the `coderai-llama` image also
lends its card to a GGUF loaded elsewhere; `CODERAI_RAY_ADDRESS=…` turns the
`coderai-vllm` image into a Ray worker for a multi-node vLLM launch. See
[`cluster.md`](cluster.md) and [`remote-execution.md`](remote-execution.md).
; Inno Setup script for CoderAI-Setup.exe — installs the Windows launcher and,
; on first launch, runs install-coderai.ps1 (WSL2, Docker Desktop, the image).
; Build: iscc CoderAI.iss (or packaging/windows/build-installer.sh under wine)
#ifndef AppVersion
#define AppVersion "0.2.20"
#endif
[Setup]
AppId={{7C1E7F2A-6B3D-4B2D-9C7B-CODERAI0001}
AppName=CoderAI
AppVersion={#AppVersion}
AppPublisher=Nexlab
AppPublisherURL=https://www.nexlab.net/projects/coderai/
AppSupportURL=https://aisbf.cloud/coderai/docs/
DefaultDirName={localappdata}\Programs\CoderAI
DefaultGroupName=CoderAI
DisableProgramGroupPage=yes
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputBaseFilename=CoderAI-Setup-{#AppVersion}
Compression=lzma2
SolidCompression=yes
ChangesEnvironment=yes
WizardStyle=modern
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
[Files]
Source: "coderai.ps1"; DestDir: "{app}"; Flags: ignoreversion
Source: "coderai.cmd"; DestDir: "{app}"; Flags: ignoreversion
Source: "install-coderai.ps1"; DestDir: "{app}"; Flags: ignoreversion
Source: "README.md"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\CoderAI"; Filename: "{app}\coderai.cmd"; WorkingDir: "{app}"
Name: "{group}\CoderAI — stop"; Filename: "{app}\coderai.cmd"; Parameters: "-Stop"; WorkingDir: "{app}"
Name: "{group}\CoderAI — upgrade"; Filename: "{app}\coderai.cmd"; Parameters: "-Upgrade"; WorkingDir: "{app}"
Name: "{group}\Set up WSL2 + Docker (admin)"; Filename: "powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -File ""{app}\install-coderai.ps1"" -NoPull"; WorkingDir: "{app}"
Name: "{group}\CoderAI docs"; Filename: "https://aisbf.cloud/coderai/docs/install.html"
[Registry]
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath('{app}')
[Run]
Filename: "powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -File ""{app}\install-coderai.ps1"" -NoPull"; Description: "Set up WSL2 and Docker Desktop now (needs administrator)"; Flags: postinstall shellexec runascurrentuser skipifsilent; Verb: runas
Filename: "{app}\coderai.cmd"; Description: "Start CoderAI (pulls the ~28 GB image on first run)"; Flags: postinstall shellexec skipifsilent unchecked
[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', OrigPath) then
begin
Result := True;
exit;
end;
Result := Pos(';' + Uppercase(Param) + ';', ';' + Uppercase(OrigPath) + ';') = 0;
end;
# CoderAI on Windows
CoderAI runs on Windows as the published Linux image under **Docker Desktop
(WSL2 backend)** with the NVIDIA GPU passed through (CUDA on WSL). Everything
works — text, images, video, audio, the cluster head or node, RunPod
escalation — except the AMD/Intel Vulkan path, which WSL2 does not expose.
## Install
Either run `CoderAI-Setup-<version>.exe` from the GitHub release, or in an
elevated PowerShell:
```powershell
irm https://raw.githubusercontent.com/nextime/coderai/master/packaging/windows/install-coderai.ps1 | iex
```
It enables WSL2, installs Docker Desktop with winget when missing, checks the
NVIDIA driver (470+), installs the `coderai` launcher on PATH and pulls
`ghcr.io/nextime/coderai:latest` (~28 GB). A reboot may be needed after the
WSL2 / Docker Desktop step; then run `coderai`.
## Use
```
coderai start (pull if needed) and open http://localhost:8776/admin
coderai -Stop stop
coderai -Logs follow the log (the first-run admin login is printed there)
coderai -Upgrade pull the production branch into the image in place
coderai -DataDir D:\coderai -Port 9000 -Image ghcr.io/nextime/coderai:0.2.20
coderai -NoGpu CPU only
```
Data (config, models, cache) lives under `%LOCALAPPDATA%\CoderAI` unless
`-DataDir` says otherwise; put it on the drive with the most space.
## Notes
* Give the WSL2 VM enough memory: `%USERPROFILE%\.wslconfig` with
`[wsl2]` / `memory=32GB` (more for video models), then `wsl --shutdown`.
* Docker Desktop is NAT'd: as a cluster *node*, RPC server or Ray worker the
machine needs its ports published (`-Port`) and the head must use the
Windows host's address. As a cluster *head* nothing special is needed.
* Building the .exe: `iscc CoderAI.iss` with Inno Setup 6 on Windows, or
`packaging/windows/build-installer.sh` under wine.
#!/usr/bin/env bash
# Build CoderAI-Setup-<version>.exe with Inno Setup 6 under wine (Linux), or
# fall back to a zip of the scripts when Inno Setup cannot be had.
# packaging/windows/build-installer.sh [VERSION]
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
ROOT="$(cd "$HERE/../.." && pwd)"
VER="${1:-$(python3 -c "import re;print(re.search(r'__version__ = \"([^\"]+)\"', open('$ROOT/codai/__init__.py').read()).group(1))")}"
OUT="$ROOT/dist"; mkdir -p "$OUT"
ISCC=""
for c in "$HOME/.wine/drive_c/InnoSetup/ISCC.exe" "$HOME/.wine/drive_c/Program Files (x86)/Inno Setup 6/ISCC.exe" "$HOME/.wine/drive_c/Program Files/Inno Setup 6/ISCC.exe"; do
[ -f "$c" ] && ISCC="$c" && break
done
# wine wants a display even for /VERYSILENT installs and for ISCC; xvfb-run gives it one.
WINE="wine"; command -v xvfb-run >/dev/null 2>&1 && WINE="xvfb-run -a wine"
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/tmp/xdg-$$}"; mkdir -p "$XDG_RUNTIME_DIR"
if [ -z "$ISCC" ] && command -v wine >/dev/null 2>&1 && [ "${INNO_DOWNLOAD:-1}" = 1 ]; then
echo "== installing Inno Setup 6 under wine (once) =="
tmp=$(mktemp -d); curl -fsSL -o "$tmp/is.exe" "${INNO_URL:-https://github.com/jrsoftware/issrc/releases/download/is-6_7_3/innosetup-6.7.3.exe}"
WINEDEBUG=-all $WINE "$tmp/is.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- '/DIR=C:\InnoSetup' >/dev/null 2>&1 || true
rm -rf "$tmp"
for c in "$HOME/.wine/drive_c/InnoSetup/ISCC.exe" "$HOME/.wine/drive_c/Program Files (x86)/Inno Setup 6/ISCC.exe"; do
[ -f "$c" ] && ISCC="$c" && break
done
fi
if [ -n "$ISCC" ]; then
echo "== building CoderAI-Setup-$VER.exe =="
( cd "$HERE" && WINEDEBUG=-all $WINE "$ISCC" "/DAppVersion=$VER" "/O$(winepath -w "$OUT")" CoderAI.iss )
ls -la "$OUT"/CoderAI-Setup-"$VER".exe
else
echo "Inno Setup not available: packaging the scripts as a zip instead" >&2
fi
( cd "$HERE" && zip -q -j "$OUT/coderai-windows-$VER.zip" coderai.ps1 coderai.cmd install-coderai.ps1 README.md CoderAI.iss )
ls -la "$OUT/coderai-windows-$VER.zip"
@echo off
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0coderai.ps1" %*
<#
.SYNOPSIS
CoderAI on Windows: run the published Linux image under Docker Desktop (WSL2)
with the NVIDIA GPU passed through.
.DESCRIPTION
The Windows twin of packaging/linux/run_oci.sh. Same container shape:
/config, /models, /cache bind-mounted from a data directory, the API on one
published port, --gpus all for CUDA-on-WSL. There is no /dev/nvidia* under
WSL2 (--gpus all is the whole GPU story there) and no Vulkan path.
.EXAMPLE
coderai # start (pull the image if needed) and open the admin page
coderai -Stop # stop the container
coderai -Logs # follow the log
coderai -Upgrade # pull the production branch into the image in place
coderai -DataDir D:\coderai -Port 9000 -Image ghcr.io/nextime/coderai:0.2.20
#>
[CmdletBinding()]
param(
[string]$Image = $(if ($env:CODERAI_IMAGE) { $env:CODERAI_IMAGE } else { "ghcr.io/nextime/coderai:latest" }),
[string]$DataDir = $(if ($env:CODERAI_DATA) { $env:CODERAI_DATA } else { Join-Path $env:LOCALAPPDATA "CoderAI" }),
[int]$Port = 8776,
[string]$Name = "coderai",
[switch]$Stop,
[switch]$Logs,
[switch]$Status,
[switch]$Upgrade,
[switch]$Pull,
[switch]$NoGpu,
[switch]$NoOpen,
[string]$ExtraArgs = ""
)
$ErrorActionPreference = "Stop"
function Need-Docker {
if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host "Docker is not installed. Run install-coderai.ps1 (elevated) first, or install Docker Desktop." -ForegroundColor Red
exit 2
}
docker info *> $null
if ($LASTEXITCODE -ne 0) {
Write-Host "Docker Desktop is not running — starting it..." -ForegroundColor Yellow
$dd = "$env:ProgramFiles\Docker\Docker\Docker Desktop.exe"
if (Test-Path $dd) { Start-Process $dd }
$deadline = (Get-Date).AddMinutes(3)
while ((Get-Date) -lt $deadline) {
Start-Sleep 5
docker info *> $null
if ($LASTEXITCODE -eq 0) { break }
}
docker info *> $null
if ($LASTEXITCODE -ne 0) { Write-Host "Docker did not come up." -ForegroundColor Red; exit 2 }
}
}
Need-Docker
if ($Stop) {
docker stop $Name 2>$null | Out-Null
Write-Host "stopped $Name"
exit 0
}
if ($Logs) { docker logs -f $Name; exit $LASTEXITCODE }
if ($Status) {
docker ps --filter "name=^$Name$" --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"
exit 0
}
if ($Pull) { docker pull $Image; exit $LASTEXITCODE }
# Data layout: the same three mounts the Linux runner uses.
foreach ($d in @("config", "models", "cache")) {
New-Item -ItemType Directory -Force -Path (Join-Path $DataDir $d) | Out-Null
}
if ($Upgrade) {
# The in-image upgrader (coderai-upgrade) pulls the production branch and
# commits the result back onto the same tag; restart afterwards.
Write-Host "upgrading $Image in place (production branch)..."
docker stop $Name 2>$null | Out-Null
docker run --rm --name "$Name-upgrade" --entrypoint /usr/local/bin/coderai-upgrade `
-e CODERAI_UPGRADE_REF=production `
-v "$($DataDir)\config:/config" -v "$($DataDir)\models:/models" -v "$($DataDir)\cache:/cache" `
$Image
if ($LASTEXITCODE -ne 0) { Write-Host "upgrade failed" -ForegroundColor Red; exit $LASTEXITCODE }
Write-Host "upgraded; start it again with: coderai"
exit 0
}
docker image inspect $Image *> $null
if ($LASTEXITCODE -ne 0) {
Write-Host "pulling $Image (this is a ~28 GB download the first time)..."
docker pull $Image
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
$running = docker ps -q --filter "name=^$Name$"
if ($running) {
Write-Host "$Name is already running on http://localhost:$Port"
} else {
docker rm -f $Name 2>$null | Out-Null
$gpu = @()
if (-not $NoGpu) { $gpu = @("--gpus", "all", "-e", "NVIDIA_DRIVER_CAPABILITIES=all") }
$dargs = @("run", "-d", "--name", $Name, "--ipc=host", "--restart", "unless-stopped") + $gpu + @(
"-e", "CODERAI_HOST=0.0.0.0", "-e", "CODERAI_PORT=8776",
"-p", "$($Port):8776",
"-v", "$($DataDir)\config:/config", "-v", "$($DataDir)\models:/models", "-v", "$($DataDir)\cache:/cache")
if ($ExtraArgs) { $dargs += @("-e", "CODERAI_EXTRA_ARGS=$ExtraArgs") }
$dargs += $Image
Write-Host "docker $($dargs -join ' ')"
& docker @dargs | Out-Null
if ($LASTEXITCODE -ne 0) { Write-Host "docker run failed" -ForegroundColor Red; exit $LASTEXITCODE }
Write-Host "CoderAI starting on http://localhost:$Port (data: $DataDir)"
Write-Host "first-run admin credentials are printed in the log: coderai -Logs"
}
if (-not $NoOpen) {
$deadline = (Get-Date).AddMinutes(5)
while ((Get-Date) -lt $deadline) {
try { Invoke-WebRequest -UseBasicParsing "http://localhost:$Port/healthz" -TimeoutSec 3 | Out-Null; break } catch { Start-Sleep 3 }
}
Start-Process "http://localhost:$Port/admin"
}
<#
.SYNOPSIS
Install CoderAI on Windows: WSL2 + Docker Desktop + the published image + the
`coderai` launcher on PATH.
.DESCRIPTION
Run in an ELEVATED PowerShell (the WSL and Docker Desktop steps need it):
irm https://raw.githubusercontent.com/nextime/coderai/master/packaging/windows/install-coderai.ps1 | iex
or, from the release zip / the .exe installer's directory:
.\install-coderai.ps1 [-Image ghcr.io/nextime/coderai:latest] [-InstallDir ...] [-NoPull]
What it does, each step skipped when already done:
1. enables the Windows features WSL2 needs and installs the WSL kernel;
2. installs Docker Desktop with winget if `docker` is not on PATH;
3. checks the NVIDIA driver (CUDA on WSL2 needs a 2021+ driver, 470 or newer);
4. copies coderai.ps1 / coderai.cmd to the install dir and adds it to PATH;
5. pulls the image (unless -NoPull) — ~28 GB.
Docker Desktop must be on the WSL2 backend (its default). After a fresh
WSL install Windows may need a reboot before Docker Desktop starts; the
script says so and the launcher takes over from there.
#>
[CmdletBinding()]
param(
[string]$Image = "ghcr.io/nextime/coderai:latest",
[string]$InstallDir = (Join-Path $env:LOCALAPPDATA "Programs\CoderAI"),
[switch]$NoPull,
[switch]$NoDocker
)
$ErrorActionPreference = "Stop"
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) { Write-Host "Please run this from an elevated (Administrator) PowerShell." -ForegroundColor Red; exit 2 }
function Step($msg) { Write-Host "`n== $msg" -ForegroundColor Cyan }
# 1. WSL2
Step "WSL2"
$needReboot = $false
foreach ($f in @("Microsoft-Windows-Subsystem-Linux", "VirtualMachinePlatform")) {
$state = (Get-WindowsOptionalFeature -Online -FeatureName $f).State
if ($state -ne "Enabled") {
Write-Host "enabling $f"
$r = Enable-WindowsOptionalFeature -Online -FeatureName $f -NoRestart
if ($r.RestartNeeded) { $needReboot = $true }
} else { Write-Host "$f already enabled" }
}
wsl --status *> $null
if ($LASTEXITCODE -eq 0) { Write-Host "wsl present" } else {
Write-Host "installing the WSL kernel"; wsl --install --no-distribution 2>$null; $needReboot = $true
}
wsl --set-default-version 2 *> $null
# 2. Docker Desktop
Step "Docker Desktop"
if ($NoDocker) { Write-Host "skipped (-NoDocker)" }
elseif (Get-Command docker -ErrorAction SilentlyContinue) { Write-Host "docker already installed: $(docker --version)" }
else {
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
Write-Host "winget is not available; install Docker Desktop from https://www.docker.com/products/docker-desktop/ and re-run." -ForegroundColor Yellow
exit 3
}
winget install --id Docker.DockerDesktop -e --accept-package-agreements --accept-source-agreements
if ($LASTEXITCODE -ne 0) { Write-Host "winget could not install Docker Desktop" -ForegroundColor Red; exit 3 }
$needReboot = $true
}
# 3. NVIDIA driver
Step "NVIDIA driver"
$smi = Get-Command nvidia-smi -ErrorAction SilentlyContinue
if ($smi) {
$ver = (& nvidia-smi --query-gpu=driver_version,name --format=csv,noheader 2>$null | Select-Object -First 1)
Write-Host "driver/card: $ver"
$major = [int](($ver -split ",")[0].Trim().Split(".")[0])
if ($major -lt 470) { Write-Host "driver $major is too old for CUDA on WSL2 (need 470+); update it from nvidia.com" -ForegroundColor Yellow }
} else {
Write-Host "nvidia-smi not found: no NVIDIA driver, or not on PATH. CoderAI will run on CPU only (coderai -NoGpu)." -ForegroundColor Yellow
}
# 4. Launcher
Step "Launcher"
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
foreach ($f in @("coderai.ps1", "coderai.cmd")) {
$src = Join-Path $here $f
if (Test-Path $src) { Copy-Item $src (Join-Path $InstallDir $f) -Force }
else {
# Piped through `iex`: fetch the launcher from the repository.
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/nextime/coderai/master/packaging/windows/$f" -OutFile (Join-Path $InstallDir $f)
}
}
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if (($userPath -split ";") -notcontains $InstallDir) {
[Environment]::SetEnvironmentVariable("Path", "$userPath;$InstallDir", "User")
Write-Host "added $InstallDir to the user PATH (open a new terminal to use 'coderai')"
}
$sm = Join-Path ([Environment]::GetFolderPath("Programs")) "CoderAI.lnk"
try {
$ws = New-Object -ComObject WScript.Shell
$lnk = $ws.CreateShortcut($sm)
$lnk.TargetPath = Join-Path $InstallDir "coderai.cmd"
$lnk.WorkingDirectory = $InstallDir
$lnk.Description = "CoderAI — complete orchestration, distribution and escalation of remotizable advanced inference"
$lnk.Save()
} catch {}
# 5. Image
Step "Image"
if ($needReboot) {
Write-Host "Windows needs a reboot to finish WSL2 / Docker Desktop. After it, open a terminal and run: coderai" -ForegroundColor Yellow
Write-Host "(the first run pulls $Image, ~28 GB)"
exit 0
}
if ($NoPull) { Write-Host "skipped (-NoPull); the first 'coderai' run pulls it" }
else {
docker info *> $null
if ($LASTEXITCODE -ne 0) { Write-Host "Docker Desktop is not running yet; start it, then run: coderai" -ForegroundColor Yellow; exit 0 }
docker pull $Image
}
Write-Host "`nDone. Run: coderai" -ForegroundColor Green
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment