Share via


model-registry command group

Note

This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.

Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.

Note

This API reference documents APIs for the Workspace Model Registry. Databricks recommends using Models in Unity Catalog instead. Models in Unity Catalog provides centralized model governance, cross-workspace access, lineage, and deployment. Workspace Model Registry will be deprecated in the future.

The model-registry command group within the Databricks CLI allows you to manage the full lifecycle of MLflow Models. The Workspace Model Registry is a centralized model repository and a UI and set of APIs that enable you to manage the full lifecycle of MLflow Models.

databricks model-registry approve-transition-request

Approve a model version stage transition request.

databricks model-registry approve-transition-request NAME VERSION STAGE ARCHIVE_EXISTING_VERSIONS [flags]

Arguments

NAME

    Name of the model.

VERSION

    Version of the model.

STAGE

    Target stage of the transition. Supported values: Archived, None, Production, Staging

ARCHIVE_EXISTING_VERSIONS

    Specifies whether to archive all current model versions in the target stage.

Options

--comment string

    User-provided comment on the action.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry create-comment

Post a comment on a model version. A comment can be submitted either by a user or programmatically to display relevant information about the model. For example, test results or deployment errors.

databricks model-registry create-comment NAME VERSION COMMENT [flags]

Arguments

NAME

    Name of the model.

VERSION

    Version of the model.

COMMENT

    User-provided comment on the action.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry create-model

Create a new registered model with the name specified in the request body.

Throws RESOURCE_ALREADY_EXISTS if a registered model with the given name exists.

databricks model-registry create-model NAME [flags]

Arguments

NAME

    Register models under this name

Options

--description string

    Optional description for registered model.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry create-model-version

Create a model version.

databricks model-registry create-model-version NAME SOURCE [flags]

Arguments

NAME

    Register model under this name

SOURCE

    URI indicating the ___location of the model artifacts.

Options

--description string

    Optional description for model version.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

--run-id string

    MLflow run ID for correlation, if source was generated by an experiment run in MLflow tracking server.

--run-link string

    MLflow run link - this is the exact link of the run that generated this model version, potentially hosted at another instance of MLflow.

Global flags

databricks model-registry create-transition-request

Create a model version stage transition request.

databricks model-registry create-transition-request NAME VERSION STAGE [flags]

Arguments

NAME

    Name of the model.

VERSION

    Version of the model.

STAGE

    Target stage of the transition. Valid values are:

  • None: The initial stage of a model version.
  • Staging: Staging or pre-production stage.
  • Production: Production stage.
  • Archived: Archived stage.

Supported values: [Archived, None, Production, Staging]

Options

--comment string

    User-provided comment on the action.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry create-webhook

Note

This command is in Public Preview.

Create a registry webhook.

databricks model-registry create-webhook [flags]

Arguments

None

Options

--description string

    User-specified description for the webhook.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

--model-name string

    Name of the model whose events would trigger this webhook.

--status RegistryWebhookStatus

    Enable or disable triggering the webhook, or put the webhook into test mode. Supported values: [ACTIVE, DISABLED, TEST_MODE]

Global flags

databricks model-registry delete-comment

Delete a comment on a model version.

databricks model-registry delete-comment ID [flags]

Arguments

ID

    Unique identifier of the comment to delete.

Options

Global flags

databricks model-registry delete-model

Delete a registered model.

databricks model-registry delete-model NAME [flags]

Arguments

NAME

    Registered model unique name identifier.

Options

Global flags

databricks model-registry delete-model-tag

Delete the tag for a registered model.

databricks model-registry delete-model-tag NAME KEY [flags]

Arguments

NAME

    Name of the registered model that the tag was logged under.

KEY

    Name of the tag. The name must be an exact match; wild-card deletion is not supported. Maximum size is 250 bytes.

Options

Global flags

databricks model-registry delete-model-version

Delete a model version.

databricks model-registry delete-model-version NAME VERSION [flags]

Arguments

NAME

    Name of the registered model

VERSION

    Model version number

Options

Global flags

databricks model-registry delete-model-version-tag

Delete a model version tag.

databricks model-registry delete-model-version-tag NAME VERSION KEY [flags]

Arguments

NAME

    Name of the registered model that the tag was logged under.

VERSION

    Model version number that the tag was logged under.

KEY

    Name of the tag. The name must be an exact match; wild-card deletion is not supported. Maximum size is 250 bytes.

Options

Global flags

databricks model-registry delete-transition-request

Cancel a model version stage transition request.

databricks model-registry delete-transition-request NAME VERSION STAGE CREATOR [flags]

Arguments

NAME

    Name of the model.

VERSION

    Version of the model.

