MLflow serve API Specs

Methods

enable_endpoint (databricks_api_url, model_name, databricks_cluster_hostname, databricks_workspace_token, request_time_out)

enable databricks model endpoint of a registered model (any model in Staging or Production tag gets deployed)

enable_endpoint

get_endpoint_state_status (artifact_uri, artifact_name, type_of_artifact)

returns the state of the databricks model endpoint, example: READY

get_endpoint_state_status

get_endpoint_status (databricks_api_url, model_name, databricks_cluster_hostname, databricks_workspace_token, polling_step, polling_max_tries, request_time_out)

returns a boolean if databricks model endpoint status is ready

get_endpoint_status

update_compute_config (databricks_api_url, model_name, stage, databricks_cluster_hostname, databricks_workspace_token, workload_size_id, scale_to_zero_enabled, request_time_out)

update the databricks endpoint compute config of a registered model; cluster size and if it scales to zero

update_compute_config

enable_endpoint

enable_endpoint(databricks_api_url: str, model_name: str, databricks_cluster_hostname: str, databricks_workspace_token: str, request_time_out: int = 60)
enable databricks model endpoint of a registered model (any model in Staging or Production tag gets deployed)
Parameters:
  • databricks_api_url (str) – url of the databricks api

  • model_name (str) – name of registered model in mlflow

  • databricks_cluster_hostname (str) – databricks cluster hostname; https://xxx.cloud.databricks.com

  • databricks_workspace_token (str) – databricks workspace PAT

  • request_time_out (int) – duration before request times out, default at 60 seconds

Returns:

returns a boolean if the model is enabled

Return type:

bool

get_endpoint_state_status

get_endpoint_state_status(response_json: dict)
returns the state of the databricks model endpoint, example: READY
Parameters:

response_json (dict) – response of the get request of mlflow api of get-status

Returns:

returns the state of the endpoint, example: READY

Return type:

str

get_endpoint_status

get_endpoint_status(databricks_api_url: str, model_name: str, databricks_cluster_hostname: str, databricks_workspace_token: str, polling_step: int = 10, polling_max_tries: int = 42, request_time_out: int = 60)
returns a boolean if databricks model endpoint status is ready
Parameters:
  • databricks_api_url (str) – url of the databricks api

  • model_name (str) – name of registered model in mlflow

  • databricks_cluster_hostname (str) – databricks cluster hostname; https://xxx.cloud.databricks.com

  • databricks_workspace_token (str) – databricks workspace PAT

  • polling_step (int) – duration of polling interval in seconds

  • polling_max_tries (int) – maximum number of tries of polling

  • request_time_out (int) – duration before request times out, default at 60 seconds

Returns:

returns a boolean if the model is enabled

Return type:

bool

update_compute_config

mlflow_get_both_registered_model_info_run_id(databricks_api_url: str, model_name: str, stage: str, databricks_cluster_hostname: str, databricks_workspace_token:str, workload_size_id: str = 10, scale_to_zero_enabled: str, request_time_out:int = 60)
update the databricks endpoint compute config of a registered model; cluster size and if it scales to zero
Parameters:
  • databricks_api_url (str) – url of the databricks api

  • model_name (str) – name of registered model in mlflow

  • stage (str) – stage of the registered model

  • databricks_cluster_hostname (str) – databricks cluster hostname; https://xxx.cloud.databricks.com

  • databricks_workspace_token (str) – databricks workspace PAT

  • workload_size_id (str) – databricks model endpoint, size of cluster; Small, Medium or Large

  • scale_to_zero_enabled (str) – flag to scale to zero; true or false

  • request_time_out (int) – duration before request times out, default at 60 seconds

Returns:

returns a non zero exit function if successful

Return type:

int