v1.0.0
Breaking Changes📦 huggingface-hubView on GitHub →
⚠ 3 breaking✨ 8 features🐛 2 fixes🔧 8 symbols
Summary
Hugging Face Hub library v1.0 introduces a major migration to use httpx for HTTP requests, dropping requests/aiohttp dependencies, and completely revamps the CLI experience, replacing `huggingface-cli` with the new `hf` command.
⚠️ Breaking Changes
- The `huggingface-cli` command has been completely removed and replaced by the `hf` command.
- The `requests` and `aiohttp` dependencies have been dropped due to the migration to `httpx` for HTTP requests.
- The `[cli]` extra for installation has been removed; the CLI is now included with the core `huggingface_hub` package.
Migration Steps
- Replace all invocations of `huggingface-cli` with the new `hf` command.
- If you were relying on `requests` or `aiohttp` directly via internal library functions, update your code to use the returned `httpx.Client` or `httpx.Response` objects.
- If you used cache scanning commands, migrate from `hf scan cache`/`hf scan delete` to `hf cache ls`, `hf cache rm`, or `hf cache prune`.
- If you installed the CLI via the `[cli]` extra, you no longer need it; install the core package.
- Use the provided cross-platform installers for setting up the standalone CLI environment if desired.
✨ New Features
- The library now uses `httpx` for all HTTP requests, supporting synchronous and asynchronous operations uniformly.
- Added `get_async_client` utility for asynchronous HTTP client access.
- The CLI has been completely revamped using Typer, introducing a new `hf` command structure.
- The `hf download` command now supports a `--dry-run` mode to preview downloads.
- The CLI now provides intelligent shell auto-completion.
- The CLI performs background checks for updates every 24 hours and notifies the user.
- The cache management CLI has been revamped: `hf scan cache` and `hf scan delete` are removed in favor of `hf cache ls` (with rich filtering), `hf cache rm`, and `hf cache prune`.
- New cross-platform installers (shell scripts for macOS/Linux, PowerShell for Windows) are available for zero-friction CLI setup.
🐛 Bug Fixes
- Fixed async client hook issues.
- Fixed `hf_raise_for_status` behavior on async streams.