Repolode
huggingface

huggingface/huggingface_hub

The official CLI (hf) and Python client for downloading, uploading and managing repositories on the Hugging Face Hub.

Stars
3,990
Forks
1,285
Open issues
185
Last commit
19 hours ago

What is it?

huggingface_hub is the official Python library and command-line tool for the Hugging Face Hub, a platform for hosting machine learning models, datasets and Spaces. It lets you download and upload files, create and manage repositories, search the Hub, run inference on deployed models, and launch jobs on Hugging Face infrastructure, all from Python code or a terminal.

The package ships two interfaces: the hf CLI for shell use, installable through a standalone script or pip, and a Python API with functions such as hf_hub_download, snapshot_download, upload_file and upload_folder. Downloaded files are stored in a local cache folder so repeated loads don't fetch them again.

The CLI is also designed to work for coding agents, and it can install a generated command-reference skill for agents such as Claude Code, Codex and Cursor.

Key features

  • 01Download single files or entire repositories into a local cache.
  • 02Upload files or folders to models, datasets and Spaces.
  • 03Create and manage Hub repositories from Python or the terminal.
  • 04Search models, datasets and Spaces on the Hub.
  • 05Run inference on deployed models and launch jobs on Hugging Face infrastructure.
  • 06Authenticate with Hub access tokens, including non-interactive use.

Use cases

  • Downloading pretrained model weights into a training or inference pipeline.
  • Publishing model checkpoints or datasets to the Hub from a training script.
  • Syncing local folders to a Hub storage bucket from a terminal or CI job.
  • Letting coding agents interact with Hub repositories through the hf CLI.

Quick start

  1. 1

    Install the hf CLI (macOS and Linux)

    Install with the official instructions in the README
  2. 2

    Log in to the Hub

    hf auth login
  3. 3

    Download a model

    hf download Qwen/Qwen3-0.6B

Things to know

  • Requires a Hugging Face account and token to upload or manage private repositories.

Topics

FAQ

What is huggingface_hub?
The official CLI (hf) and Python client for downloading, uploading and managing repositories on the Hugging Face Hub. huggingface_hub is the official Python library and command-line tool for the Hugging Face Hub, a platform for hosting machine learning models, datasets and Spaces. It lets you download and upload files, create and manage repositories, search the Hub, run inference on deployed models, and launch jobs on Hugging Face infrastructure, all from Python code or a terminal.
Is huggingface_hub free to use? What license does it have?
huggingface_hub is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is huggingface_hub still maintained?
Actively maintained. The last commit to huggingface_hub was on Oct 19, 2026.
What can I use huggingface_hub for?
Downloading pretrained model weights into a training or inference pipeline. Publishing model checkpoints or datasets to the Hub from a training script. Syncing local folders to a Hub storage bucket from a terminal or CI job. Letting coding agents interact with Hub repositories through the hf CLI.
How do I install huggingface_hub?
Install the hf CLI (macOS and Linux) Log in to the Hub: hf auth login Download a model: hf download Qwen/Qwen3-0.6B
Where can I get huggingface_hub?
The source code and installation instructions are on GitHub: https://github.com/huggingface/huggingface_hub

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects