Skip to main content

Mlflow-WatsonML

A plugin that integrates WatsonML with MLflow pipeline. mlflow_watsonml enables mlflow users to deploy mlflow pipeline models into WatsonML. Command line APIs of the plugin (also accessible through mlflow's python package) makes the deployment process seamless.

Installation

Plugin package which is available in pypi and can be installed using

pip install mlflow-watsonml

What does it do

Installing this package uses python's entrypoint mechanism to register the plugin into MLflow's plugin registry. This registry will be invoked each time you launch MLflow script or command line argument.

Authentication

In order to connect to WatsonML, refer to .env.template

Create deployment

The create command line argument and create_deployment python APIs does the deployment of a model built with MLflow to WatsonML.

CLI
mlflow deployments create -t watsonml -m <model-uri> --name <deployment-name> -C "software_spec_type=runtime-22.2-py3.10"
Python API
from mlflow.deployments import get_deploy_client

target_uri = 'watsonml'
plugin = get_deploy_client(target_uri)

plugin.create_deployment(
    name=<deployment-name>, 
    model_uri=<model-uri>, 
    config={"software_spec_type": "runtime-22.2-py3.10"}
)

Update deployment

Update API can used to modify the configuration parameters such as number of workers, version etc., of an already deployed model. WatsonML will make sure the user experience is seamless while changing the model in a live environment.

CLI
mlflow deployments update -t watsonml --name <deployment name> -C "software_spec_type=runtime-22.1-py3.10"
Python API
plugin.update_deployment(name=<deployment name>, config={"software_spec_type": "runtime-22.1-py3.10"})

Delete deployment

Delete an existing deployment. Exception will be raised if the model is not already deployed.

CLI
mlflow deployments delete -t watsonml --name <deployment name / version number>
Python API
plugin.delete_deployment(name=<deployment name>)

List all deployments

Lists the names of all the models deployed on the configured WatsonML.

CLI
mlflow deployments list -t watsonml
Python API
plugin.list_deployments()

Get deployment details

Get API fetches the details of the deployed model. By default, Get API fetches all the versions of the deployed model.

CLI
mlflow deployments get -t watsonml --name <deployment name>
Python API
plugin.get_deployment(name=<deployment name>)

Run Prediction on deployed model

Predict API enables to run prediction on the deployed model.

For the prediction inputs, DataFrame and JSON formats are supported. The python API supports all of these three formats. When invoked via command line, one needs to pass the json file path that contains the inputs.

CLI
mlflow deployments predict -t watsonml --name <deployment name> --input-path <input file path> --output-path <output file path>

output-path is an optional parameter. Without output path parameter result will be printed in console.

Python API
plugin.predict(name=<deployment name>, df=<prediction input>)

Plugin help

Run the following command to get the plugin help string.

CLI
mlflow deployments help -t watsonml

Metadata

Release files for mlflow-watsonml 0.11.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlflow-watsonml 0.11.4
File Size Uploaded
mlflow-watsonml-0.11.4.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mlflow-watsonml 0.11.4
File Interpreter ABI Platform
mlflow_watsonml-0.11.4-py3-none-any.whl Python 3 none any Details

Total release size: 40.3 kB

Release files / mlflow-watsonml-0.11.4.tar.gz

Download URL mlflow-watsonml-0.11.4.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
aa9fd1302ea96009eb2bc08821e30bf7cc7619ebb2a00d461ad330250f7f0645
BLAKE2b-256 checksum
How to use checksums
ebe8b1f0642b01f7dc7a29dfcca915f0bf626e5b3ff43d9d3744db080a0ab3e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / mlflow_watsonml-0.11.4-py3-none-any.whl

Download URL mlflow_watsonml-0.11.4-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81b3f9c9265806bdc75bbf8d44dacaa7fc13ecbb2a444392efd44473718052a9
BLAKE2b-256 checksum
How to use checksums
138ff87df307d92ec92156c42de4352796ccff77bd6651eba7801fa814209baa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.11.4 This release

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.2.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page