This commit is contained in:
2025-11-12 11:55:53 +01:00
parent 6773775f2a
commit d59372d1d6
8 changed files with 694 additions and 20 deletions

44
pull-ollama-model.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
# Pull Ollama model from .env file
set -e
# Load OLLAMA_MODEL from .env
if [ -f backend/.env ]; then
export $(grep -v '^#' backend/.env | grep OLLAMA_MODEL | xargs)
else
echo "Error: backend/.env file not found"
exit 1
fi
# Default to phi3:latest if not set
MODEL=${OLLAMA_MODEL:-phi3:latest}
echo "=========================================="
echo "Pulling Ollama Model: $MODEL"
echo "=========================================="
echo ""
# Check if Ollama container is running
if ! docker-compose ps ollama | grep -q "Up"; then
echo "Error: Ollama container is not running"
echo "Start it with: docker-compose up -d ollama"
exit 1
fi
echo "Pulling model via Ollama API..."
echo ""
# Pull the model
docker-compose exec -T ollama ollama pull "$MODEL"
echo ""
echo "=========================================="
echo "✓ Model $MODEL pulled successfully!"
echo "=========================================="
echo ""
echo "Verify with:"
echo " docker-compose exec ollama ollama list"
echo ""
echo "Test with:"
echo " curl http://localhost:5001/api/ollama/test"