A comprehensive declarative ML deployment management system for Kubernetes-based machine learning model for real time scaling and orchestration. ML-Scaler provides automated deployment, scaling, real time inference and lifecycle management for ML models on Kubernetes Service such as AKS, GKE, EKS etc levearging KEDA.
- Automated ML Model Deployment - Deploy ML models to Kubernetes with automated configuration
- Dynamic Scaling - Auto-scale model deployments based on demand
- Deployment Management - List, update, and delete model deployments via CLI
- Database Persistence - Track deployment specs, compute instances, storage, and event sources
- Azure DevOps Integration - Trigger CI/CD pipelines for model deployments
- CLI Interface - Typer-based command-line tool for operations
- Python 3.10 or higher
- Docker and Docker Compose
- PostgreSQL database
- Azure Kubernetes Service (AKS) cluster
- Azure DevOps account (for pipeline integration)
- Service Principal credentials such as Azure Service Principal
Using a Docker Compose file along with a local environment file and configuration YAML values will bring the CLI wrapper up and running.
# Clone the repository
git clone <repository-url>
cd <directory>
# Start services
docker-compose up -d# Install dependencies
pip install -e .
# Set up environment variables (see Configuration)
cp env.example .env
# Edit .env with your configurationIMPORTANT: Never commit credentials to version control. Use environment variables for all sensitive data.
-
Create a
.envfile from the example:cp .env.example .env
-
Configure required environment variables in
.env:- Database:
DATABASE_URL - Azure DevOps:
AZURE_DEVOPS_PAT - Azure Service Principal:
TENANT_ID,CLIENT_ID,CLIENT_SECRET - Azure Databricks Configurations:
DATABRICKS_HOST,DATABRICKS_TOKEN
- Database:
-
Update
app/config.yamlwith non-sensitive configuration:- Azure DevOps organization, project, pipeline, and branch name
- AKS api_server & namespace
- You can also handle the logging_level, db_config non-sensitive informations accordingly.
NOTE:----> You can set the configurations either in ".env" file or "app/config.yaml" accordingly based on sensitivity.
- For Production: Use Azure Key Vault or similar secret management service instead of
.envfiles
CLI commands offered by mlscaler:
mlscaler --help
[ABOVE COMMAND WILL GUIDE YOU HOW TO USE DEFINED CLI COMMANDS]
Initialize environment, check DB health, and ensure required tables are present.
Add configuration for required instance resources (storage, compute, event source, deployment spec) to DB.
Trigger deployment for a specific deployment name. Checks AKS for existing deployment first. Use --overwrite-deployment flag if deployment already exists.
It has provision to check the pipeline status as well.
Update configuration key-values for a deployment in DB. On user confirmation, triggers pipeline with updated configurations. On trigger, it has provision to check the pipeline status as well.
View DB configurations and AKS deployment details for a specific deployment.

List all deployments available in AKS under the configured namespace.
Check deployment status in AKS for a specific deployment.

Delete deployment from AKS and DB configuration on user confirmation.

- SQLAlchemy - ORM for database operations
- PostgreSQL - Relational database for persistence
- Typer - Modern CLI framework
- Kubernetes Client - AKS cluster interaction
- Azure DevOps API - CI/CD pipeline orchestration
This project follows Python best practices and PEP 8 guidelines. Future versions may include automated testing.
Contributions are welcome! Please ensure:
- Code follows project style guidelines
- Documentation is updated as needed
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or contributions, please open an issue in the repository.