Document and preflight all dependencies
- README: explicit install commands for Ollama (macOS/Linux/Windows) and Python 3.12 per OS; note curl as a run.sh dependency - setup.sh / setup.ps1: preflight checks that Ollama is installed and reachable (with install hints if missing); setup.sh also warns if curl is absent Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
95da8fb38d
commit
5bd8142d30
@@ -41,10 +41,17 @@ Python 3.9+. LiteLLM (the backend proxy) needs a small venv.
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Ollama](https://ollama.com) running locally with some models pulled
|
||||
- **Python 3.12** (for the LiteLLM venv). macOS: `brew install python@3.12`.
|
||||
Linux: your distro's `python3.12`.
|
||||
- The pre-router itself only needs any Python 3.9+.
|
||||
- **[Ollama](https://ollama.com)** — the model backend. Install:
|
||||
- macOS: `brew install ollama` (or the app from [ollama.com/download](https://ollama.com/download))
|
||||
- Linux: `curl -fsSL https://ollama.com/install.sh | sh`
|
||||
- Windows: `winget install Ollama.Ollama`
|
||||
- **Python 3.12** — for the LiteLLM venv:
|
||||
- macOS: `brew install python@3.12` · Linux: distro `python3.12` · Windows: `winget install Python.Python.3.12`
|
||||
- The pre-router itself needs only any Python 3.9+.
|
||||
- **curl** — used by `run.sh` for health checks (standard on macOS/Linux).
|
||||
|
||||
`./scripts/setup.*` checks Python **and** Ollama for you and installs the Python
|
||||
deps; `./scripts/pull-models.*` fetches the model fleet.
|
||||
|
||||
## Quickstart
|
||||
|
||||
|
||||
@@ -31,6 +31,20 @@ $vpy = ".\.venv\Scripts\python.exe"
|
||||
& $vpy -m pip install -q -r requirements.txt
|
||||
& $vpy -c "import litellm, PIL; print('>> deps OK (litellm, pillow)')"
|
||||
|
||||
# preflight: Ollama (the model backend)
|
||||
if (Get-Command ollama -ErrorAction SilentlyContinue) {
|
||||
Write-Host ">> ollama: $((ollama --version 2>$null | Select-Object -First 1))"
|
||||
$base = if ($env:ROUTER_OLLAMA) { $env:ROUTER_OLLAMA } else { "http://127.0.0.1:11434" }
|
||||
try {
|
||||
Invoke-WebRequest "$base/api/version" -TimeoutSec 3 -UseBasicParsing | Out-Null
|
||||
Write-Host ">> ollama server: reachable"
|
||||
} catch {
|
||||
Write-Host "!! ollama installed but not responding — start the Ollama app first."
|
||||
}
|
||||
} else {
|
||||
Write-Host "!! ollama NOT installed (required backend). Install: winget install Ollama.Ollama"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Next:"
|
||||
Write-Host " .\scripts\pull-models.ps1 # pull a model fleet (edit the list first)"
|
||||
|
||||
@@ -17,6 +17,21 @@ echo ">> using $($PY --version) at $(command -v "$PY" 2>/dev/null || echo "$PY")
|
||||
.venv/bin/pip install -q --upgrade pip
|
||||
.venv/bin/pip install -q -r requirements.txt
|
||||
.venv/bin/python -c "import litellm, PIL" && echo ">> deps OK (litellm, pillow)"
|
||||
|
||||
# preflight: Ollama (the model backend)
|
||||
if command -v ollama >/dev/null 2>&1; then
|
||||
echo ">> ollama: $(ollama --version 2>/dev/null | head -1)"
|
||||
if .venv/bin/python -c "import urllib.request; urllib.request.urlopen('${ROUTER_OLLAMA:-http://127.0.0.1:11434}/api/version', timeout=3)" 2>/dev/null; then
|
||||
echo ">> ollama server: reachable ($(ollama list 2>/dev/null | tail -n +2 | grep -c .) models pulled)"
|
||||
else
|
||||
echo "!! ollama installed but not responding — start it: (macOS) open -a Ollama (Linux) ollama serve"
|
||||
fi
|
||||
else
|
||||
echo "!! ollama NOT installed (required backend). Install:"
|
||||
echo " macOS: brew install ollama Linux: curl -fsSL https://ollama.com/install.sh | sh"
|
||||
fi
|
||||
command -v curl >/dev/null 2>&1 || echo "!! curl not found — run.sh uses it for health checks; install curl."
|
||||
|
||||
echo ""
|
||||
echo "Next:"
|
||||
echo " ./scripts/pull-models.sh # pull a model fleet (edit the list first)"
|
||||
|
||||
Reference in New Issue
Block a user