STAGE

    Target stage of the transition request. Valid values are:

  • None: The initial stage of a model version.
  • Staging: Staging or pre-production stage.
  • Production: Production stage.
  • Archived: Archived stage.

Supported values: [Archived, None, Production, Staging]

CREATOR

    Username of the user who created this request. Of the transition requests matching the specified details, only the one transition created by this user will be deleted.

Options

--comment string

    User-provided comment on the action.

Global flags

databricks model-registry delete-webhook

Note

This command is in Public Preview.

Deletes a registry webhook.

databricks model-registry delete-webhook [flags]

Arguments

None

Options

--id string

    Webhook ID required to delete a registry webhook.

Global flags

databricks model-registry get-latest-versions

Get the latest version of a registered model.

databricks model-registry get-latest-versions NAME [flags]

Arguments

NAME

    Registered model unique name identifier.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry get-model

Get the details of a model. This is a Databricks workspace version of the MLflow endpoint that also returns the model's Databricks workspace ID and the permission level of the requesting user on the model.

databricks model-registry get-model NAME [flags]

Arguments

NAME

    Registered model unique name identifier.

Options

Global flags

databricks model-registry get-model-version

Get a model version.

databricks model-registry get-model-version NAME VERSION [flags]

Arguments

NAME

    Name of the registered model

VERSION

    Model version number

Options

Global flags

databricks model-registry get-model-version-download-uri

Get a URI to download the model version.

databricks model-registry get-model-version-download-uri NAME VERSION [flags]

Arguments

NAME

    Name of the registered model

VERSION

    Model version number

Options

Global flags

databricks model-registry list-models

List all available registered models, up to the limit specified in max_results.

databricks model-registry list-models [flags]

Arguments

None

Options

--max-results int

    Maximum number of registered models desired.

--page-token string

    Pagination token to go to the next page based on a previous query.

Global flags

databricks model-registry list-transition-requests

Get a list of all open stage transition requests for the model version.

databricks model-registry list-transition-requests NAME VERSION [flags]

Arguments

NAME

    Name of the model.

VERSION

    Version of the model.

Options

Global flags

databricks model-registry list-webhooks

Note

This command is in Public Preview.

List all registry webhooks.

databricks model-registry list-webhooks [flags]

Arguments

None

Options

--model-name string

    If not specified, all webhooks associated with the specified events are listed, regardless of their associated model.

--page-token string

    Token indicating the page of artifact results to fetch.

Global flags

databricks model-registry reject-transition-request

Reject a model version stage transition request.

databricks model-registry reject-transition-request NAME VERSION STAGE [flags]

Arguments

NAME

    Name of the model.

VERSION

    Version of the model.

STAGE

    Target stage of the transition. Valid values are:

  • None: The initial stage of a model version.
  • Staging: Staging or pre-production stage.
  • Production: Production stage.
  • Archived: Archived stage.

Supported values: [Archived, None, Production, Staging]

Options

--comment string

    User-provided comment on the action.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry rename-model

Rename a registered model.

databricks model-registry rename-model NAME [flags]

Arguments

NAME

    Registered model unique name identifier.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

--new-name string

    If provided, updates the name for this registered_model.

Global flags

databricks model-registry search-model-versions

Searche for specific model versions based on the supplied filter.

databricks model-registry search-model-versions [flags]

Arguments

None

Options

--filter string

    String filter condition, like "name='my-model-name'".

--max-results int

    Maximum number of models desired.

--page-token string

    Pagination token to go to next page based on previous search query.

Global flags

databricks model-registry search-models

Search for registered models based on the specified filter.

databricks model-registry search-models [flags]

Arguments

None

Options

--filter string

    String filter condition, like "name LIKE 'my-model-name'".

--max-results int

    Maximum number of models desired.

--page-token string

    Pagination token to go to the next page based on a previous search query.

Global flags

databricks model-registry set-model-tag

Set a tag on a registered model.

databricks model-registry set-model-tag NAME KEY VALUE [flags]

Arguments

NAME

    Unique name of the model.

KEY

    Name of the tag. Maximum size depends on storage backend. If a tag with this name already exists, its preexisting value will be replaced by the specified value. All storage backends are guaranteed to support key values up to 250 bytes in size.

VALUE

    String value of the tag being logged. Maximum size depends on storage backend. All storage backends are guaranteed to support key values up to 5000 bytes in size.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry set-model-version-tag

Set a model version tag.

databricks model-registry set-model-version-tag NAME VERSION KEY VALUE [flags]

Arguments

NAME

    Unique name of the model.

VERSION

    Model version number.

KEY

    Name of the tag. Maximum size depends on storage backend. If a tag with this name already exists, its preexisting value will be replaced by the specified value. All storage backends are guaranteed to support key values up to 250 bytes in size.

