Skip to content

feat(mlops): Automated Model Retraining Pipeline#469

Merged
Cedarich merged 2 commits intoPulsefy:mainfrom
morelucks:feature/454-automated-model-retraining-pipeline
Mar 25, 2026
Merged

feat(mlops): Automated Model Retraining Pipeline#469
Cedarich merged 2 commits intoPulsefy:mainfrom
morelucks:feature/454-automated-model-retraining-pipeline

Conversation

@morelucks
Copy link
Copy Markdown
Contributor

Summary

Implements the automated model retraining pipeline as described in issue #454.

Changes

Python (apps/data-processing)

  • src/ml/model_registry.py — versioned model storage with atomic zero-downtime swap via POSIX symlink rename + in-memory RLock hot-swap
  • src/ml/retraining_pipeline.py — orchestrates sentiment (VADER + crypto slang lexicon) and price predictor retraining with quality gates
  • src/scheduler.py — daily CronTrigger at 02:00 UTC for retraining alongside existing hourly market analyzer
  • src/api/server.py — POST /retrain and GET /model/status endpoints (X-API-Key protected)
  • src/utils/metrics.py — MODEL_RETRAINING_TOTAL and MODEL_RETRAINING_DURATION Prometheus metrics

NestJS (apps/backend)

  • ModelRetrainingModule — service, scheduler (02:30 UTC fallback), admin-only controller
  • POST /admin/models/retrain and GET /admin/models/status — JWT + ADMIN role protected
  • Registered in AppModule

Acceptance Criteria

  • Scheduled job in src/scheduler.py for retraining (daily at 02:00 UTC)
  • Versioning for model weights (v1.0, v1.1, v1.2, ...)
  • Zero-downtime model swap in the live API (atomic symlink + RLock in-memory hot-swap)

Closes #454

- Add src/ml/model_registry.py: versioned model storage (v1.0, v1.1, ...)
  with atomic zero-downtime swap via POSIX symlink rename + in-memory RLock
- Add src/ml/retraining_pipeline.py: orchestrates sentiment (VADER + crypto
  slang lexicon) and price predictor retraining with quality gates
- Update src/scheduler.py: daily CronTrigger at 02:00 UTC for retraining job
  alongside existing hourly market analyzer
- Update src/api/server.py: POST /retrain and GET /model/status endpoints
- Update src/utils/metrics.py: MODEL_RETRAINING_TOTAL and
  MODEL_RETRAINING_DURATION Prometheus metrics
- Add NestJS ModelRetrainingModule: service, scheduler (02:30 UTC fallback),
  and admin-only controller (POST /admin/models/retrain, GET /admin/models/status)
- Register ModelRetrainingModule in AppModule
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 25, 2026

@morelucks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Cedarich Cedarich merged commit c2058e7 into Pulsefy:main Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automated Model Retraining Pipeline

2 participants