Skip to main content

A CLI tool that generates production-ready MLOps project templates for Scikit-learn, PyTorch, and TensorFlow

Project description

๐Ÿง  MLOps Project Generator

MLOps Project Generator Banner

A CLI tool that generates production-ready MLOps project templates for Scikit-learn, PyTorch, and TensorFlow.

This stack supports the full MLOps lifecycle:

Data โ†’ Train โ†’ Track โ†’ Orchestrate โ†’ Deploy โ†’ Monitor โ†’ Improve

๐Ÿš€ Features

  • ๐Ÿ”ง Framework Support: Scikit-learn, PyTorch, TensorFlow/Keras
  • ๐Ÿ“Š Task Types: Classification, Regression, Time-Series
  • ๐Ÿ”ฌ Experiment Tracking: MLflow, W&B
  • ๐ŸŽฏ Orchestration: Airflow, Kubeflow
  • ๐Ÿš€ Deployment: FastAPI, Docker, Kubernetes
  • ๐Ÿ“ˆ Monitoring: Evidently AI, Custom solutions
  • ๐Ÿ› ๏ธ Production-Ready: CI/CD, monitoring, best practices by default
  • ๐Ÿค– CI/CD Automation: Non-interactive mode for DevOps pipelines
  • ๐Ÿ” Project Validation: Comprehensive project structure and configuration validation

๐ŸŒŸ NEW: v1.0.6 Advanced Features

๐Ÿ” Project Validation Command

  • Comprehensive validation: Checks project structure, configuration, and deployment readiness
  • Framework-specific validation: Validates sklearn, PyTorch, and TensorFlow projects
  • Smart framework detection: Automatically detects ML framework from project files
  • Beautiful Rich UI: Professional terminal output with pass/warn/fail status
  • CI/CD integration: Proper exit codes for automation pipelines
  • Extensible design: Easy to add new validation checks
# Validate current directory
mlops-project-generator validate

# Validate specific project
mlops-project-generator validate --path /path/to/project

# CI/CD integration
mlops-project-generator validate --path . || exit 1

๐Ÿš€ Non-Interactive CLI Mode (CI/CD Ready)

  • One-liner project generation with command-line flags
  • Perfect for automation and CI/CD pipelines
  • Enterprise-ready with clean, log-friendly output
  • Zero prompts when flags are provided
  • Smart defaults for unspecified options
# Generate a complete project in one command
mlops-project-generator init \
  --framework pytorch \
  --tracking mlflow \
  --deployment docker \
  --monitoring evidently \
  --project-name my-ml-project

๐Ÿ” Smart System Validation

  • Automatic system check for Python, Git, Docker, Conda
  • Real-time status indicators (โœ…/โŒ) with visual feedback
  • System information display (OS, Python version, architecture)
  • Early validation to prevent setup issues

๐Ÿง  Intelligent Project Generation

  • Smart project naming based on framework and task type
  • Framework comparison table with complexity indicators
  • Project size estimation (files, lines of code, storage)
  • Impact analysis for each configuration choice

๐Ÿ“Š Enhanced User Experience

  • Beautiful progress indicators with real-time updates
  • Interactive framework recommendations with use cases
  • Comprehensive project summary before generation
  • Step-by-step next steps after project creation

๐Ÿ”ง Advanced Template Features

  • Dynamic .gitignore generation based on tools selected
  • Framework-specific patterns (PyTorch: *.pth, TensorFlow: *.pb)
  • Tool-specific configurations (MLflow, W&B, Airflow, Kubeflow)
  • Comprehensive MLOps artifact management

๐Ÿ“ฆ Installation

From PyPI (Recommended)

pip install mlops-project-generator

From Source

git clone https://github.com/NotHarshhaa/MLOps-Project-Generator.git
cd MLOps-Project-Generator
pip install -e .

Development Installation

git clone https://github.com/NotHarshhaa/MLOps-Project-Generator.git
cd MLOps-Project-Generator
pip install -e ".[dev]"

๐Ÿ–ผ๏ธ Screenshots

CLI Commands

CLI Version and Help Commands

Scikit-learn Project Generation

Scikit-learn Project Generation

PyTorch Project Generation

PyTorch Project Generation

TensorFlow Project Generation

TensorFlow Project Generation

๐ŸŽฏ Quick Start

๐Ÿš€ Option 1: Interactive Mode (Recommended for beginners)

mlops-project-generator init

๐Ÿค– Option 2: Non-Interactive Mode (Perfect for CI/CD)

# Quick start with defaults
mlops-project-generator init --framework sklearn --project-name my-project