VALUE

    String value of the tag being logged. Maximum size depends on storage backend. All storage backends are guaranteed to support key values up to 5000 bytes in size.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry test-registry-webhook

Note

This command is in Public Preview.

Test a registry webhook.

databricks model-registry test-registry-webhook ID [flags]

Arguments

ID

    Webhook ID

Options

--event RegistryWebhookEvent

    If event is specified, the test trigger uses the specified event. Supported values: [ COMMENT_CREATED, MODEL_VERSION_CREATED, MODEL_VERSION_TAG_SET, MODEL_VERSION_TRANSITIONED_STAGE, MODEL_VERSION_TRANSITIONED_TO_ARCHIVED, MODEL_VERSION_TRANSITIONED_TO_PRODUCTION, MODEL_VERSION_TRANSITIONED_TO_STAGING, REGISTERED_MODEL_CREATED, TRANSITION_REQUEST_CREATED, TRANSITION_REQUEST_TO_ARCHIVED_CREATED, TRANSITION_REQUEST_TO_PRODUCTION_CREATED, TRANSITION_REQUEST_TO_STAGING_CREATED ]

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry transition-stage

Transition a model version's stage. This is a Databricks workspace version of the MLflow endpoint that also accepts a comment associated with the transition to be recorded.

databricks model-registry transition-stage NAME VERSION STAGE ARCHIVE_EXISTING_VERSIONS [flags]

Arguments

NAME

    Name of the model.

VERSION

    Version of the model.

STAGE

    Target stage of the transition. Valid values are:

  • None: The initial stage of a model version.
  • Staging: Staging or pre-production stage.
  • Production: Production stage.
  • Archived: Archived stage.

Supported values: [Archived, None, Production, Staging]

ARCHIVE_EXISTING_VERSIONS

    Specifies whether to archive all current model versions in the target stage.

Options

--comment string

    User-provided comment on the action.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry update-comment

Post an edit to a comment on a model version.

databricks model-registry update-comment ID COMMENT [flags]

Arguments

ID

    Unique identifier of an activity

COMMENT

    User-provided comment on the action.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry update-model

Update a registered model.

databricks model-registry update-model NAME [flags]

Arguments

NAME

    Registered model unique name identifier.

Options

--description string

    If provided, updates the description for this registered_model.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry update-model-version

Update the model version.

databricks model-registry update-model-version NAME VERSION [flags]

Arguments

NAME

    Name of the registered model

VERSION

    Model version number

Options

--description string

    If provided, updates the description for this registered_model.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry update-webhook

Note

This command is in Public Preview.

Update a registry webhook.

databricks model-registry update-webhook ID [flags]

Arguments

ID

    Webhook ID

Options

--description string

    User-specified description for the webhook.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

--status RegistryWebhookStatus

    Enable or disable triggering the webhook, or put the webhook into test mode. Supported values: [ACTIVE, DISABLED, TEST_MODE]

Global flags

databricks model-registry get-permission-levels

Get registered model permission levels.

databricks model-registry get-permission-levels REGISTERED_MODEL_ID [flags]

Arguments

REGISTERED_MODEL_ID

    The registered model for which to get or manage permissions.

Options

Global flags

databricks model-registry get-permissions

Gets the permissions of a registered model. Registered models can inherit permissions from their root object.

databricks model-registry get-permissions REGISTERED_MODEL_ID [flags]

Arguments

REGISTERED_MODEL_ID

    The registered model for which to get or manage permissions.

Options

Global flags

databricks model-registry set-permissions

Set registered model permissions, replacing existing permissions if they exist. Deletes all direct permissions if none are specified. Objects can inherit permissions from their root object.

databricks model-registry set-permissions REGISTERED_MODEL_ID [flags]

Arguments

REGISTERED_MODEL_ID

    The registered model for which to get or manage permissions.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks model-registry update-permissions

Update the permissions on a registered model. Registered models can inherit permissions from their root object.

databricks model-registry update-permissions REGISTERED_MODEL_ID [flags]

Arguments

REGISTERED_MODEL_ID

    The registered model for which to get or manage permissions.

Options

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

Global flags

--debug

  Whether to enable debug logging.

-h or --help

    Display help for the Databricks CLI or the related command group or the related command.

--log-file string

    A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.

--log-format format

    The log format type, text or json. The default value is text.

--log-level string

    A string representing the log format level. If not specified then the log format level is disabled.

-o, --output type

    The command output type, text or json. The default value is text.

-p, --profile string

    The name of the profile in the ~/.databrickscfg file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT is used.

--progress-format format

    The format to display progress logs: default, append, inplace, or json

-t, --target string

    If applicable, the bundle target to use