TL;DR:经过五年的开发,huggingface_hub 已达到 v1.0 版本。这一里程碑标志着该库作为 Python 包的成熟,它支撑着 20,000 个依赖库,并为访问超过 200 万个公共模型、50 万个公共数据集和 100 万个公共 Spaces 提供核心功能。本次发布引入了旨在支持未来十年开放机器学习的破坏性变更(breaking changes),由近 300 名贡献者和数百万用户组成的全球社区共同推动。
TL;DR: After five years of development, huggingface_hub has reached v1.0 - a milestone that marks the library's maturity as the Python package powering 200,000 dependent libraries and providing core functionality for accessing over 2 million public models, 0.5 million public datasets, and 1 million public Spaces. This release introduces breaking changes designed to support the next decade of open machine learning, driven by a global community of almost 300 contributors and millions of users.
TL;DR: 经过五年的开发,huggingface_hub 已发布 v1.0 版本——这一里程碑标志着该库作为 Python 包的成熟度。它支撑着 20,000 个依赖库,并为访问超过 200 万个公共模型、50 万个公共数据集和 100 万个公共 Spaces 提供核心功能。本次发布引入了一系列破坏性变更,旨在支持开放机器学习未来十年的发展,这些变更由近 300 名贡献者和数百万用户组成的全球社区共同推动。🚀 我们强烈建议升级到 v1.0,以享受显著的性能提升和新功能。本次发布的主要变更包括:后端库迁移至 httpx;完全重新设计的 hf CLI(取代已弃用的 huggingface-cli),采用基于 Typer 的界面并大幅扩展了功能集;以及全面采用 hf_xet 进行文件传输,取代旧版的 hf_transfer。完整发布说明可在此处查阅。 我们努力确保 huggingface_hub v1.0.0 保持向后兼容性。实际上,大多数机器学习库应能无缝兼容 v0.x 和 v1.x 版本。主要例外是 transformers,其 v4 版本明确要求使用 huggingface_hub v0.x,而即将发布的 v5 版本则要求使用 v1.x。有关各库的详细兼容性概览,请参阅此 issue 中的表格。 每个主要库都有其发展历程。对于 huggingface_hub 而言,这一切始于一个简单的想法:如果共享机器学习模型能像在 GitHub 上共享代码一样简单,会怎样?这不仅仅是一项技术改进,更是一种哲学转变。我们不再是为 transformers 构建 Git 封装器,而是在为机器学习工件构建专用基础设施,从而赋能整个 ML 生态系统中的任何库。 衡量一个开源库的增长和影响是一项棘手的任务。数字本身讲述着一个故事:值得注意的是,大多数第三方集成都是自发产生的,我们并未参与其中。Hugging Face Hub 以无数方式赋能 ML 社区,但我们仍对其应用范围之广和使用程度之深感到谦卑。 Version 1.0 不仅仅是为了达到一个里程碑,更是为了奠定开放机器学习未来十年的基础。我们所做的破坏性变更并非随意之举,而是战略性决策,旨在让 huggingface_hub 能够随着 AI 的爆发式增长而扩展,同时保持数百万开发者所依赖的可靠性。 v1.0 中最重大的架构变更是从 requests 迁移到 httpx。这并非简单的依赖更替,而是一次根本性的升级,使该库迈入现代 HTTP 时代。为何选择 httpx?其优势显著:原生支持 HTTP/2 以提升连接效率,具备真正的线程安全性以实现跨多线程的安全连接复用。最重要的是,httpx 为同步和异步操作提供了统一的 API,消除了我们同步与异步推理客户端之间存在的细微行为差异。此次迁移设计得尽可能透明,大多数用户无需更改任何内容。对于拥有自定义 HTTP 后端的用户,我们提供了从 configure_http_backend() 到 set_client_factory() 和 set_async_client_factory() 的清晰迁移路径。此外,hf_xet 现已成为上传和下载 Hub 文件的默认包,取代了此前可选的 hf_transfer,后者已被完全移除。 Version 0.32.0 引入了 Model Context Protocol (MCP) 集成和 tiny-agents,从根本上改变了开发者构建 AI 代理的方式。过去需要复杂框架集成的工作,现在仅需约 70 行 Python 代码即可完成。CLI 已从简单的命令行工具演变为用于 ML 操作的全面接口。精简后的 hf 命令取代了旧版的 huggingface-cli,采用了现代化的“资源-动作”模式:凭借自动补全支持和跨平台安装程序,CLI 如今感觉如同任何现代开发者工具一样精致。 这些变更并非轻率做出。大多数弃用项都提前数月宣布,并附有清晰的警告和迁移指南。结果是代码库更加整洁、易于维护,从而能够专注于前瞻性功能,而非支持已弃用的模式。 我们理解破坏性变更具有干扰性。因此,我们投入了大量精力以使迁移过程尽可能顺畅。我们的综合迁移指南为每一项变更提供了逐步说明,并解释了每项变更的必要性。 我们再次强调,我们努力确保 huggingface_hub v1.0.0 保持向后兼容性。实际上,大多数 ML 库应能无缝兼容 v0.x 和 v1.x 版本。主要例外是 transformers,其 v4 版本明确要求使用 huggingface_hub v0.x,而即将发布的 v5 版本则要求使用 v1.x。有关各库的详细兼容性概览,请参阅此 issue 中的表格。 我们也深深感谢整个 Hugging Face 社区提供的反馈、错误报告和建议,这些塑造了这个库。最后,衷心感谢我们的用户——从个人开发者到大型企业——信任 huggingface_hub 来支持您的工作流程。你们的支持驱动着我们不断改进和创新。请在 GitHub 上为我们点亮 ⭐ 以示支持,帮助我们继续构建开放机器学习的基础。五年过去了,但这仅仅是开始!
TL;DR: After five years of development, huggingface_hub has reached v1.0 - a milestone that marks the library's maturity as the Python package powering 200,000 dependent libraries and providing core functionality for accessing over 2 million public models, 0.5 million public datasets, and 1 million public Spaces. This release introduces breaking changes designed to support the next decade of open machine learning, driven by a global community of almost 300 contributors and millions of users. 🚀 We highly recommend upgrading to v1.0 to benefit from major performance improvements and new capabilities. Major changes in this release include the migration to httpx as the backend library, a completely redesigned hf CLI (which replaces the deprecated huggingface-cli) featuring a Typer-based interface with a significantly expanded feature set, and full adoption of hf_xet for file transfers, replacing the legacy hf_transfer. You can find the full release notes here. We’ve worked hard to ensure that huggingface_hub v1.0.0 remains backward compatible. In practice, most ML libraries should work seamlessly with both v0.x and v1.x versions. The main exception is transformers, which explicitly requires huggingface_hub v0.x in its v4 releases and v1.x in its upcoming v5 release. For a detailed compatibility overview across libraries, refer to the table in this issue. Every major library has a story. For huggingface_hub, it began with a simple idea: what if sharing machine learning models could be as easy as sharing code on GitHub? This wasn't just a technical improvement. It was a philosophical shift. We were no longer building a Git wrapper for transformers; we were building purpose-built infrastructure for machine learning artifacts that could power any library in the ML ecosystem. Measuring the growth and impact of an open-source library is a tricky task. Numbers tell a story of their own: The remarkable part? Most of the third-party integrations happened organically, and we played no role in them. The Hugging Face Hub empowers the ML community in countless ways, yet we're continually humbled by how far it has gone and how widely it's used. Version 1.0 isn't just about reaching a milestone. It's about building the foundation for the next decade of open machine learning. The breaking changes we've made aren't arbitrary; they're strategic decisions that position huggingface_hub to scale with the explosive growth of AI while maintaining the reliability that millions of developers depend on. The most significant architectural change in v1.0 is our migration from requests to httpx. This isn't just dependency churn. It's a fundamental upgrade that brings the library into the modern era of HTTP. Why httpx? The benefits are substantial: native HTTP/2 support for better connection efficiency and true thread safety that enables safe connection reuse across multiple threads. Most importantly, httpx provides a unified API for both synchronous and asynchronous operations, eliminating the subtle behavioral differences that existed between our sync and async inference clients. The migration was designed to be as transparent as possible. Most users won't need to change anything. For those with custom HTTP backends, we've provided clear migration paths from configure_http_backend() to set_client_factory() and set_async_client_factory(). Additionally, hf_xet is now the default package for uploading and downloading files to and from the Hub, replacing the previously optional hf_transfer, which has now been fully removed. Version 0.32.0 introduced Model Context Protocol (MCP) integration and tiny-agents, fundamentally changing how developers build AI agents. What once required complex framework integration now takes approximately 70 lines of Python. The CLI has evolved from a simple command-line tool into a comprehensive interface for ML operations. The streamlined hf command replaces the legacy huggingface-cli with a modern resource-action pattern: With autocompletion support and an installer that works across platforms, the CLI now feels as polished as any modern developer tool. These changes weren't made lightly. Most deprecations were announced months in advance with clear warnings and migration guidance. The result is a cleaner, more maintainable codebase that can focus on forward-looking features rather than supporting deprecated patterns. We understand that breaking changes are disruptive. That's why we've invested heavily in making the migration as smooth as possible. Our comprehensive migration guide provides step-by-step instructions for every change with explanations of why each change was necessary. We’ve worked hard to ensure that huggingface_hub v1.0.0 remains backward compatible. In practice, most ML libraries should work seamlessly with both v0.x and v1.x versions. The main exception is transformers, which explicitly requires huggingface_hub v0.x in its v4 releases and v1.x in its upcoming v5 release. For a detailed compatibility overview across libraries, refer to the table in this issue. We’re also deeply grateful to the entire Hugging Face community for their feedback, bug reports, and suggestions that have shaped this library. Finally, a huge thank you to our users -from individual developers to large enterprises- for trusting huggingface_hub to power your workflows. Your support drives us to keep improving and innovating. Please star us on GitHub ⭐ to show your support and help us continue building the foundation of open machine learning. It has been five years, but it is still only the beginning!