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

1 month 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 about 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
  1. 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.

    Slide text
    01 02 03 04 05 06 Faster 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 bucket 120 s 7 s
  2. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Faster downloads
    huggingface/huggingface_hub · release v2.1.0 · PR #4990

    Loading a dataset from a bucket gets faster

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

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

  3. Jobs got four new controls.

    Slide text
    huggingface_hub
    02
    Jobs

    Retry, rerun, reschedule, open ports

  4. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Jobs
    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.

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

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Jobs
    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.

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

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Jobs
    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.

  7. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Jobs
    huggingface/huggingface_hub · release v2.1.0 · PR #5027

    Jobs can expose ports

    Token-protected only callers with a Hugging Face token get in
    Public unauthenticated access
    Any time at creation or on a Job that is already running
  8. Next, ZeroGPU quota.

    Slide text
    huggingface_hub
    03
    ZeroGPU quota

    How much GPU time is left today

  9. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 ZeroGPU 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
  10. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 ZeroGPU 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.

  11. The Inference Endpoints catalog moved to a new API.

    Slide text
    huggingface_hub
    04
    Endpoints catalog

    Tested recipes for Inference Endpoints

  12. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Endpoints 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.

    accelerator engine license task search
  13. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Endpoints 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.

  14. Two changes break old behavior on purpose.

    Slide text
    huggingface_hub
    05
    Stricter defaults

    Sandboxes and bucket filters

  15. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Stricter 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.

  16. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Stricter 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.

  17. Some fixes.

    Slide text
    huggingface_hub
    06
    Fixes

    Bugs you may have hit

  18. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Fixes
    huggingface/huggingface_hub · release v2.1.0 · PRs #5001, #5035, #5017

    Three bugs that are fixed

    copy_files to a bucket a sibling like logs.json no longer passes for a folder named logs
    Paginated listings the first page is retried too
    Card front matter a single tag stays one tag instead of splitting into letters
  19. 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.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Fixes
    huggingface/huggingface_hub · release v2.1.0 · PRs #5029, #5044, #5033

    The hf CLI catches more mistakes

    Listings control characters in names are escaped, so a file name can't rewrite your terminal
    hf jobs --secrets a named secret that isn't set locally is an error, not silently dropped
    hf auth whoami suggests hf auth login when you're signed out
  20. Every change is in the release notes on GitHub, and the Jobs and Inference Endpoints guides cover the new options.

    Slide text
    huggingface_hub
    01 02 03 04 05 06 Fixes
    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

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York