Importing Model to Cloudera AI Registry in air-gapped environment

You can import the Hugging Face models listed on the Model Hub page into your Cloudera AI Registry.

Download the following script to enable downloading Model repositories from the Hugging Face or NVIDIA NGC catalog and uploading Models to on premises storage providers.

Download the script from here: https://github.infra.cloudera.com/Sense/model-registry/blob/main/scripts/import_to_airgap.py

The script has the following parameters:

Table 1.
Parameter Value Description
-do Activates download mod
-rt hf Repository type: "hf" for Hugging Face (use "ngc" for NVIDIA NGC catalog)
-t hf_hVQbUsafafafafadfadfsNAynASXJoTCWHAEkj

Hugging Face API token for authentication (required for private or gated Models)

The Hugging Face token (-t) is required for accessing gated

Models or Models that require authentication. For more information about tokens, see:https://huggingface.co/docs/hub/en/security-tokens

-p $PWD/models Local destination path where Model files are downloaded (uses current working directory)
-ri Nvidia/Llama-3.1-Nemotron-70B-Instruct-HF Repository ID for the Model on Hugging Face
  1. In the Cloudera console, click the Cloudera AI tile.

    The Cloudera AI Workbenches page displays.

  2. Click Model Hub under AI Hub in the left navigation menu.

    The Model Hub page displays. The page lists different models along with their source type, tags, and description.

  3. Click Import on the model you want to import.

    The Import Model page displays.

    Figure 1. Import model


  4. In the Select AI Registry drop-down list, select the Cloudera AI Registry to which you want to import the model.
  5. In the Select Model Size drop-down list, select the model size.
  6. In the Select Optimization drop-down list, select the optimization profile. It displays the recommended GPU counts for the specific GPU of the optimization profile.
  7. In the Enter Name or Select Model field, select a name from the existing list or enter a new name for the model you are importing.
  8. Enable the Use Preloaded Artifacts feature with its checkbox.
  9. Click Import. The Model Hub page displays a message that the Model import has been triggered successfully along with a button to view the status of that import process.

You can click Cloudera AI Registry in the left navigation menu to view the newly imported Model.