huggingface/huggingface_hub
The official CLI and Python client for the Hugging Face Hub.
What it solves
It provides a unified way to interact with the Hugging Face Hub, a platform for sharing and discovering open-source machine learning models, datasets, and demos. It eliminates the need for manual web interface interactions by allowing users to manage their AI assets programmatically or via a command-line interface.
How it works
The project provides two primary interfaces: a Python library (huggingface_hub) and a command-line interface (hf CLI). Users can authenticate using tokens to perform actions such as downloading specific files or entire repositories, uploading files and folders, creating repositories, and running inference or jobs on Hugging Face infrastructure. It also supports integration with other ML libraries for free hosting and versioning.
Who it’s for
Machine learning engineers, researchers, and AI agents (such as Claude Code or Cursor) who need to programmatically manage, share, and discover ML models and datasets.
Highlights
- Dual Interface: Offers both a Python client and a dedicated CLI for terminal-based workflows.
- AI Agent Optimized: The
hfCLI can adapt its output for coding agents and provides a "skill" system for integration with tools like Cursor and Codex. - Infrastructure Integration: Ability to run jobs and inference directly on Hugging Face infrastructure.
- huile-efficient Storage: Uses a chunk-deduplicated storage backend (Xet) for efficient versioning of large files.
- Global Distribution: Leverages a CDN (Cloudfront) for fast global downloads of models and datasets.