Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 9 Next »

This section describes how to register an Implementation (model) within ModelOp Center

Table of Contents

Add an Implementation via ModelOp UI

Opening the Add an Implementation Wizard

To add an implementation, either:

  1. Add the Implementation from the Inventory OR

  2. Add the Implementation from the Use Case Page

Add an Implementation from the Inventory

  1. Go to the Inventory and select “Implementations” from the drop-down

  2. Click “Add Implementation” in the top right

  3. The Add an Implementation Wizard will open (see next section)

image-20240715-031630.pngimage-20240715-031648.png

Add an Implementation from a Use Case

To add an implementation from a Use Case:

  1. Click “Add an Implementation” from the “More Actions” drop-down menu

  2. The Add an Implementation Wizard will open (see next section)

image-20240715-032029.png

Add an Implementation Wizard - Scenarios based on Implementation Type

The Add an Implementation Wizard provides multiple options for adding your implementation:

  1. Ensemble: a collection of models that work together to provide an output. Typically a GenerativeAI model is an ensemble.

  2. Git Model: import an existing model that is maintained within a git repository

  3. AWS SageMaker: import an existing model that was built in AWS SageMaker

  4. Vendor (or Generic) Model: create a Vendor model record or a generic model where you may manually upload assets

  5. Existing Implementation (on Use Case page only): associate a model that was already added in the system to a Use Case

image-20240715-032258.png

Add an Implementation Wizard - Ensemble

Model ensembles are increasingly more popular, given that, for enterprises, most GenerativeAI models are ensembles. As such, it is imperative to register the ensemble and all of the child models within that ensemble for transparent and comprehensive governance tracking.

To register an Ensemble in the ModelOp Center UI,

  1. Select the “Ensemble” option from the Add an Implementation Wizard

  2. Fill out the required core fields about the Ensemble: Name, Methodology, Access Group, etc.

    1. Note that the “Model Methodology” is typically quite important, as it is used to trigger different MLC, Custom Forms, and Governance Score actions.

    2. Click Next.

image-20240715-035050.png
  1. If your organization has defined specific additional information that they want collected about a model, the “Implementation Custom Form” will be displayed. Note that the Implementation Custom Form is based on the Model Type and Methodology. See Custom Form Administration for more details.

  2. Review the details of your Implementation and hit Submit, when ready.

  3. ModelOp will new Ensemble Model Implementation record

  4. The user will be taken to the newly created Model Implementation record

Add an Implementation Wizard - Git Import

To register an Implementation via Git Import in the ModelOp Center UI,

  1. Select the “GIT Model” option from the Add an Implementation Wizard

  2. Fill out the required core fields: Git Remote Repository URL and Branch, Name, Type, Methodology, Access Group, etc.

    1. Note that the “Type” and “Model Methodology” are typically quite important, as they are used to trigger different MLC, Custom Forms, and Governance Score actions.

    2. Click Next.

image-20240715-191225.png

  1. If your organization has defined specific additional information that they want collected about a model, the “Implementation Custom Form” will be displayed. Note that the Implementation Custom Form is based on the Model Type and Methodology. See Custom Form Administration for more details.

  2. Review the details of your Implementation and hit Submit, when ready.

  3. ModelOp will automatically import all of the relevant files from Git and create them as assets, documentation, etc. within the new Model Implementation record

  4. The user will be taken to the newly created Model Implementation record

Add an Implementation Wizard - Sagemaker Model

ModelOp Center is able to onboard and manage models developed in AWS SageMaker. This includes collecting all details of the SageMaker model, including training and transform jobs, endpoint configurations, and endpoints, as available.

To register an AWS Sagemaker Implementation in the ModelOp Center UI,

  1. Select the “AWS Sagemaker Model” option from the Add an Implementation Wizard

  2. Fill out the required core fields: Model Name (this should be exactly as it appears in your AWS Sagemaker instance), Methodology, Access Group, etc.

    1. Note that the “Model Methodology” is typically quite important, as it is used to trigger different MLC, Custom Forms, and Governance Score actions.

    2. Typically, the credentials are configured on the backend, but the user may choose to enter credentials for the Sagemaker instance using the “Enter Credentials” button

    3. Click Next.