# Full configuration
mlops-project-generator init \
  --framework pytorch \
  --task-type classification \
  --tracking mlflow \
  --orchestration airflow \
  --deployment docker \
  --monitoring evidently \
  --project-name enterprise-ml \
  --author-name "ML Team" \
  --description "Production ML pipeline"

๐Ÿ“‹ Available CLI Commands

Command Description Options
init Generate new MLOps project Framework, task type, tracking, deployment flags
validate Validate existing project structure --path to specify project directory
version Show version information None

๐Ÿ“‹ Available CLI Flags (for init command)

Flag Short Description Options
--framework -f ML framework sklearn, pytorch, tensorflow
--task-type -t Task type classification, regression, time-series, nlp, computer-vision
--tracking -r Experiment tracking mlflow, wandb, custom, none
--orchestration -o Orchestration airflow, kubeflow, none
--deployment -d Deployment fastapi, docker, kubernetes
--monitoring -m Monitoring evidently, custom, none
--project-name -p Project name Any valid name
--author-name -a Author name Any string
--description --desc Project description Any string

๐Ÿ“‹ Validation Options

Flag Short Description Default
--path -p Path to project to validate . (current directory)

๐ŸŽฏ Use Case Examples

๐Ÿ”ฌ Data Science Quick Start

mlops-project-generator init \
  --framework sklearn \
  --task-type classification \
  --tracking mlflow \
  --project-name fraud-detection

๐Ÿš€ Deep Learning Production

mlops-project-generator init \
  --framework pytorch \
  --deployment docker \
  --monitoring evidently \
  --project-name image-classifier

๐Ÿข Enterprise MLOps

mlops-project-generator init \
  --framework tensorflow \
  --orchestration kubeflow \
  --deployment kubernetes \
  --tracking mlflow \
  --project-name enterprise-ml

โšก CI/CD Pipeline Integration

# In GitHub Actions, GitLab CI, or Jenkins
mlops-project-generator init \
  --framework $FRAMEWORK \
  --deployment $DEPLOYMENT \
  --project-name $PROJECT_NAME \
  --author-name "CI/CD Pipeline"

This will launch an enhanced interactive CLI that guides you through:

๐Ÿ” Step 1: System Validation

  • Automatic system check for required tools
  • Visual status indicators (โœ…/โŒ)
  • System information display
  • Early problem detection

๐Ÿ”ง Step 2: Framework Selection

  • Interactive comparison table with use cases
  • Complexity indicators (Low/Medium/High)
  • Smart recommendations based on your needs
  • Framework guidance for better decisions

๐Ÿ“Š Step 3: Configuration

  • Task type selection (Classification/Regression/Time-Series)
  • Experiment tracking (MLflow/W&B/Custom)
  • Orchestration (Airflow/Kubeflow/None)
  • Deployment (FastAPI/Docker/Kubernetes)
  • Monitoring (Evidently/Custom/None)

๐Ÿง  Step 4: Smart Project Setup

  • Intelligent project naming suggestions
  • Directory validation to prevent conflicts
  • Project size estimation (files, lines, storage)
  • Impact analysis of your choices

๐Ÿ“‹ Step 5: Enhanced Summary

  • Comprehensive project overview
  • Next steps preview before generation
  • Real-time progress tracking
  • Step-by-step guidance after creation

๐ŸŽฏ Step 6: Ready-to-Go Project

  • Framework-specific code ready to run
  • Production-ready structure
  • Comprehensive documentation
  • Next steps checklist

Example Usage

# Generate a Scikit-learn classification project with MLflow tracking
mlops-project-generator init

# Follow the prompts:
# โœ” ML Framework: Scikit-learn
# โœ” Task Type: Classification
# โœ” Experiment Tracking: MLflow
# โœ” Orchestration: None
# โœ” Deployment: FastAPI
# โœ” Monitoring: Evidently
# โœ” Project Name: ml-classification-project
# โœ” Author Name: Your Name

๐Ÿ“ Generated Project Structure

