huggingface_hub's HfFileSystem now downloads a 2 GB bucket file in seconds

1 week ago

What's new in huggingface_hub 2.1.0 and 2.1.1: faster Xet downloads through HfFileSystem, retries, reruns, rescheduling and open ports for Jobs, a ZeroGPU quota check, tested recipes in the Inference Endpoints catalog, and two deliberate breaking changes for sandboxes and bucket filters. https://github.com/huggingface/huggingface_hub/releases/tag/v2.1.0 https://github.com/huggingface/huggingface_hub/releases/tag/v2.1.1 https://huggingface.co/docs/huggingface_hub/main/en/guides/jobs https://huggingface.co/docs/huggingface_hub/main/en/guides/inference_endpoints

Ask

Ask about this presentation

Answers are generated from this presentation.

Chapters

  1. 0:00HfFileSystem downloads Xet files with hf_xet
  2. 0:11Bucket dataset loads gain the most
  3. 0:2602: Jobs
  4. 0:28Jobs retry on failure
  5. 0:37Rerun a Job from its saved spec
  6. 0:45Reschedule a scheduled Job
  7. 0:53Expose ports on a Job
  8. 1:0203: ZeroGPU quota
  9. 1:04get_zero_gpu_quota
  10. 1:16hf spaces zero-gpu quota
  11. 1:2804: Endpoints catalog
  12. 1:31The catalog lists tested recipes
  13. 1:45Deploy an exact recipe
  14. 1:5505: Stricter defaults
  15. 1:58Pooled sandboxes need scoped credentials
  16. 2:10Bucket patterns are case-sensitive
  17. 2:2206: Fixes
  18. 2:23Fixes
  19. 2:35Command line
  20. 2:46Release notes
Show transcript

HfFileSystem downloads Xet files with hf_xet

010203040506Faster downloads
huggingface/huggingface_hub · release v2.1.0 · PR #4990
Hugging Face

HfFileSystem downloads a 2 GB file in seconds

get_file · 2 GB parquet in a bucket120 s 7 s

HfFileSystem now downloads Xet files through hf_xet, which writes straight to disk. A 2 gigabyte parquet file in a bucket went from two minutes to about seven seconds.

Bucket dataset loads gain the most

huggingface_hub
010203040506Faster downloads
huggingface/huggingface_hub · release v2.1.0 · PR #4990

Loading a dataset from a bucket gets faster

load_dataset("hf://buckets/…") · not streaming130 s 17 s

Non-Xet files, setups without hf_xet, and file-like targets still use plain HTTP.

The biggest winner is the datasets library loading from a bucket without streaming. That went from about 130 seconds to 17. Files that aren't on Xet, or machines without hf_xet, still use plain HTTP.

02: Jobs

huggingface_hub
02
Jobs

Retry, rerun, reschedule, open ports

Jobs got four new controls.

Jobs retry on failure

huggingface_hub
010203040506Jobs
huggingface/huggingface_hub · release v2.1.0 · PR #5025

A Job can retry itself when it fails

Set the number of attempts when you create it, from Python or the hf CLI.

A job can now retry itself when it fails. You set the number of attempts when you create it, from Python or the hf command line.

Rerun a Job from its saved spec

huggingface_hub
010203040506Jobs
huggingface/huggingface_hub · release v2.1.0 · PR #5025

Rerun an old Job from its saved spec

The new Job keeps the original's secrets and hardware settings.

You can also rerun an earlier job. It starts fresh from the old job's saved spec, secrets and hardware settings included.

Reschedule a scheduled Job

huggingface_hub
010203040506Jobs
huggingface/huggingface_hub · release v2.1.0 · PR #5026

Scheduled Jobs can be rescheduled in place

Change the cron expression or preset without recreating the Job.

Scheduled jobs can be rescheduled. You change the cron expression or preset on the existing job, without deleting and recreating it.

Expose ports on a Job

huggingface_hub
010203040506Jobs
huggingface/huggingface_hub · release v2.1.0 · PR #5027

Jobs can expose ports

Token-protectedonly callers with a Hugging Face token get in
Publicunauthenticated access
Any timeat creation or on a Job that is already running

Jobs can also open ports. A port can require a token, or be public. You can open one at launch, or on a job that's already running.

03: ZeroGPU quota

huggingface_hub
03
ZeroGPU quota

How much GPU time is left today

Next, ZeroGPU quota.

get_zero_gpu_quota

