You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd code/ai_services
python -m pytest tests/test_ai_services.py -v
Training AI Models
cd code/ai_services
# Train all major pairs (requires hmmlearn and arch)
pip install hmmlearn arch
python -m training.train_all --pairs all --output-dir ./saved_models
# Train a single pair
python -m training.train_all --pairs EURUSD
Models are saved under saved_models/{PAIR}/{model_type}/.
The AI service loads models lazily on first request per pair.
Production Checklist
Step
Action
1
Set SECRET_KEY to a random 50+ character string
2
Set DEBUG=False
3
Set ALLOWED_HOSTS to your domain names
4
Set DATABASE_URL to a managed PostgreSQL instance
5
Set REDIS_URL to a managed Redis instance
6
Configure CORS_ALLOWED_ORIGINS to your frontend domain
7
Run python manage.py migrate
8
Run python manage.py collectstatic
9
Create admin user with python manage.py createsuperuser
10
Start backend with daphne alphafx.asgi:application
11
Start AI service with uvicorn ai_services.api.main:app --port 8001
12
Configure nginx with the provided nginx.conf
13
Train AI models with python -m training.train_all --pairs all
Nginx Configuration
The provided infrastructure/nginx/nginx.conf handles: