Creating the Model entry in Cloudera AI Registry in an air-gapped environment

After uploading the model files, create the model in Cloudera AI Registry. During registration, Cloudera AI Registry copies the files from the remote object storage location into its internal storage.

For instructions on creating a Mistral model, see Registering a Mistral Model.

The following example creates a Model from a Hugging Face Model:
curl -X POST https://<registry-host>/api/v3/models \
  --header "Cookie: hadoop-jwt=$HADOOP_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name": "tiny-random-gpt2",
       "create_model_version_request_payload": {
         "metadata": {"model_repo_type": "HF"},
         "download_model_repo_request": {
           "source": "REMOTE",
           "repo_id": "hf-internal-testing/tiny-random-gpt2",
           "remote_object_storage_path": "<remote_object_storage_path>"}}}'
The following example creates a Model from an NVIDIA NGC (NIM) optimization profile:
curl -X POST https://<registry-host>/api/v3/models \
  --header "Cookie: hadoop-jwt=$HADOOP_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name": "llama-3.1-8b-instruct",
       "create_model_version_request_payload": {
         "metadata": {"model_repo_type": "NGC"},
         "download_model_repo_request": {
           "source": "REMOTE",
           "repo_id": "nim/meta/llama-3.1-8b-instruct:fp8-tool-calling",
           "remote_object_storage_path": "<remote_object_storage_path>"}}}'
Specify the following values in the request:
  • name: The name of the Model in Cloudera AI Registry. The name can have a maximum of 50 characters.

  • model_repo_type: HF for a Hugging Face Model, or NGC for an NVIDIA NGC (NIM) Model.

  • source: REMOTE, to import the Model from the remote object storage location.

  • repo_id: The repository ID that you used for the download and the upload.

  • remote_object_storage_path: The path from GET /api/v3/config, exactly as returned. If the value differs, the request fails with HTTP 400.

The request creates the Model, adds a version to it, and starts the import. To check the status of the import, use the ID of the Model (the id field in the response):
curl --header "Cookie: hadoop-jwt=$HADOOP_JWT" https://<registry-host>/api/v3/models/<model ID>/versions/1

The status field progresses from REGISTERING to UPLOADING, and finally to READY. Once the status is READY, the model is available for deployment.

If the status changes to UPLOAD_FAILED, the error_message field of the model version describes the reason for the failure. For additional details, review the import job logs as described in Troubleshooting Failed Mistral Model Imports. After correcting the uploaded files, register a new version of the model using the same model values.