client.set_registered_model_alias()
or client.delete_registered_model_alias()
, the R package only provides mlflow::mlflow-transition-model-version-stage
at the moment.Questions
I found a somewhat okeyish workaround: I just use the mlflow rest api (https://mlflow.org/docs/latest/rest-api.html#set-registered-model-alias) from R to set the alias...
mlflowSetRegisteredModelAlias <- function(mlflowUri, modelName, alias, version) {
# Define api request payload
payload <- list(name = modelName,
alias = alias,
version = as.character(version))
# Make the POST request
mlflowApiEndpoint <- paste0(mlflowUri, "api/2.0/mlflow/registered-models/alias")
response <- mlflowApiEndpoint %>%
httr2::request() %>%
httr2::req_body_json(payload) %>%
httr2::req_perform()
}
For deleting an alias it would be with ad DELETE method:
payload <- list(name = modelName, alias = alias)
# Make the DELETE request
response <- mlflowApiEndpoint %>%
httr2::request() %>%
httr2::req_method("DELETE") %>%
httr2::req_body_json(payload) %>%
httr2::req_perform()