From d25d77333c8ee93dca42bb68ef02fd9a55574d2e Mon Sep 17 00:00:00 2001 From: Igor Loskutov Date: Tue, 10 Feb 2026 17:51:03 -0500 Subject: [PATCH] chore: rename to setup-standalone, remove redundant setup-local-llm.sh --- ...one-local-setup.md => setup-standalone.md} | 4 +- scripts/setup-local-llm.sh | 102 ------------------ ...setup-local-dev.sh => setup-standalone.sh} | 10 +- server/.env.example | 2 +- 4 files changed, 8 insertions(+), 110 deletions(-) rename docs/docs/installation/{standalone-local-setup.md => setup-standalone.md} (98%) delete mode 100755 scripts/setup-local-llm.sh rename scripts/{setup-local-dev.sh => setup-standalone.sh} (97%) diff --git a/docs/docs/installation/standalone-local-setup.md b/docs/docs/installation/setup-standalone.md similarity index 98% rename from docs/docs/installation/standalone-local-setup.md rename to docs/docs/installation/setup-standalone.md index a882da83..e880b12d 100644 --- a/docs/docs/installation/standalone-local-setup.md +++ b/docs/docs/installation/setup-standalone.md @@ -10,7 +10,7 @@ title: Standalone Local Setup ```bash git clone https://github.com/monadical-sas/reflector.git 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. @@ -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 4 (transcription/diarization) — in progress by another developer - Steps 5-7 (Docker, migrations, health) — implemented -- **Unified script**: `scripts/setup-local-dev.sh` +- **Unified script**: `scripts/setup-standalone.sh` diff --git a/scripts/setup-local-llm.sh b/scripts/setup-local-llm.sh deleted file mode 100755 index b5c7734e..00000000 --- a/scripts/setup-local-llm.sh +++ /dev/null @@ -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 diff --git a/scripts/setup-local-dev.sh b/scripts/setup-standalone.sh similarity index 97% rename from scripts/setup-local-dev.sh rename to scripts/setup-standalone.sh index 0f1e8f98..0bb3bf8c 100755 --- a/scripts/setup-local-dev.sh +++ b/scripts/setup-standalone.sh @@ -4,7 +4,7 @@ # Takes a fresh clone to a working instance — no cloud accounts, no API keys. # # Usage: -# ./scripts/setup-local-dev.sh +# ./scripts/setup-standalone.sh # # Idempotent — safe to re-run at any time. # @@ -162,7 +162,7 @@ step_server_env() { ok "server/.env already exists — checking key vars" else 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 # --- Database (Docker internal hostnames) --- @@ -212,7 +212,7 @@ step_www_env() { fi 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 NEXTAUTH_URL=http://localhost:3000 @@ -280,7 +280,7 @@ main() { # Ensure we're in the repo root if [[ ! -f "$ROOT_DIR/docker-compose.yml" ]]; then 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 fi @@ -307,7 +307,7 @@ main() { echo " API: http://localhost:1250" echo "" echo " To stop: docker compose down" - echo " To re-run: ./scripts/setup-local-dev.sh" + echo " To re-run: ./scripts/setup-standalone.sh" echo "" } diff --git a/server/.env.example b/server/.env.example index 77bf2394..f082c47e 100644 --- a/server/.env.example +++ b/server/.env.example @@ -70,7 +70,7 @@ TRANSLATE_URL=https://monadical-sas--reflector-translator-web.modal.run ## ======================================================= ## --- 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. ## Linux: docker compose --profile ollama-gpu up -d (or ollama-cpu for no GPU) LLM_URL=http://host.docker.internal:11434/v1