Prerequisites for downloading and uploading Model artifacts in air-gapped environment

Before downloading or uploading models, ensure you have the following tools and configurations installed on the host that is connected to the airgap setup. This might be your bastion host.

  • Required tools:

    • Hugging Face CLI: pip install -U "huggingface_hub[cli]"
    • AWS CLI: pip install awscli==1.35.0
    • PyYAML:pip install pyyaml
    • NVIDIA NGC CLI: Install from https://org.ngc.nvidia.com/setup/installers/cli for NVIDIA NGC catalog models. Make sure you configure the NVIDIA NGC client with the credentials provided by Cloudera.
    • Azure CLI: pip install azure-cli
    • Python: Ensure your Python version is is 3.10.12 or higher and lower than version 3.11
    • Python requests package: pip install requests
  • Configuration details:
    • Configure the NGC client with credentials provided by Cloudera during onboarding. Use the following commands to add your key and organization to your ~/.bashrc file.
    • Bash
      echo 'export NGC_CLI_API_KEY=<key>' >> ~/.bashrc 
      echo 'export NGC_CLI_ORG=<org>' >> ~/.bashrc
  • Installing the NVIDIA Inference Microservice (NIM) CLI
    This procedure details how Cloudera organization accounts can request early access and install the NIM CLI.
    1. Obtaining Early Access to NIM CLI: Navigate to the NVIDIA developer portal and follow the on-screen instructions to request early access.
    2. Installing NIM CLI: Once early access is granted, use the following steps to download and install the NIM CLI:
      1. Download the installer using the NVIDIA GPU Cloud (NGC) CLI:
        ngc registry resource download-version nvidia/nim-tools/nimtools_installer:0.0.8
      2. Navigate to the installer directory:
        cd nimtools_installer_v0.0.8/
      3. Run the Python installation script. Be sure to provide your NGC service key and the --nimcli-only flag:
        python3 nimtools_installer.py --ngc-api-key [***your-ngc-service-key***] --nimcli-only
  • Download Script:

    Use the import_to_airgap.py script to download model repositories from Hugging Face or NVIDIA NGC and upload them to your cloud storage.

    You can download the script from this GitHub location: https://github.com/cloudera/Model-Hub/blob/main/airgap-scripts/pbc/import_to_airgap.py

    The script has the following parameters:

    Table 1.
    Parameter Value Description
    -do Activates download mod
    -rt hf or ngc Repository type: use hf for Hugging Face. Use ngc for NVIDIA NGC catalog.
    -t <token>

    Hugging Face API token: required for accessing private or gated models that need authentication.

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

    -p $PWD/models Local Path: The destination directory where model files will be downloaded (example: $PWD/models). It uses the current working directory.
    -ri <ID> Repository ID: The model's ID from either Hugging Face or NVIDIA NGC.
    -ns <file name> NGC Specification File: Required when downloading NGC models. The file can be downloaded from: https://github.com/cloudera/Model-Hub/blob/main/models/airgapped/public/1.50.0_concatenated.yaml