huggingface_hub  by huggingface

Python client and CLI for the Hugging Face Hub

Created 5 years ago
3,757 stars

Top 12.7% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

huggingface_hub serves as the official Python library and command-line interface (CLI) for seamless interaction with the Hugging Face Hub, a pivotal platform democratizing open-source machine learning. It is designed to empower ML creators, researchers, and collaborators by simplifying the discovery, download, upload, and management of models, datasets, and ML applications. The tools are meticulously crafted for both human users and AI agents, aiming to streamline complex ML workflows and foster robust community engagement.

How It Works

The project offers two primary interfaces: the hf CLI for direct terminal operations and the huggingface_hub Python package for programmatic integration into ML pipelines. These interfaces facilitate a comprehensive suite of core tasks, including downloading and uploading files, managing user repositories, running inference on deployed models, executing custom jobs on Hugging Face's infrastructure, and efficiently searching for ML resources. A key design principle is adaptability, with the CLI providing output formats that are both human-readable and machine-parsable for AI agent consumption, thereby enhancing automation possibilities and developer productivity.

Quick Start & Requirements

Installation of the hf CLI is streamlined via standalone shell scripts: for macOS and Linux, use curl -LsSf https://hf.co/cli/install.sh | bash; for Windows, execute powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex". The Python library is installed via pip: pip install huggingface_hub, with a recommendation for using uv pip install huggingface_hub for enhanced speed and reliability. Optional dependencies for specific modules, such as MCP, can be installed using pip install "huggingface_hub[mcp]". Running jobs on Hugging Face infrastructure may require Python 3.12.

Highlighted Details

  • AI Agent Compatibility: The hf CLI is specifically engineered for AI agents, offering adaptive output formats and an optional hf skills add command for seamless integration with coding assistants like Codex, Cursor, and Claude Code.
  • Integrated Hosting & Versioning: The platform partners with ML libraries to offer free model and dataset hosting. It leverages Xet, a sophisticated chunk-deduplicated storage backend, for robust file versioning capabilities, even when handling very large datasets.
  • Global Download Acceleration: Utilizes Cloudfront, a Content Delivery Network (CDN), to ensure fast, geo-replicated downloads of assets from anywhere in the world.
  • In-Browser Interaction: Provides convenient in-browser widgets that allow users to directly interact with and test uploaded models without local setup.

Maintenance & Community

Contributions, encompassing feature requests, bug reports, documentation improvements, and community support, are actively encouraged through a clearly defined contribution guide. While the README emphasizes broad community involvement and values diverse contributions, specific links to active community channels like Discord or Slack are not provided in this excerpt.

Licensing & Compatibility

The provided README excerpt does not explicitly state the project's license. This omission necessitates further investigation to ascertain its terms, particularly concerning compatibility for commercial use or integration within closed-source projects.

Limitations & Caveats

The README does not detail specific limitations, unsupported platforms, or known bugs. The document's focus remains squarely on outlining the features and usage instructions for the CLI and Python library in their role as interfaces to the Hugging Face Hub.

Health Check
Last Commit

15 hours ago

Responsiveness

Inactive

Pull Requests (30d)
110
Issues (30d)
32
Star History
50 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.