Change8

v0.28.0

Breaking Changes
📦 huggingface-hubView on GitHub →
1 breaking5 features🐛 10 fixes1 deprecations🔧 9 symbols

Summary

This release introduces major updates to the InferenceClient, enabling unified inference across multiple third-party providers using Hugging Face Hub model IDs. Additionally, HfApi has been updated with new repository properties and the deprecated `like` endpoint has been removed.

⚠️ Breaking Changes

  • The `like` endpoint in HfApi has been removed to prevent misuse. To remove existing likes, use the `unlike` endpoint instead.

Migration Steps

  1. If you were using the removed `like` endpoint, switch to using the `unlike` endpoint to remove existing likes.

✨ New Features

  • The `InferenceClient` now supports third-party providers (like Replicate, Together AI, fal-ai) offering a unified interface for inference.
  • Unified model IDs are enforced, always referencing Hugging Face Hub model IDs when using external providers.
  • Added support for using Hugging Face Token for routing calls to third-party providers, enabling billing through the HF account.
  • Added `text-to-video` task support to `InferenceClient`.
  • HfApi now includes new repository properties: `usedStorage` and `resourceGroup`.

🐛 Bug Fixes

  • Fixed an issue where `super_squash_history` revision was not URLencoded.
  • Replaced usage of 'model repo' with 'repo' in docstrings for consistency.
  • Fixed a 404 NOT FOUND issue caused by an endpoint tail slash.
  • Fixed an issue with calling `typing.get_type_hints` on a `ModelHubMixin`.
  • Fixed a typo in the codebase.
  • Updated docstring for rejection reason.
  • Added timeout to `WeakFileLock`.
  • Fixed `CardData.get()` to correctly respect default values when the result is `None`.
  • Fixed `RepoCard.load` when a repo_id that is also a directory path is passed.
  • Fixed an issue causing filename too long errors when downloading to a local folder.

Affected Symbols

⚡ Deprecations

  • The `logit_bias` parameter in `chat_completion()` within `InferenceClient` is now flagged as UNUSED.