image-20240715-191725.png

  1. If your organization has defined specific additional information that they want collected about a model, the “Implementation Custom Form” will be displayed. Note that the Implementation Custom Form is based on the Model Type and Methodology. See Custom Form Administration for more details.

  2. Review the details of your Implementation and hit Submit, when ready.

  3. ModelOp will automatically import all of the relevant assets from AWS Sagemaker and create them as assets, documentation, etc. within the new Model Implementation record

  4. The user will be taken to the newly created Model Implementation record

Add an Implementation Wizard - Vendor or Generic Model

From a governance perspective, organizations often require that all Vendor Models are catalogued and managed within the governance policy and procedure..

To register a Vendor (or Generic) Model Implementation in the ModelOp Center UI,

  1. Select the “Generic Model” option from the Add an Implementation Wizard

  2. Fill out the required core fields: Name, Type, Methodology, Access Group, etc.

    1. Note that the “Type” and “Model Methodology” are typically quite important, as they are used to trigger different MLC, Custom Forms, and Governance Score actions.

    2. Click Next.

image-20240715-192209.png
  1. If your organization has defined specific additional information that they want collected about a model, the “Implementation Custom Form” will be displayed. Note that the Implementation Custom Form is based on the Model Type and Methodology. See Custom Form Administration for more details.

  2. Review the details of your Implementation and hit Submit, when ready.

  3. ModelOp will automatically create the new Model Implementation record

  4. The user will be taken to the newly created Model Implementation record

Add an Implementation Wizard - Existing Implementation (Use Case page only)

From the a Use Case page, a user may select to associate an existing model implementation