your-project/
โ”œโ”€โ”€ data/                   # Data files
โ”‚   โ”œโ”€โ”€ raw/               # Raw data
โ”‚   โ”œโ”€โ”€ processed/         # Processed data
โ”‚   โ””โ”€โ”€ external/          # External data
โ”œโ”€โ”€ models/                 # Model files
โ”‚   โ”œโ”€โ”€ checkpoints/       # Model checkpoints
โ”‚   โ””โ”€โ”€ production/        # Production models
โ”œโ”€โ”€ notebooks/              # Jupyter notebooks
โ”œโ”€โ”€ scripts/                # Utility scripts
โ”œโ”€โ”€ src/                    # Source code
โ”‚   โ”œโ”€โ”€ data/              # Data loading utilities
โ”‚   โ”œโ”€โ”€ models/            # Model implementations
โ”‚   โ”œโ”€โ”€ features/          # Feature engineering (sklearn)
โ”‚   โ””โ”€โ”€ utils/             # Training utilities (pytorch/tensorflow)
โ”œโ”€โ”€ configs/                # Configuration files
โ”œโ”€โ”€ tests/                  # Test files
โ”œโ”€โ”€ requirements.txt        # Dependencies
โ”œโ”€โ”€ pyproject.toml         # Project configuration
โ”œโ”€โ”€ Makefile               # Build commands
โ”œโ”€โ”€ .gitignore             # Git ignore rules
โ””โ”€โ”€ README.md              # Project documentation

๐Ÿ› ๏ธ Framework-Specific Features

Scikit-learn Projects

  • Models: RandomForest, LogisticRegression, SVM, etc.
  • Feature Engineering: Scaling, selection, PCA
  • Evaluation: Cross-validation, comprehensive metrics
  • Deployment: Joblib serialization, FastAPI integration

PyTorch Projects

  • Models: Neural networks with residual connections, attention mechanisms
  • Training: Advanced optimizers, learning rate schedulers, early stopping
  • Utilities: Gradient clipping, data augmentation, model profiling
  • Deployment: TorchScript, FastAPI integration

TensorFlow Projects

  • Models: Keras models with batch normalization, attention mechanisms
  • Training: Callbacks, custom loss functions, gradient clipping
  • Utilities: Model profiling, data augmentation, custom schedulers
  • Deployment: SavedModel format, FastAPI integration

๐Ÿ“Š Experiment Tracking Integration

MLflow Integration

# Automatically logged metrics
mlflow.log_metrics({
    "train_loss": 0.123,
    "val_accuracy": 0.95,
    "learning_rate": 0.001
})

# Model artifacts
mlflow.log_artifact("models/production/model.joblib")

W&B Integration

# Automatic logging with W&B callback
wandb.init(project="my-project")
wandb.log({"loss": 0.123, "accuracy": 0.95})

๐Ÿš€ Deployment Options

FastAPI Deployment

# Start the API server
uvicorn src.inference:app --reload

# API documentation at http://localhost:8000/docs

Docker Deployment

# Build and run
docker build -t my-ml-project .
docker run -p 8000:8000 my-ml-project

Kubernetes Deployment

# Deploy to Kubernetes
kubectl apply -f k8s/

๐Ÿ“ˆ Monitoring Solutions

Evidently AI Integration

# Data drift monitoring
from evidently.report import Report
from evidently.metric_preset import DataDriftPreset

report = Report(metrics=[DataDriftPreset()])
report.run(current_data=current, reference_data=reference)

Custom Monitoring

# Custom monitoring implementation
class ModelMonitor:
    def check_performance(self, predictions, ground_truth):
        # Custom performance checks
        pass

๐Ÿงช Testing

# Run tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=src --cov-report=html

๐Ÿ› ๏ธ Development

Setup Development Environment

# Clone repository
git clone https://github.com/NotHarshhaa/MLOps-Project-Generator.git
cd MLOps-Project-Generator

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest tests/

# Run linting
black generator/ tests/
isort generator/ tests/
flake8 generator/ tests/
mypy generator/

Project Structure

mlops-project-generator/
โ”œโ”€โ”€ generator/              # CLI tool source code
โ”‚   โ”œโ”€โ”€ cli.py             # Main CLI interface
โ”‚   โ”œโ”€โ”€ prompts.py         # Interactive prompts
โ”‚   โ”œโ”€โ”€ renderer.py        # Template rendering
โ”‚   โ””โ”€โ”€ validators.py      # Input validation
โ”œโ”€โ”€ templates/              # Project templates
โ”‚   โ”œโ”€โ”€ common/            # Common files across frameworks
โ”‚   โ”œโ”€โ”€ sklearn/           # Scikit-learn specific templates
โ”‚   โ”œโ”€โ”€ pytorch/           # PyTorch specific templates
โ”‚   โ””โ”€โ”€ tensorflow/        # TensorFlow specific templates
โ”œโ”€โ”€ tests/                  # Test files
โ”œโ”€โ”€ docs/                   # Documentation
โ”œโ”€โ”€ pyproject.toml         # Project configuration
โ””โ”€โ”€ README.md              # This file

๐Ÿ”ง Configuration

The generated projects use YAML configuration files:

# configs/config.yaml
project:
  name: "my-project"
  author: "Your Name"
  version: "0.1.0"

model:
  type: "RandomForestClassifier"
  n_estimators: 100
  max_depth: 10

