2.2 KiB
2.2 KiB
Ollama Integration Complete ✅
What Was Added
-
Ollama Service in Docker Compose
- Runs Ollama server on port 11434
- Persists models in
ollama_datavolume - Health check ensures service is ready
-
Automatic Model Download
ollama-setupservice automatically pullsphi3:latest(2.2GB)- Runs once on first startup
- Model is cached in volume for future use
-
Configuration Files
docs/OLLAMA_SETUP.md- Comprehensive setup guideconfigure-ollama.sh- Helper script to switch between Docker/external Ollama- Updated
README.mdwith Ollama setup instructions
-
Environment Configuration
- Updated
backend/.envto usehttp://ollama:11434(internal Docker network) - All services can now communicate with Ollama via Docker network
- Updated
Current Status
✅ Ollama service running and healthy ✅ phi3:latest model downloaded (2.2GB) ✅ Translation feature working with integrated Ollama ✅ Summarization feature working with integrated Ollama
Quick Start
# Start all services (including Ollama)
docker-compose up -d
# Wait for model download (first time only, ~2-5 minutes)
docker-compose logs -f ollama-setup
# Verify Ollama is ready
docker-compose exec ollama ollama list
# Test the system
docker-compose exec crawler python crawler_service.py 1
Switching Between Docker and External Ollama
# Use integrated Docker Ollama (recommended)
./configure-ollama.sh
# Select option 1
# Use external Ollama server
./configure-ollama.sh
# Select option 2
Performance Notes
- First request: ~6 seconds (model loading)
- Subsequent requests: 0.5-2 seconds (cached)
- Translation: 0.5-6 seconds per title
- Summarization: 5-90 seconds per article (depends on length)
Resource Requirements
- RAM: 4GB minimum for phi3:latest
- Disk: 2.2GB for model storage
- CPU: Works on CPU, GPU optional
Alternative Models
To use a different model:
- Update
OLLAMA_MODELinbackend/.env - Pull the model:
docker-compose exec ollama ollama pull <model-name>
Popular alternatives:
gemma2:2b- Smaller, faster (1.6GB)llama3.2:latest- Larger, more capable (2GB)mistral:latest- Good balance (4.1GB)