File size: 1,085 Bytes
7603b27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/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