47 model prices
  1. Home
  2. Releases
  3. huggingface_hub
  4. 1.31.0

huggingface_hub 1.31.0 release notes

huggingface_hub 1.31.0 was released on September 10, 2026. The latest version is 2.5.0.

v1.31.0 ยท ยท 22 listed changes

Release notes

๐Ÿท๏ธ Custom labels for Sandboxes

Dedicated sandboxes now accept custom labels, attached to the underlying Job. This is useful for cost attribution, bookkeeping, or finding and reconnecting to the sandboxes created by a given controller run. Labels use the same -l / --label KEY=VALUE syntax as hf jobs run. They are merged with the labels the SDK uses internally, and invalid or reserved labels are rejected before a billable Job is started. Pool-based sandboxes are unchanged: custom labels are only accepted for dedicated sandboxes.

>>> from huggingface_hub import Sandbox
>>> sandbox = Sandbox.create(image="python:3.12", labels={"controller-run": "run-42"})
hf sandbox create --label controller-run=run-42 --label team=data-infra

๐Ÿ“ฅ More resilient downloads

A batch of fixes makes downloads more robust to unusual server responses, network hiccups and concurrent usage:

๐Ÿ”Œ httpx re-exported for library integrators

huggingface_hub now re-exports the HTTP library it uses as huggingface_hub.utils.httpx. Libraries built on top of huggingface_hub that need httpx types or exceptions (typically to catch errors) should import it from there rather than importing httpx directly. v1.x is built on httpx, and v2.x will move to its successor httpx2, so importing through huggingface_hub.utils keeps your code compatible with both. This is only for types and exceptions: to make requests to the Hub, keep using get_session().

from huggingface_hub.utils import httpx

try:
    ...
except httpx.HTTPError:
    ...

๐Ÿ“š Documentation: Utilities โ€” The httpx module

๐Ÿ”’ Security

HfFileSystem.get() now validates remote filenames before writing anything locally. A server-side filename such as folder/..\..\outside.txt could previously escape the destination directory on Windows during a recursive download. The same check already protected hf_hub_download, snapshot_download and bucket sync. Unsafe filenames now raise ValueError on all platforms, including when downloading to an explicitly named file or a file object.

๐Ÿ–ฅ๏ธ CLI

๐Ÿ› Bug and typo fixes

๐Ÿ“– Documentation

๐Ÿ—๏ธ Internal

Source: GitHub release v1.31.0

Newer: 1.32.0Older: 1.30.0huggingface_hub