training:
  batch_size: 32
  learning_rate: 0.001
  epochs: 100

experiment_tracking:
  tool: "mlflow"
  tracking_uri: "http://localhost:5000"

deployment:
  method: "fastapi"
  host: "0.0.0.0"
  port: 8000

๐Ÿš€ CI/CD Integration

GitHub Actions Example

name: Generate ML Project
on:
  workflow_dispatch:
    inputs:
      framework:
        type: choice
        options: [sklearn, pytorch, tensorflow]
        default: sklearn
      project_name:
        type: string
        default: ml-project

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'
      
      - name: Install MLOps Generator
        run: pip install mlops-project-generator
      
      - name: Generate ML Project
        run: |
          mlops-project-generator init \
            --framework ${{ github.event.inputs.framework }} \
            --project-name ${{ github.event.inputs.project_name }} \
            --tracking mlflow \
            --deployment docker
      
      - name: Upload generated project
        uses: actions/upload-artifact@v3
        with:
          name: ${{ github.event.inputs.project_name }}
          path: ${{ github.event.inputs.project_name }}/

GitLab CI Example

stages:
  - generate

generate_ml_project:
  stage: generate
  image: python:3.11
  script:
    - pip install mlops-project-generator
    - mlops-project-generator init \
        --framework $FRAMEWORK \
        --project-name $PROJECT_NAME \
        --tracking mlflow \
        --deployment docker
  artifacts:
    paths:
      - $PROJECT_NAME/
    expire_in: 1 week

Jenkins Pipeline Example

pipeline {
    agent any
    parameters {
        choice(name: 'FRAMEWORK', choices: ['sklearn', 'pytorch', 'tensorflow'], description: 'ML Framework')
        string(name: 'PROJECT_NAME', defaultValue: 'ml-project', description: 'Project Name')
    }
    
    stages {
        stage('Generate ML Project') {
            steps {
                sh 'pip install mlops-project-generator'
                sh """
                    mlops-project-generator init \
                        --framework ${params.FRAMEWORK} \
                        --project-name ${params.PROJECT_NAME} \
                        --tracking mlflow \
                        --deployment docker
                """
                archiveArtifacts artifacts: "${params.PROJECT_NAME}/**/*", fingerprint: true
            }
        }
    }
}

Docker Integration

FROM python:3.11-slim

WORKDIR /app
RUN pip install mlops-project-generator

# Copy project generation script
COPY generate-project.sh .
RUN chmod +x generate-project.sh

# Generate project on container start
CMD ["./generate-project.sh"]

Environment Variables Support

# Using environment variables in CI/CD
export FRAMEWORK=pytorch
export DEPLOYMENT=kubernetes
export PROJECT_NAME=prod-ml

mlops-project-generator init \
  --framework $FRAMEWORK \
  --deployment $DEPLOYMENT \
  --project-name $PROJECT_NAME \
  --author-name "CI/CD Pipeline"

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Typer - For the beautiful CLI interface
  • Jinja2 - For powerful template rendering
  • Rich - For stunning terminal output
  • Cookiecutter - For project template inspiration

๐Ÿ“ž Support

๏ฟฝ Roadmap

  • v1.1: Additional frameworks (XGBoost, LightGBM)
  • v1.2: Cloud deployment templates (AWS, GCP, Azure)
  • v1.3: Advanced monitoring solutions
  • v2.0: GUI interface for project generation
  • v2.1: Template marketplace

โญ If you find this tool helpful, please give us a star on GitHub!

Generated with โค๏ธ by MLOps Project Generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlops_project_generator-1.0.6.tar.gz (76.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlops_project_generator-1.0.6-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file mlops_project_generator-1.0.6.tar.gz.

File metadata

  • Download URL: mlops_project_generator-1.0.6.tar.gz
  • Upload date:
  • Size: 76.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for mlops_project_generator-1.0.6.tar.gz
Algorithm Hash digest
SHA256 06c7607118d6df2fa9ba50527653632518c09306be01f0d6c6676aae675a90ab
MD5 2f18f9bf6c3de2073ee539e34ee89edb
BLAKE2b-256 6ef3b7ff444482901ef1a22f804ecf298400f6ba3926b90fecda8a46d86af160

See more details on using hashes here.

File details

Details for the file mlops_project_generator-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for mlops_project_generator-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0fa218d57113f0789418be914fdd819e47cc14602bf63b657c3ab8d86a6a8eb7
MD5 2797e33ccd157fb06a77b8ab12ed13bc
BLAKE2b-256 16ec4a2abe4c10205240fa2fb7d0add374fb256ce9c21033f46fb37d60a5b0a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page