peregrine/docker/ollama/entrypoint.sh
pyr0ball 0290c6fa17 feat: add Docker Compose stack with remote/cpu/single-gpu/dual-gpu profiles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 19:31:57 -08:00

10 lines
299 B
Bash
Executable file

#!/usr/bin/env bash
# Start Ollama server and pull a default model if none are present
ollama serve &
sleep 5
if [ -z "$(ollama list 2>/dev/null | tail -n +2)" ]; then
MODEL="${DEFAULT_OLLAMA_MODEL:-llama3.2:3b}"
echo "No models found — pulling $MODEL..."
ollama pull "$MODEL"
fi
wait