h2oai / wave-ml

Automatic Machine Learning (AutoML) for Wave Apps
Apache License 2.0
32 stars 5 forks source link

Share deployed models with other users #25

Open geomodular opened 3 years ago

geomodular commented 3 years ago

The issue describes the current status of a model sharing in Wave ML and the desired approach we would like to follow.

Current state

This is the current workflow Wave ML is capable of:

from h2o_wave_ml import build_model
...
model = build_model('./datataset.csv', target_column='col3', refresh_token=q.auth.refresh_token)
prediction = model.predict([['col1', 'col2], ['1.2', '2.5']])

Model is built, stored, and deployed to the public but accessible just for the user who builds it (API wise). FYI: The model.predict() method works with a deployed model.

Problem

We should be able to share the model with other users as well - to list them, find by some property, and get endpoint_url to access it. AFAIK this is partially possible in MLOps. MLOps is able to share one-2-one but group share is missing.

Therefore, the current approach in Wave ML to share model is following:

from h2o_wave_ml import build_model
...
model = build_model(...)
url = model.endpoint_url  # Store this value somewhere.
from h2o_wave_ml import get_model
...
model = get_model(endpoint_url=url)  # Use this value to get model.
prediction = model.predict(...)

One can specify project_id instead of endpoint_url to get to deployment.

Goal

The goal is to have the following workflow (or similar):

from h2o_wave_ml import build_model, get_model
...
model = get_model(name='MyModel', version='0.1.0', access_token=q.auth.access_token)
if model is None:
    model = build_model(...)
    model.share(name='MyModel', version='0.1.0', access_token=q.auth.access_token)

We should be able to group share the private model for other users so WaveML can list available models for groups the user belongs in and filter them by name and version.

I thought that, maybe, this is an expected feature to MLOps as groupId appears here.

cc @zoido @mwysokin @tkmaker @vopani @mmalohlava

zoido commented 3 years ago

Status in MLOps (from my POV):