#!/bin/bash echo "🚀 Starting AJ STUDIOZ..." # Set Ollama home export OLLAMA_HOME=/home/user/.ollama mkdir -p $OLLAMA_HOME # Start Ollama server in background echo "🔧 Starting Ollama server..." ollama serve > /tmp/ollama.log 2>&1 & # Wait for Ollama to be ready echo "⏳ Waiting for Ollama..." for i in {1..30}; do if curl -s http://localhost:11434/api/tags > /dev/null 2>&1; then echo "✅ Ollama is ready!" break fi sleep 2 done # Pull base model echo "📥 Downloading qwen2:0.5b (this may take a few minutes)..." ollama pull qwen2:0.5b # Create AJ model (Claude-like version) echo "🎨 Creating AJ model with enhanced capabilities..." ollama create aj-mini -f /app/Modelfile-AJ-Mini # Verify model creation if ollama list | grep -q "aj-mini"; then echo "✅ AJ model created successfully!" else echo "⚠️ Warning: AJ model may not have been created properly" fi echo "✅ AJ-Mini ready!" # List models echo "📋 Available models:" ollama list # Start FastAPI server echo "🌐 Starting API server on port 7860..." exec python /app/app.py