Hugging Face
Prerequisites
Install the Hugging Face CLI (
pip install -U huggingface_hubgives you thehfcommand).
Access to a Harness account with permissions to create registries and generate identity tokens.
Create a Hugging Face artifact registry
Start by creating a new Hugging Face registry in your Harness project.
Under Registries, click New Artifact Registry.
Select Hugging Face as the registry type.
Provide a Registry Name.
(Optional) Add a Description and Labels.
Choose visibility between Public and Private.
Click Create Registry.
NO UPSTREAM PROXY
Hugging Face registries do not proxy to the public Hub. If content is not present in your Harness registry, it will not automatically resolve from huggingface.co. Teams can switch endpoints when needed or pre-populate the registry with required artifacts. Client-side caching still applies.
Configure client
Configure environment variables
Set up environment variables to connect to Harness Artifact Registry.
Configure authentication
Click Generate token to generate an identity token.
Copy the token.
Set the token as an environment variable with the following command:
Deploy models and datasets
Upload a model to Artifact Registry using the huggingface_hub library:
Upload a dataset to Artifact Registry using the huggingface_hub library:
Resolve models and datasets
Download a model from Artifact Registry:
Artifact Registry supports resolving models using Hugging Face dataset libraries:
Or download an entire dataset repository using the snapshot_download API:
DATASET CACHING
Artifact Registry fully caches only datasets hosted directly on Hugging Face, not those referencing external sources.
Troubleshooting
Slow downloads or timeouts. Increase HF_HUB_ETAG_TIMEOUT and HF_HUB_DOWNLOAD_TIMEOUT. Verify network egress to the Harness endpoint.
File too large. Ensure Git LFS is used automatically by the CLI; confirm the LFS filter in your repo and re-try the upload.
Last updated
Was this helpful?