Skip to main content

MLFlow Google Cloud Vertex AI integration package

Project description

MLFlow deployment plugin for Google Cloud Vertex AI

Installation

python3 -m pip install google_cloud_mlflow

Usage

Command-line

Create deployment

mlflow deployments create --target google_cloud --name "deployment name" --model-uri "models:/mymodel/mymodelversion" --config destination_image_uri="gcr.io/<repo>/<path>"

List deployments

mlflow deployments list --target google_cloud

Get deployment

mlflow deployments get --target google_cloud --name "deployment name"

Delete deployment

mlflow deployments delete --target google_cloud --name "deployment name"

Update deployment

mlflow deployments update --target google_cloud --name "deployment name" --model-uri "models:/mymodel/mymodelversion" --config destination_image_uri="gcr.io/<repo>/<path>"

Predict

mlflow deployments predict --target google_cloud --name "deployment name" --input-path "inputs.json" --output-path "outputs.json

Get help

mlflow deployments help --target google_cloud

Python

import mlflow
client = mlflow.get_deploy_client("google_cloud")

# Create deployment
model_uri = "models:/mymodel/mymodelversion"
deployment = client.create_deployment(
    name="deployment name",
    model_uri=model_uri,
    # Config is optional
    config=dict(
        # Deployed model config
        machine_type="n1-standard-2",
        min_replica_count=None,
        max_replica_count=None,
        accelerator_type=None,
        accelerator_count=None,
        service_account=None,
        explanation_metadata=None, # JSON string
        explanation_parameters=None, # JSON string

        # Model container image building config
        destination_image_uri=None,
        timeout=None,

        # Model deployment config
        sync="true",

        # Endpoint config
        description=None,

        # Vertex AI config
        project=None,
        location=None,
        experiment=None,
        experiment_description=None,
        staging_bucket=None,

# List deployments
deployments = client.list_deployments()

# Get deployment
deployments = client.get_deployment(name="deployment name")

# Delete deployment
deployment = client.delete_deployment(name="deployment name")

# Update deployment
deployment = client.create_deployment(
    name="deployment name",
    model_uri=model_uri,
    # Config is optional
    config=dict(...),
)

# Predict
import pandas
df = pandas.DataFrame([
    {"a": 1,"b": 2,"c": 3},
    {"a": 4,"b": 5,"c": 6}
])
predictions = client.predict("deployment name", df)

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

google_cloud_mlflow-0.0.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

google_cloud_mlflow-0.0.1-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file google_cloud_mlflow-0.0.1.tar.gz.

File metadata

  • Download URL: google_cloud_mlflow-0.0.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.4

File hashes

Hashes for google_cloud_mlflow-0.0.1.tar.gz
Algorithm Hash digest
SHA256 60504590a9be12b8e4ff5f1237839c6a477c845186b69505ae0cbc61cdf45f6e
MD5 3a802b926a275ca5a12ad50546adbc1e
BLAKE2b-256 217d9e7977690289786b2442f7bcefa8420fa213916929ee564a21adaff90c5e

See more details on using hashes here.

Provenance

File details

Details for the file google_cloud_mlflow-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: google_cloud_mlflow-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.4

File hashes

Hashes for google_cloud_mlflow-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da295caa7bf840d9af7f7c437abc7d157038407ed033611570f25e69c19a5a23
MD5 57d6730bb5d7b4fdaf0fee9f40c75fc3
BLAKE2b-256 6b59f7ddb442394d25f4622dc854629878c5d59a7ea3dfd4e7ed8d4fafffaa2d

See more details on using hashes here.

Provenance

Supported by

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