How abdulnafih-official/ml-microservices works
ML Platform provides authenticated dataset-to-model training, model management, and prediction through a Streamlit UI and separate services. The primary flow runs from user submission through the training API and worker, then stores model artifacts and metadata for inference. Authentication and quota enforcement are distinct stages; inference validates inputs and loads cached private artifacts. The graph preserves the documented planning, profiling, training, and monitoring capabilities. Some worker internals and model-management routes are unsampled, so their documented or indexed links are limited to supported relationships.
Main entry points: job_runner.py Job orchestration · api_client.py Service API client · auth.py Registration and login · predict.py Prediction API
Components 34
User interface
- Streamlit pages
services/user/pages/1_Train.py - UI entry and session
services/user/app.py - Service API client
services/user/api_client.py - Login session
services/user/session.py
Identity and quotas
- Registration and login
services/auth/app/routes/auth.py - Internal quota API
services/auth/app/routes/internal.py - User and quota data
services/auth/app/models.py - Auth database access
services/auth/app/db.py - Rate limiting
services/auth/app/rate_limit.py
Training platform
- Training job API
services/training/app/routes/jobs.py - Training database access
services/training/app/db.py - Dataset uploads
services/training/app/upload.py - Quota client
services/training/app/auth_client.py - Job orchestration
services/training/worker/job_runner.py - Data profiling
services/training/worker/profiler.py - Cleaning planners
services/training/worker/planner - Plan validation
services/training/worker/validator.py - Pipeline compilation
services/training/worker/compiler.py - Model training
services/training/worker/trainers.py - Model evaluation
services/training/worker/evaluate.py - Model metadata
services/training/worker/metadata.py - Private artifact storage
services/training/worker/hf_store.py
Model serving
- Model management API
services/inference/app/routes/models.py - Prediction API
services/inference/app/routes/predict.py - Payload validation
services/inference/app/input_validation.py - Model registry
services/inference/app/registry.py - Artifact cache
services/inference/app/cache.py - Artifact downloader
services/inference/app/hf_loader.py - Inference database access
services/inference/app/db.py
Shared platform
- JWT utilities
shared/mlp_common/mlp_common/jwt_utils.py - Prometheus metrics
shared/mlp_common/mlp_common/metrics.py
Other components
- Platform user
- PostgreSQL
- Hugging Face
Connections 40
- Platform user → Streamlit pages: uses
- Streamlit pages → Service API client: requests services
services/user/pages/1_Train.py - UI entry and session → Service API client: uses
services/user/app.py - UI entry and session → Login session: uses
services/user/app.py - Service API client → Registration and login: registers and logs in
services/user/api_client.py - Service API client → Training job API: submits jobs
services/user/api_client.py - Service API client → Model management API: manages models
services/user/api_client.py - Service API client → Prediction API: requests predictions
services/user/api_client.py - Registration and login → Auth database access: reads and writes
services/auth/app/routes/auth.py - Registration and login → User and quota data: uses user records
services/auth/app/routes/auth.py - Registration and login → JWT utilities: verifies tokens
services/auth/app/routes/auth.py - Registration and login → Rate limiting: applies limits
services/auth/app/routes/auth.py - Internal quota API → Auth database access: uses database
services/auth/app/routes/internal.py - Internal quota API → User and quota data: uses quota records
services/auth/app/routes/internal.py - Training job API → Training database access: reads and writes
services/training/app/routes/jobs.py - Training job API → Dataset uploads: stores upload
services/training/app/routes/jobs.py - Training job API → Quota client: reserves quota
services/training/app/routes/jobs.py - Quota client → Internal quota API: calls quota endpoints
services/training/app/auth_client.py - Job orchestration → Data profiling: profiles data
services/training/worker/job_runner.py - Job orchestration → Cleaning planners: creates cleaning plan
services/training/worker/job_runner.py - Job orchestration → Plan validation: validates plan
services/training/worker/job_runner.py - Job orchestration → Pipeline compilation: compiles pipeline
services/training/worker/job_runner.py - Job orchestration → Model training: trains model
services/training/worker/job_runner.py - Job orchestration → Model evaluation: evaluates model
services/training/worker/job_runner.py - Job orchestration → Model metadata: records metadata
services/training/worker/job_runner.py - Job orchestration → Private artifact storage: uploads artifact
services/training/worker/job_runner.py - Model management API → Inference database access: reads and writes
services/inference/app/routes/models.py - Model management API → Artifact cache: removes cached model
services/inference/app/routes/models.py - Model management API → Artifact downloader: loads artifacts
services/inference/app/routes/models.py - Prediction API → Model registry: gets model
services/inference/app/routes/predict.py - Prediction API → Inference database access: gets database session
services/inference/app/routes/predict.py - Prediction API → Payload validation: validates payload
services/inference/app/routes/predict.py - Prediction API → Artifact cache: gets pipeline
services/inference/app/routes/predict.py - Artifact cache → Artifact downloader: downloads artifact
services/inference/app/cache.py - PostgreSQL → Auth database access: stores auth data
- PostgreSQL → Training database access: stores job data
- PostgreSQL → Inference database access: stores model metadata
- Private artifact storage → Hugging Face: uploads private models
- Artifact downloader → Hugging Face: downloads private models
- Job orchestration → Prometheus metrics: records metrics
services/training/worker/job_runner.py