For basic functionality with simplified RAG/LoRA systems:
# Install core dependencies only
pip install Flask Werkzeug python-dotenv requests flask-cors groqFor complete functionality with advanced ML features:
-
Edit
requirements.txt- Uncomment the sections you need:- AI/ML Advanced Features (for full RAG/LoRA)
- Document Processing (for file uploads)
- Vector Databases (for advanced search)
- LangChain Ecosystem (for advanced RAG)
-
Install all dependencies:
pip install -r requirements.txt
For production deployment:
-
Edit
requirements.txt- Uncomment these sections:- Database (for persistent storage)
- Security & Production
- Production Server
- Caching & Performance
- Monitoring & Logging
-
Install production dependencies:
pip install -r requirements.txt
- Core Flask app
- Basic AI chat functionality
- Simplified RAG/LoRA systems
- Size: ~50MB
- All AI/ML capabilities
- Advanced RAG with vector search
- Full LoRA fine-tuning
- Document processing
- Size: ~2-3GB
- Database support
- Caching and performance optimization
- Security features
- Monitoring and logging
- Production WSGI server
- Size: ~100-200MB (without ML)
-
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Set up environment variables:
cp .env.example .env # Edit .env with your API keys -
Install dependencies (choose your profile above)
-
Run the application:
./run-local.sh # OR manually: cd backend && python app.py
PyTorch Installation Issues:
# For CPU-only (smaller, faster install)
pip install torch --index-url https://download.pytorch.org/whl/cpu
# For GPU support (if you have CUDA)
pip install torch --index-url https://download.pytorch.org/whl/cu118Memory Issues with Large Models:
- Use minimal installation for development
- Consider cloud deployment for full ML features
Dependency Conflicts:
# Create fresh environment
pip freeze > old_requirements.txt
deactivate
rm -rf venv
python -m venv venv
source venv/bin/activate
# Install step by stepFor containerized deployment:
# Build and run with Docker
docker-compose up --buildThis uses the Dockerfile which automatically handles all dependencies.
Test your installation:
python -c "import flask, groq; print('β
Core dependencies installed')"
# For full ML installation:
python -c "import torch, transformers; print('β
ML dependencies installed')"- Minimal issues: Check Flask and Groq API setup
- ML issues: Verify PyTorch and transformers installation
- Production issues: Check database and server configuration
Choose the installation profile that matches your needs and system resources! π―