mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-03-21 22:56:47 +00:00
chore: rename to setup-standalone, remove redundant setup-local-llm.sh
This commit is contained in:
@@ -10,7 +10,7 @@ title: Standalone Local Setup
|
|||||||
```bash
|
```bash
|
||||||
git clone https://github.com/monadical-sas/reflector.git
|
git clone https://github.com/monadical-sas/reflector.git
|
||||||
cd reflector
|
cd reflector
|
||||||
./scripts/setup-local-dev.sh
|
./scripts/setup-standalone.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
The script is idempotent — safe to re-run at any time. It detects what's already set up and skips completed steps.
|
The script is idempotent — safe to re-run at any time. It detects what's already set up and skips completed steps.
|
||||||
@@ -124,4 +124,4 @@ These require external accounts and infrastructure that can't be scripted:
|
|||||||
- Step 3 (transcript storage) — resolved: skip for live-only mode
|
- Step 3 (transcript storage) — resolved: skip for live-only mode
|
||||||
- Step 4 (transcription/diarization) — in progress by another developer
|
- Step 4 (transcription/diarization) — in progress by another developer
|
||||||
- Steps 5-7 (Docker, migrations, health) — implemented
|
- Steps 5-7 (Docker, migrations, health) — implemented
|
||||||
- **Unified script**: `scripts/setup-local-dev.sh`
|
- **Unified script**: `scripts/setup-standalone.sh`
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
MODEL="${LLM_MODEL:-qwen2.5:14b}"
|
|
||||||
OLLAMA_PORT="${OLLAMA_PORT:-11434}"
|
|
||||||
|
|
||||||
wait_for_ollama() {
|
|
||||||
local url="$1"
|
|
||||||
local retries=30
|
|
||||||
for i in $(seq 1 "$retries"); do
|
|
||||||
if curl -sf "$url/api/tags" > /dev/null 2>&1; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
echo " Waiting for Ollama... ($i/$retries)"
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
echo "ERROR: Ollama not responding at $url after $retries attempts"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
OS="$(uname -s)"
|
|
||||||
|
|
||||||
case "$OS" in
|
|
||||||
Darwin)
|
|
||||||
echo "macOS detected -- Ollama must run natively for Metal GPU acceleration."
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
if ! command -v ollama &> /dev/null; then
|
|
||||||
echo "Ollama not found. Install it first:"
|
|
||||||
echo " brew install ollama"
|
|
||||||
echo " # or download from https://ollama.com/download"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start Ollama if not already running
|
|
||||||
if ! curl -sf "http://localhost:$OLLAMA_PORT/api/tags" > /dev/null 2>&1; then
|
|
||||||
echo "Starting Ollama..."
|
|
||||||
ollama serve &
|
|
||||||
disown
|
|
||||||
else
|
|
||||||
echo "Ollama already running."
|
|
||||||
fi
|
|
||||||
|
|
||||||
wait_for_ollama "http://localhost:$OLLAMA_PORT"
|
|
||||||
|
|
||||||
echo "Pulling model $MODEL..."
|
|
||||||
ollama pull "$MODEL"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "Done. Add to server/.env:"
|
|
||||||
echo " LLM_URL=http://host.docker.internal:$OLLAMA_PORT/v1"
|
|
||||||
echo " LLM_MODEL=$MODEL"
|
|
||||||
echo " LLM_API_KEY=not-needed"
|
|
||||||
echo ""
|
|
||||||
echo "Then: docker compose up -d"
|
|
||||||
;;
|
|
||||||
|
|
||||||
Linux)
|
|
||||||
echo "Linux detected."
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
if command -v nvidia-smi &> /dev/null && nvidia-smi > /dev/null 2>&1; then
|
|
||||||
echo "NVIDIA GPU detected -- using ollama-gpu profile."
|
|
||||||
PROFILE="ollama-gpu"
|
|
||||||
LLM_URL="http://ollama:$OLLAMA_PORT/v1"
|
|
||||||
else
|
|
||||||
echo "No NVIDIA GPU -- using ollama-cpu profile."
|
|
||||||
PROFILE="ollama-cpu"
|
|
||||||
LLM_URL="http://ollama-cpu:$OLLAMA_PORT/v1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
COMPOSE="docker compose -f docker-compose.yml -f docker-compose.standalone.yml"
|
|
||||||
|
|
||||||
echo "Starting Ollama container..."
|
|
||||||
$COMPOSE --profile "$PROFILE" up -d
|
|
||||||
|
|
||||||
# Determine container name
|
|
||||||
if [ "$PROFILE" = "ollama-gpu" ]; then
|
|
||||||
SVC="ollama"
|
|
||||||
else
|
|
||||||
SVC="ollama-cpu"
|
|
||||||
fi
|
|
||||||
|
|
||||||
wait_for_ollama "http://localhost:$OLLAMA_PORT"
|
|
||||||
|
|
||||||
echo "Pulling model $MODEL..."
|
|
||||||
$COMPOSE exec "$SVC" ollama pull "$MODEL"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "Done. Add to server/.env:"
|
|
||||||
echo " LLM_URL=$LLM_URL"
|
|
||||||
echo " LLM_MODEL=$MODEL"
|
|
||||||
echo " LLM_API_KEY=not-needed"
|
|
||||||
echo ""
|
|
||||||
echo "Then: $COMPOSE --profile $PROFILE up -d"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Unsupported OS: $OS"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
# Takes a fresh clone to a working instance — no cloud accounts, no API keys.
|
# Takes a fresh clone to a working instance — no cloud accounts, no API keys.
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./scripts/setup-local-dev.sh
|
# ./scripts/setup-standalone.sh
|
||||||
#
|
#
|
||||||
# Idempotent — safe to re-run at any time.
|
# Idempotent — safe to re-run at any time.
|
||||||
#
|
#
|
||||||
@@ -162,7 +162,7 @@ step_server_env() {
|
|||||||
ok "server/.env already exists — checking key vars"
|
ok "server/.env already exists — checking key vars"
|
||||||
else
|
else
|
||||||
cat > "$SERVER_ENV" << 'ENVEOF'
|
cat > "$SERVER_ENV" << 'ENVEOF'
|
||||||
# Generated by setup-local-dev.sh — standalone local development
|
# Generated by setup-standalone.sh — standalone local development
|
||||||
# Source of truth for settings: server/reflector/settings.py
|
# Source of truth for settings: server/reflector/settings.py
|
||||||
|
|
||||||
# --- Database (Docker internal hostnames) ---
|
# --- Database (Docker internal hostnames) ---
|
||||||
@@ -212,7 +212,7 @@ step_www_env() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cat > "$WWW_ENV" << 'ENVEOF'
|
cat > "$WWW_ENV" << 'ENVEOF'
|
||||||
# Generated by setup-local-dev.sh — standalone local development
|
# Generated by setup-standalone.sh — standalone local development
|
||||||
|
|
||||||
SITE_URL=http://localhost:3000
|
SITE_URL=http://localhost:3000
|
||||||
NEXTAUTH_URL=http://localhost:3000
|
NEXTAUTH_URL=http://localhost:3000
|
||||||
@@ -280,7 +280,7 @@ main() {
|
|||||||
# Ensure we're in the repo root
|
# Ensure we're in the repo root
|
||||||
if [[ ! -f "$ROOT_DIR/docker-compose.yml" ]]; then
|
if [[ ! -f "$ROOT_DIR/docker-compose.yml" ]]; then
|
||||||
err "docker-compose.yml not found in $ROOT_DIR"
|
err "docker-compose.yml not found in $ROOT_DIR"
|
||||||
err "Run this script from the repo root: ./scripts/setup-local-dev.sh"
|
err "Run this script from the repo root: ./scripts/setup-standalone.sh"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ main() {
|
|||||||
echo " API: http://localhost:1250"
|
echo " API: http://localhost:1250"
|
||||||
echo ""
|
echo ""
|
||||||
echo " To stop: docker compose down"
|
echo " To stop: docker compose down"
|
||||||
echo " To re-run: ./scripts/setup-local-dev.sh"
|
echo " To re-run: ./scripts/setup-standalone.sh"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ TRANSLATE_URL=https://monadical-sas--reflector-translator-web.modal.run
|
|||||||
## =======================================================
|
## =======================================================
|
||||||
|
|
||||||
## --- Option A: Local LLM via Ollama (recommended for dev) ---
|
## --- Option A: Local LLM via Ollama (recommended for dev) ---
|
||||||
## Setup: ./scripts/setup-local-llm.sh
|
## Setup: ./scripts/setup-standalone.sh
|
||||||
## Mac: Ollama runs natively (Metal GPU). Containers reach it via host.docker.internal.
|
## Mac: Ollama runs natively (Metal GPU). Containers reach it via host.docker.internal.
|
||||||
## Linux: docker compose --profile ollama-gpu up -d (or ollama-cpu for no GPU)
|
## Linux: docker compose --profile ollama-gpu up -d (or ollama-cpu for no GPU)
|
||||||
LLM_URL=http://host.docker.internal:11434/v1
|
LLM_URL=http://host.docker.internal:11434/v1
|
||||||
|
|||||||
Reference in New Issue
Block a user