Skip to main content

Create a Hugging Face Repository

To download Hugging Face content through Nexus Repository, create a Hugging Face proxy repository. See Nexus Repository Management and Repository Types to learn more.

Hugging Face Proxy Repository

Use a proxy repository to download Hugging Face content and centrally cache external dependencies. See Proxy Repositories for more details.

To create a Hugging Face proxy repository, complete the following steps:

Nexus One UI

  1. Navigate to SettingsRepositories.

  2. Select Create Repository.

  3. In the Select Format section, select Hugging Face.

  4. In the Select Type section, select Proxy.

  5. In the configuration form, complete the required fields:

  6. To download gated content from Hugging Face Hub, configure HTTP authentication.

    1. In the HTTP section, set Authentication Type to Bearer Token.

    2. In Bearer Token field, enter the access token provided by Hugging Face.

  7. Expand HTTP Request Settings and set Connection/Socket Timeout to 120 seconds. Increase this value if network latency or large file sizes require a longer timeout.

  8. Complete any additional configuration fields that you want to use for the repository. Available fields vary by repository format and type. See Configurable Repository Fields for more information. Then select Continue.

  9. In the Enable Firewall section, select one of the following options:

    • Select Skip to leave Repository Firewall disabled.

    • Select Audit to monitor policy violations and malware.

    • Select Quarantine to block the download of components.

    The firewall options aren't available if your firewall isn't configured. To configure Sonatype Firewall with Nexus Repository, follow the instructions in Nexus Repository 3 Pro Setup.

  10. In the Enable RHC section, turn on Enable Repository Health Check to analyze components for security vulnerabilities and license issues. Leave it disabled if you want to configure it later.

  11. Select Create Repository.

    Hugging_Face-proxy-new_ui.png

Classic UI

  1. Navigate to SettingsRepositoryRepositories.

  2. Select Create repository.

  3. From the list of recipes, select huggingface (proxy).

  4. In the form that appears, complete the required fields:

  5. To download gated content from Hugging Face Hub, select the Authentication checkbox in the HTTP section.

  6. Under Authentication type, select Preemptive Bearer Token.

  7. Enter the access token provided by Hugging Face.

  8. Select the HTTP request settings checkbox and set the Connection timeout to 120 seconds. Increase this value if network latency or large file sizes require a longer timeout.

  9. Complete any additional configuration fields that you want to use for the repository. Available fields vary by repository format and type. See Configurable Repository Fields for more information.

  10. Select Create repository.

    huggingface-proxy.png

Note

Sonatype recommends using NFS, EFS, or Azure file storage for optimal performance. In testing, AWS S3 and Azure Blob stores exhibited performance issues that can affect download speeds.