huggingface_hub
010203040506ZeroGPU quota
huggingface/huggingface_hub · release v2.1.0 · PR #5040

See how much ZeroGPU time you have left

get_zero_gpu_quota()
remaining · base · resets_at · in GPU-seconds

A new method reports how much ZeroGPU time you have left and when it resets. Apps, MCP servers and agents on ZeroGPU Spaces can warn users before the daily limit.

hf spaces zero-gpu quota

huggingface_hub
010203040506ZeroGPU quota
huggingface/huggingface_hub · release v2.1.0 · PR #5040 · release v2.1.1 · PR #5055

The same numbers in the terminal

hf spaces zero-gpu quota

Renamed in the patch release; the first spelling, zero-gpu-quota, is gone with no alias.

The command line shows the same numbers, and suggests buying credits when less than a tenth is left. The patch release renamed this command, and the first name was removed without an alias.

04: Endpoints catalog

huggingface_hub
04
Endpoints catalog

Tested recipes for Inference Endpoints

The Inference Endpoints catalog moved to a new API.

The catalog lists tested recipes

huggingface_hub
010203040506Endpoints catalog
huggingface/huggingface_hub · release v2.1.0 · PR #4928

The catalog lists each model's tested recipes

A recipe is a hardware and engine pairing.

acceleratorenginelicensetasksearch

The model catalog now returns each model with its tested deployment recipes. A recipe pairs hardware with a serving engine. The server filters by accelerator, engine, license, task or search.

Deploy an exact recipe

huggingface_hub
010203040506Endpoints catalog
huggingface/huggingface_hub · release v2.1.0 · PR #4928

Deploy an exact recipe, or a specific GGUF file

Breaking: the listing returns objects instead of model-name strings, and the CLI prints a table. Both methods are experimental.

You can deploy one exact recipe, or a specific GGUF file. The listing now returns objects instead of model names, and the command line prints a table.

05: Stricter defaults

huggingface_hub
05
Stricter defaults

Sandboxes and bucket filters

Two changes break old behavior on purpose.

Pooled sandboxes need scoped credentials

huggingface_hub
010203040506Stricter defaults
huggingface/huggingface_hub · release v2.1.0 · PRs #4782, #5028

Pooled sandboxes now require scoped credentials

New clients can't reach legacy pool hosts, and old clients can't reach new sandboxes. Upgrade or recycle old hosts.

The client now refuses a pooled sandbox without a valid scoped token, instead of falling back to the host's credential. New clients can't reach older pool hosts, so upgrade or recycle them.

Bucket patterns are case-sensitive

huggingface_hub
010203040506Stricter defaults
huggingface/huggingface_hub · release v2.1.0 · PR #5007

Bucket include and exclude patterns are case-sensitive everywhere

Windows used to ignore case, so one sync command could pick different files on each OS, risky with --delete.

Bucket include and exclude patterns used to ignore case on Windows only. So one sync could pick different files on each system, which is risky when it deletes. Now case always counts.

06: Fixes

huggingface_hub
06
Fixes

Bugs you may have hit

Some fixes.

Fixes

huggingface_hub
010203040506Fixes
huggingface/huggingface_hub · release v2.1.0 · PRs #5001, #5035, #5017

Three bugs that are fixed

copy_files to a bucketa sibling like logs.json no longer passes for a folder named logs
Paginated listingsthe first page is retried too
Card front mattera single tag stays one tag instead of splitting into letters

Copying into a bucket no longer mistakes a similar file name for a folder. Paginated listings retry their first page. And a single model card tag stays one tag.

Command line

huggingface_hub
010203040506Fixes
huggingface/huggingface_hub · release v2.1.0 · PRs #5029, #5044, #5033

The hf CLI catches more mistakes

Listingscontrol characters in names are escaped, so a file name can't rewrite your terminal
hf jobs --secretsa named secret that isn't set locally is an error, not silently dropped
hf auth whoamisuggests hf auth login when you're signed out

Listings escape control characters, so a file name can't rewrite your terminal. A job secret that isn't set locally now raises an error. And who am I tells you how to log in.

Release notes

huggingface_hub
010203040506Fixes
huggingface/huggingface_hub · releases v2.1.0, v2.1.1

Every change is in the release notes

github.com/huggingface/huggingface_hub › Releases › v2.1.0

Guides: huggingface.co/docs/huggingface_hub › Jobs · Inference Endpoints

Every change is in the release notes on GitHub, and the Jobs and Inference Endpoints guides cover the new options.