ollama / start.sh
oki0ki's picture
Update start.sh
6ad238d verified
raw
history blame contribute delete
376 Bytes
#!/bin/bash
set -e
MODEL=${MODEL}
API_KEY=${API_KEY:-API}
echo "Starting Ollama with model: $MODEL"
ollama serve &
SERVER_PID=$!
echo "Waiting for Ollama to start..."
until curl -s http://localhost:7860/api/tags > /dev/null 2>&1; do
sleep 2
done
echo "Pulling model: $MODEL"
ollama pull "$MODEL"
echo "Ollama ready. Model: $MODEL | API_KEY: $API_KEY"
wait $SERVER_PID