Cloudera AI Workbench Models (Legacy)PDF version

Cloudera AI Registry CLI Client

Cloudera AI Registry client is a command line tool (CLI) that can be used to interact to a Cloudera AI Registry server. It can be downloaded from any Cloudera AI Registry server <domain>/apiv2/cli/<os>. Here, <os> is either Linux, Darwin for Mac, or Windows based on the operating system the Cloudera AI Registry CLI is installed on.

The swagger CLI is downloaded from https://<domain>/apiv2/cli/<os>. The following are some of the example usage of CLI.

After you download the CLI and add it to the path, you can use the modelregistrycli commands.
modelregistrycli help
Usage:
  modelregistrycli [command]

Available Commands:
  completion  Generate completion script
  help        Help about any command
  operations  

Flags:
      --Authorization string   
      --config string          config file path
      --debug                  output debug logs
      --dry-run                do not send the request to server
  -h, --help                   help for modelregistrycli
      --hostname string        hostname of the service (default "localhost")
      --scheme string          Choose from: [http] (default "http")
Create an imported model request
$ modelregistrycli --Authorization "Bearer nil" --hostname localhost:8188 operations CreateModel --body '{
    "name": "tiny",
    "createModelVersionRequestPayload": {
        "metadata": {
            "model_repo_type": "HF"
        },
        "downloadModelRepoRequest": {
            "source": "HF",
            "repo_id": "prajjwal1/bert-tiny"
        }
    }
}'
***Output:***

{"created_at":"2024-04-03T18:02:15.331Z","creator":{"user_name":"admin"},"description":"model to classify catAndDogClassifier","id":"1w6s-8m6t-ngdr-3qvr","model_versions":null,"name":"catAndDogClassifier","tags":[{"key":"cat","value":"1"}],"updated_at":"2024-04-03T18:02:15.331Z","visibility":"public"}
$ modelregistrycli --Authorization "Bearer nil" --hostname localhost:8188 operations GetModels

***output***:

{"models":[{"created_at":"2024-04-03T18:02:15.331Z","creator":{"user_name":"admin"},"description":"model to classify catAndDogClassifier","id":"1w6s-8m6t-ngdr-3qvr","model_versions":null,"name":"catAndDogClassifier","tags":null,"updated_at":"2024-04-03T18:02:15.331Z","visibility":"public"},{"created_at":"2024-04-03T18:08:43.130Z","creator":{"user_name":"admin"},"description":"create request model request with model version example","id":"8fts-rgpn-r9xo-xlh0","model_versions":null,"name":"chain-classifier","tags":null,"updated_at":"2024-04-03T18:08:43.130Z","visibility":"public"}]}
$ modelregistrycli --Authorization "Bearer nil" --hostname localhost:8188 operations GetModel --model_id '8fts-rgpn-r9xo-xlh0'
{"created_at":"2024-04-03T18:08:43.130Z","creator":{"user_name":"admin"},"description":"create request model request with model version example","id":"8fts-rgpn-r9xo-xlh0","model_versions":[{"artifact_uri":"http://localhost:9000/8fts-rgpn-r9xo-xlh0/r5eg-m0gp-i4qs-8b07/model.tar.gz","created_at":"2024-04-03T18:08:43.132Z","model_id":"8fts-rgpn-r9xo-xlh0","notes":"create request model request with model version example","status":"REGISTERING","tags":[{"key":"chain","value":"2"}],"updated_at":"2024-04-03T18:08:43.132Z","user":{"user_name":"admin"},"version":1}],"name":"chain-classifier","tags":null,"updated_at":"2024-04-03T18:08:43.130Z","visibility":"public"}

We want your opinion

How can we improve this page?

What kind of feedback do you have?