Skip to content

serverlessml/core

Repository files navigation

Serverless ML Core service

License Python Version Code Style: Black Build

Core service for serverless ML training/serving

Modus Operandi

Train

  1. Upon invocation, validate input config
    {
        "project_id": String ("UUID4, ML project ID"),
        "run_id": String ("UUID4, ML experiment ID"),
        "code_hash": String("SHA1"),
        "pipeline_config": {
            "data": {
                "location": {
                    "source": "DATA/SAMPLE/LOCATION",
                },
                "prep_config": Object,
            },
            "model": {
                "hyperparameters": {
                    "param1": Number,
                    "param2": String,
                    "param3": Number,
                },
                "version": "MODEL/VERSION/IN/PACKAGE",
            },
        },
    }
  1. Instantiate model class
  2. Read data sample into memory
  3. Perform model training
  4. Save model
  5. Push notification to the topic

Predict

Batch prediction

  1. Upon invocation, validate input config
    {
        "project_id": String ("UUID4, ML project ID"),
        "run_id": String ("UUID4, pipeline run ID"),
        "pipeline_config": {
            "train_id": String ("UUID4, ML experiment ID"),
            "data": {
                "location": {
                    "source": "DATA/SAMPLE/LOCATION",
                    "destination": "DATA/SAMPLE/LOCATION",
                },
            },
        }.
    }
  1. Read model metadata
  2. Instantiate model class
  3. Read dataset
  4. Run prediction
  5. Output results

Web-server

Deployed separately, with the fixed model.