To register an Existing Model Implementation in the ModelOp Center UI:

  1. From your specific Use Case page, select to “Add an Implementation” (see https://modelopdocs.atlassian.net/wiki/spaces/dv33/pages/edit-v2/1978434513#Add-an-Implementation-from-a-Use-Case for instructions)

  2. Select the “Existing Implementation” option from the Add an Implementation Wizard

  3. Use the “Search” box to find the specific Model Implementation of interest. Click to choose it and click Next.

image-20240715-220413.png
  1. If your organization has defined specific additional information that they want collected about a model, the “Implementation Custom Form” will be displayed. Note that the Implementation Custom Form is based on the Model Type and Methodology. See Custom Form Administration for more details.

  2. Review the details of your Implementation and hit Submit, when ready.

  3. ModelOp will automatically associate the selected Model Implementation to the Use Case.

Register a Model Using the ModelOp Jupyter Plugin

These instructions assume the following:

  • The Jupyter plugin is installed within your Jupyter environment.

  • The Jupyter plugin is enabled. To verify, go to the Nbextensions tab in Jupyter:

    • Select “ModelOp Center Services” if it is not already selected.

    • Enable the ModelOp Center Services. Click the “Enable” button at the bottom of the screen. It is enabled when the “Disable” button is highlighted in blue.

To register a model

From the toolbar, click on the “Register a new model with ModelOp Center” icon.

  1. The “Add Model to Model Operations Center” window opens. Click in the left side of the code cells to designate that the code is part of the model. The selected cells will have a highlighted green border on the left.

  2. Click Next. In theModel Information” section, type the Model Name. Optionally, you can add a brief Description of the model.

  3. Click Next. In the “Cell details” section:

    1. Choose the remote repository configuration. Make sure ModelOp Center has been configured with access to the git repositories.
      If the Git Remote text field is blank it will create a local (to ModelOp Center) git repository (no remote repository associated).
      If the Git Remote text field is provided (with a valid accessible git repository URL), the local copy will be associated with given remote repository.
      Check Use default repo option if you want the same git remote and branch for all the source code assets (cells). Otherwise, specify each asset with a different remote url or branch.
      You can entirely disable git handling by switching off the Remote repo configuration toggle. This will in turn handle the source code assets using ModelOp Center internal storage only.

    2. Provide a File Name, and select Primary Model Source if appropriate.
      The file name will be complemented with a default extension, but it can be provided by the input text field as part of the file name.
      A model must have one and only one primary source code, which is where it will look for the model functions (more on model functions in the next step).

  4. Click Next. Specify the model functions used in your code. (For additional information on the model functions please see here.) ModelOp Center allows the user to associate the triggering operations with specific code functions. Additionally it can identify if the functions already have predefined model functions associated via smart tags. These optional smart tags should be presented as comments in the line above the function definition and the supported comments are:

    • modelop.init

    • modelop.score

    • modelop.metrics

    • modelop.training


    For example:

    # modelop.init
    def begin():
    ...


    You will find that the functions identified from source with a smart tag are already associated with one of the functions, and this selection is not modifiable. If you wish to change the associated model function, either you can edit or remove the smart tag comment, or you can modify the associated model function in the ModelOp Center UI.

    The function associated via smart tag cannot be used for multiple model functions, but the remaining functions can be selected as options for the other associations:

  5. Click Next. On the next screen, add any attachments associated the model and select an asset role for each of the files to upload. This will help ModelOp Center runtime identify the accompanying assets for different purposes across the Model Life Cycle. Leave the asset role blank to let ModelOp Center automatically identify the asset based on the file type.

  6. Click Next. Review the summary and click Submit Model.

Register a Model Using the ModelOp Center CLI

Pre-Requisites

This procedure assumes the following:

  • You have installed the ModelOp Center command-line interface (CLI). For more details, see ModelOp CLI Reference.

  • You have an existing model, minimally in the form of a source code file (e.g. mymodel.py file)

Optional

When you register a model using the CLI, you have the following options:

  • You can add model attachments, such as a trained model artifact that results from model training.

  • You can include an input schema and/or an output schema with the model. These schemas enable the ModelOp Center to verify that the incoming and outgoing data adhere to the original model design intent. If preferred, you can disable schema checking by default, even if you upload input and/or output schemas.

To register a model from the CLI:

  1. Create a model with a primary source code file.

  2. At the command prompt, type:

moc model add <model name> <path to source code file>

a. (Optional) To include a schema associated with the model, use one or both of the following commands:

  • schema-in=<path for input schema>

  • schema-out=<path for output schema>

b.  (Optional) When you include a schema with a model, schema checking is enabled by default. To override schema checking, use one of the following commands:

  • input-check-off — disables input schema checking for the model

  • output-check-off — disables output schema checking for the model

  • schema-check-off — disables both input and output schema checking for the model

Example: moc model add sample_model /path/to/model/model.py --schema-in=inputSchema.avsc --schema-out=outputSchema.avsc --schema-check-off

  1. When the command in Step 2 is executed with all the options, a successful response looks like this:

Model added, ID:  1fbc8cc8-d5b2-40d1-913e-d30c4a71c16a

Note: if your source code file contains ModelOp Center “smart tag comments” for the primary functions of your model (see: Creating Production-Ready Models for more details), the CLI registration process automatically stores those function references for the newly registered model.

  1. Once a model has successfully been registered, you may add model attachments. Type:

moc asset add <model name or UUID> <path to attachment>

Alternatively, an attachment can be added directly from an S3 bucket:

moc asset add <model name or UUID> [http/s3/S3n/S3a]://accessKey:secretKey@Domain/PATH/<filename> --region=us-east-1

Additional Options:

  • To override the file name, add the --name=<string> option.

  • The MOC CLI determines whether to store the attachments in model-manage or external storage based on file size. Files larger than 10 MB are automatically stored in external storage, for efficiency. To control how the file is stored, use the following options:

  • force

: stores the file in model-manage if file size is less than 10 MB, or in external storage otherwise

  • external

: stores the attachment as external storage. If the file already exists in an external storage location (e.g. an AWS S3 bucket), provide a link to the asset in the following format:

[protocol]://ResourceAccessKey: ResourceSecretKey@ResourceDomain/PATH TO FILE/FILENAME.EXTENTION.

  • -region

— Add to URL to tell CLI the region for the external storage.  

  • Additional Examples:

moc asset add model_name attachment.zip -- external

moc asset add model_name http://$AKEY:$SKEY@modelop:9000/akash/output.json --region=default-region

See the Integrate with SageMaker page for details of the integration

Next Article: Manage an Implementation (Model) >

  • No labels