From 9cf8d1b07c3893affc455e3e014b30fd600a3350 Mon Sep 17 00:00:00 2001 From: crowetic Date: Mon, 19 May 2025 19:16:39 -0700 Subject: [PATCH] switching back to AIO build of localai --- setup-ai-stack.sh | 200 ++++++++++++++++++++++------------------------ 1 file changed, 94 insertions(+), 106 deletions(-) diff --git a/setup-ai-stack.sh b/setup-ai-stack.sh index b834951..6004dad 100644 --- a/setup-ai-stack.sh +++ b/setup-ai-stack.sh @@ -69,69 +69,30 @@ if [[ "$1" == "--update" ]]; then echo "🔧 Running make prepare..." make prepare - echo "🧠 Building LocalAI binary with GPU, localrecall, and localagi..." - make build \ - TAGS="localrecall,localagi,gpu" \ - BACKENDS="llama-cuda whispercpp stablediffusion ollama" \ - GPU_SUPPORT="cuda" + # echo "🧠 Building LocalAI binary with GPU, localrecall, and localagi..." + # make build \ + # TAGS="localrecall,localagi,gpu" \ + # BACKENDS="llama-cuda whispercpp stablediffusion ollama" \ + # GPU_SUPPORT="cuda" - # Download your custom Dockerfile - echo "📥 Downloading custom Dockerfile..." - curl -fsSL "$DOCKERFILE_URL" -o Dockerfile + # # Download your custom Dockerfile + # echo "📥 Downloading custom Dockerfile..." + # curl -fsSL "$DOCKERFILE_URL" -o Dockerfile - # Build the container - echo "🔨 Building custom LocalAI Docker image..." - docker build -t localai:custom . + # # Build the container + # echo "🔨 Building custom LocalAI Docker image..." + # docker build -t localai:custom . - # Remove existing container - docker stop localai 2>/dev/null || true - docker rm localai 2>/dev/null || true + # # Remove existing container + # docker stop localai 2>/dev/null || true + # docker rm localai 2>/dev/null || true - # Create model and config directories if needed - mkdir -p ~/ai-stack/localai/models - mkdir -p ~/ai-stack/localai/config - - # Run new container - docker run -d \ - --name localai \ - --gpus all \ - -p 8080:8080 \ - -v ~/ai-stack/localai/models:/models \ - -v ~/ai-stack/localai/config:/config \ - -e ENABLE_BACKENDS=llama-cuda,ollama \ - -e INCLUDE_DEFAULT_MODELS=true \ - -e AUTOLOAD_MODELS=true \ - -e MODEL_PATH=/models \ - --restart unless-stopped \ - localai:custom - - echo "✅ LocalAI (custom) is now running at http://localhost:8080" - - - # # 🔁 Updating LocalAI (GPU build) - # if check_container_running "localai"; then - # echo "🧠 Updating LocalAI..." - # docker stop localai - # docker rm localai - # else - # echo "➕ Installing LocalAI..." - # fi - - # docker pull localai/localai:latest-aio-gpu-nvidia-cuda-12 - - # # Ensure default models.yaml exists - # MODELS_YAML=~/ai-stack/localai/config/models.yaml - # if [ ! -f "$MODELS_YAML" ]; then - # echo "📄 Creating default models.yaml..." - # cat > "$MODELS_YAML" < ~/ai-stack/localai/config/models.yaml <