Downloading model repositories in an air-gapped environment

To use models from Hugging Face, NVIDIA NGC (NIM), and Mistral, the Administrator must download model artifacts from these sources on specially networked hosts, bastion hosts.

Downloading a HuggingFace model

  1. Download the model from Hugging Face to your local file system by using the following example command:

    python3 import_to_airgap.py -do -rt hf -t [***HF TOKEN***] -ri hf-tiny-model-private/tiny-random-YosoModel

    The download includes all model files and metadata in the destination directory.

    Table 1.
    Argument Description
    -do Specifies the download-only operation.
    -rt hf Indicates that the repository type is Hugging Face (hf).
    -ri hf-tiny-model-private/tiny-random-YosoModel

    Specifies the repository ID (model name) to download.

    You can obtain the ri argument for Hugging Face by performing the following actions:
    1. Go to the Hugging Face website at https://huggingface.co/.
    2. Search for the required model.

      The page of the model displays.

    3. Click the icon next to the name of the model, and copy the model ID. Use this ID as the ri argument.
    -t Specifies your Hugging Face token. The Hugging Face token needs to provide read access to the repositories. For more information on Hugging Face tokens, see User access tokens.

    Result:

    The script downloads the Model metadata and the Model files. By default, it saves them in the models directory in your current working directory. To save them in a different directory, use the -p parameter.
    Fetching information for hf repository: hf-tiny-model-private/tiny-random-YosoModel
    Download path: ./models
    finish downloading metadata file
    Saved metadata to ./models/hf/hf-tiny-model-private/tiny-random-YosoModel/metadata/metadata.json
    Downloading repository: hf-tiny-model-private/tiny-random-YosoModel to ./models
    Starting download with huggingface-cli...
    Download completed successfully for hf-tiny-model-private/tiny-random-YosoModel
    The script saves the files in the following directories:
    • ./models/hf/hf-tiny-model-private/tiny-random-YosoModel/artifacts: model files
    • ./models/hf/hf-tiny-model-private/tiny-random-YosoModel/metadata: metadata.json

    If you use the configure option the default path is $HOME/.airgap/model.

Downloading an NVIDIA NGC (NIM) model

  • Download the NVIDIA NGC (NIM) model to your local file system using the following command:
    python3 import_to_airgap.py -do -rt ngc -ri nim/meta/llama-3_1-70b-instruct:0.11.1+14957bf8-h100x4-fp8-throughput.1.2.18099809 -ns ngc_spec.yaml

    For NVIDIA NGC (NIM) catalog downloads, use the -rt ngc argument and provide an NVIDIA NGC specification file with the -ns parameter. The -ns parameter is required only when you download NVIDIA NGC models. The specification file is provided by Cloudera. For more information, contact Cloudera Support.

    The download includes all model files and metadata in the specified destination directory.

Downloading a Mistral model

For more information on how to download a Mistral Model, see Downloading Mistral Model.