MLflow Google Cloud Vertex AI integration package
Project description
MLflow plugin for Google Cloud Vertex AI
Note: The plugin is experimental and may be changed or removed in the future.
Installation
python3 -m pip install google_cloud_mlflow
Deployment plugin 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
from mlflow import deployments
client = deployments.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,
# Endpoint config
endpoint_description=None,
endpoint_deploy_timeout=None,
# Vertex AI config
project=None,
location=None,
encryption_spec_key_name=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)
Model Registry plugin usage
Set the MLflow Model Registry URI to a directory in some Google Cloud Storage bucket, then log models using mlflow.log_model
as usual.
mlflow.set_registry_uri("gs://<bucket>/models/")
Project details
Release history Release notifications | RSS feed
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.6.tar.gz
(22.7 kB
view details)
Built Distribution
File details
Details for the file google_cloud_mlflow-0.0.6.tar.gz
.
File metadata
- Download URL: google_cloud_mlflow-0.0.6.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffbb0434b5103c63b470b30007e450bf49e5d9900777ce97b9ec0d780d843509 |
|
MD5 | d48fb50f8d48f25cf455abfe2c854e02 |
|
BLAKE2b-256 | 9ab82b5f7b3bd94db0b5430685c431cef3976c98943f41d61e9f546123aa8c2b |
File details
Details for the file google_cloud_mlflow-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: google_cloud_mlflow-0.0.6-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70cdfa10ba2bb858f58373a4aeada9c4def00c105e2a45c09557b4688f299ced |
|
MD5 | 06cb93c1395b526477b3b04cc83c8bc1 |
|
BLAKE2b-256 | 419c8cecc34e594e12b5cf15ed816de02736f1e82d23b7ce72dd9fd7bda36c7f |