pypi huggingface-hub 2.6.0
[v2.6.0] Manage resource groups, check billing credits, deploy endpoints by region

one hour ago

🖥️ Manage resource groups from the CLI

Resource groups let organizations control which members can access a given set of repos, collections and blog posts. Until now they could only be managed from the Hub settings page; this release brings them to the CLI and the Python API. hf resource-groups assign and unassign move an item (a repo, a collection or a blog post) in and out of a group, while ls, info, create, update and delete manage the groups themselves, including members, auto-join roles and per-type spend limits. On the Python side, the new list_resource_group*, get_resource_group and create/update/delete_resource_group methods return a ResourceGroup dataclass. Note that resource groups are a paid feature, available to organizations on the Team & Enterprise plans.

>>> hf resource-groups create research --org my-org --user alice:admin --repo datasets/my-org/d --auto-join read
✓ Resource group created
  id: 66980ecfc1e12a49c8f0e42d

>>> hf resource-groups assign 66980ecfc1e12a49c8f0e42d my-org/my-model
>>> hf resource-groups update 66980ecfc1e12a49c8f0e42d --org my-org --spend-limit total=50000 --no-spend-limit jobs
  • [CLI] Add hf resource-groups ls|info|create|update|delete by @Wauplin in #5439
  • [CLI] Add hf resource-groups assign|unassign by @julien-c in #5431

📚 Documentation: CLI guide

💳 Check and buy credits from the CLI

A new top-level hf billing command group exposes the Hub credits API. hf billing credits info shows the balance of your account or an organization, broken down by credit type, and hf billing credits purchase-link AMOUNT_USD generates a link to purchase credits — nothing is charged, and the same link is emailed to the token owner. Pass --wait to poll the balance (every 10s, up to 15 minutes) until the purchase is reflected, which makes the command usable from scripts and agents. The same features are available in Python with HfApi.get_credits() and HfApi.create_credits_purchase_link(), returning the new CreditsInfo, CreditBalance and CreditsPurchaseLink dataclasses.

$ hf billing credits info
✓ Credits
  balance_usd: 2
  billing_mode: prepaid
TYPE     NAME                           BALANCE_USD EXPIRES_AT
-------- ------------------------------ ----------- ----------
included PRO Included Credits (monthly)           2 2026-12-01
Hint: Use `hf billing credits purchase-link 50` to ask for a $50 credits purchase.
  • [Billing] Add credits API and hf billing credits CLI by @Wauplin in #5428

🌍 Simpler region selection for Inference Endpoints

Deploying an Inference Endpoint no longer requires picking a cloud vendor and a cloud region. create_inference_endpoint and hf endpoints deploy now only need --accelerator, --instance-type and --instance-size, plus an optional region ("us" or "eu", like repos): the platform picks a cloud provider and cloud region there that offers the instance, or anywhere when region is not set. update_inference_endpoint, InferenceEndpoint.update and hf endpoints update take region to move an endpoint, and hf endpoints hardware lists each instance with its availability per region instead of one row per vendor/cloud-region.

⚠️ Two things to know when upgrading: passing vendor is deprecated (a FutureWarning — vendor with a cloud region still pins the endpoint there, while vendor without one raises a ValueError), and region without vendor now means a region (us/eu), not a cloud region. InferenceEndpointHardware loses vendor, region and status and gains regions (region → status), deprecated and reserved.

>>> hf endpoints deploy my-endpoint --repo gpt2 --framework pytorch \
      --accelerator cpu --region eu \
      --instance-size x2 --instance-type intel-icl
  • [Endpoints] Create Inference Endpoints and list hardware by instance and optional region by @co42 in #5515

📚 Documentation: Inference Endpoints guide

📊 Jobs: fail fast when hardware is busy

Jobs that wait for hardware can now be given a deadline: scheduling_timeout (and --scheduling-timeout on the CLI) fails a Job still scheduling after that time instead of letting it wait forever. It takes the same duration format as timeout (from 5 seconds to 1 day) and is available on run_job, run_uv_job, create_scheduled_job, create_scheduled_uv_job and their CLI equivalents. Picking hardware is also easier: hf jobs hardware (and the new JobHardwareInfo.availability field) reports each flavor as available, low or not_available right now, in a new AVAILABILITY column.

This release also makes Jobs more robust: hf jobs stats filters running jobs server-side instead of paginating through your whole job history (from timing out past 15s down to ~2s on large accounts), wait_for_job and wait_for_space retry transient network and HTTP errors with backoff instead of aborting the wait, and the jobs-artifacts bucket notice is logged to stderr so stdout stays machine-readable.

>>> hf jobs run --flavor h200 --scheduling-timeout 30m python:3.12 python train.py
  • [Jobs] Add scheduling_timeout to fail Jobs waiting too long for hardware by @Wauplin in #5516
  • [Jobs] Show hardware availability in hf jobs hardware by @Wauplin in #5517
  • [Jobs] Retry transient errors in wait_for_job and wait_for_space by @davanstrien in #5490
  • [Jobs] Filter running jobs server-side in hf jobs stats by @davanstrien in #5462
  • [Jobs] Log jobs-artifacts bucket notice instead of printing to stdout by @davanstrien in #5461

📚 Documentation: Jobs guide

🛡️ Safer downloads

Two download-path hardenings. First, the commit hash and ETag returned by the server are used as file and folder names in the cache, so a broken or malicious HF_ENDPOINT could make the library write outside the cache folder: values that contain anything other than alphanumeric characters, - or _ are now rejected up front. No change for huggingface.co users. Second, redirects are no longer followed when the response already carries the file metadata, which fixes LocalEntryNotFoundError: ... is missing the 'X-Repo-Commit' header when downloading some LFS files through the Hub's S3 proxy.

  • [Download] Reject unsafe commit hash and etag returned by the server by @Wauplin in #5403
  • [Download] Do not follow a /resolve redirect that already carries the file metadata by @XciD in #5484

🔑 Log in again, inspect your token

Like gh auth login, running hf auth login while already logged in now starts a new login instead of asking for --force: the new token is saved alongside the existing ones and becomes the active one, with a hint on how to switch back (hf auth switch) or delete the previous one. --force is still accepted as a hidden no-op so existing scripts keep working. For debugging permissions, hf auth whoami --raw prints the raw whoami response from the Hub as JSON, including the token's role and fine-grained permissions, while the default output and --format json are unchanged.

>>> hf auth login
You are already logged in with token `my-token`. Logging in again saves one more
token and makes it the active one, without deleting the previous one.
>>> hf auth whoami --raw
{
  "type": "user",
  "name": "Wauplin",
  ...
  "auth": {"type": "access_token", "accessToken": {"displayName": "my-token", "role": "fineGrained", ...}}
}
  • [CLI] hf auth login logs in again when already logged in by @Wauplin in #5521
  • [CLI] Add hf auth whoami --raw by @Wauplin in #5505

📚 Documentation: CLI guide

💔 Breaking Changes

  • [Endpoints] Create Inference Endpoints and list hardware by instance and optional region by @co42 in #5515 — vendor is deprecated in create_inference_endpoint and hf endpoints deploy (a FutureWarning): passed with a cloud region (e.g. us-east-1) it still pins the endpoint there, but vendor without a cloud region now raises a ValueError. region without vendor now means a region (us or eu), not a cloud region. list_inference_endpoints_hardware and hf endpoints hardware return one entry per instance instead of one per vendor/cloud-region: InferenceEndpointHardware loses vendor, region and status and gains regions (region → status), deprecated and reserved, its id drops the vendor and cloud region prefix (nvidia-l4-x1 instead of aws-us-east-1-nvidia-l4-x1), and hf endpoints hardware --vendor is removed (--region now takes us or eu).
  • [Inference Providers] Remove retired providers, route chat through the router by @hanouticelina in #5429 — the baseten, cerebras, cohere, featherless-ai, fireworks-ai, groq, novita, nscale, ovhcloud, publicai, scaleway, together and zai-org helpers are removed: these providers are no longer available on Inference Providers, and calling one directly with its own API key is no longer supported. Remaining helpers are hf-inference, fal-ai, replicate, wavespeed and openai. deepinfra stays for non-chat tasks only (automatic-speech-recognition, feature-extraction, text-to-speech): its chat helpers are removed and chat with provider="deepinfra" goes through the Hugging Face router like the other providers, with the model pinned as model:provider (e.g. moonshotai/Kimi-K3.1-Pro:deepinfra). Chat with any other provider also goes through the router, and provider accepts any string for chat.

🤖 Inference

  • [Endpoints] Show recipe label and default instance in hf endpoints catalog ls by @Wauplin in #5491 — recipes of the same model (which could only be told apart by their id) now show a human-readable LABEL and their DEFAULT_INSTANCE in hf endpoints catalog ls, matching the new optional label and default_instance fields on InferenceCatalogRecipe.

🔧 Other QoL Improvements

  • [Xet] Pass the telemetry opt-out to hf_xet and require hf-xet>=1.8.0 by @rajatarya in #5496 — Xet uploads and downloads now receive huggingface_hub's telemetry opt-out (including opt-outs set in code, not only through the environment), so HF_HUB_DISABLE_TELEMETRY, DISABLE_TELEMETRY, DO_NOT_TRACK and offline mode also silence hf_xet's transfer performance reports. The minimum hf-xet version is bumped from 1.6.0 to 1.8.0. — docs

🖥️ CLI

📖 Documentation

  • [Docs] Fix runnable examples in English Hub guides by @Wauplin in #5297
  • [Docs] Clarify switching between saved Hub tokens by @aahanaahir22 in #5482
  • [Docs] Discourage static-analysis-only issues and PRs by @Wauplin in #5495
  • [Docs] Fix failing examples in the cache guide and HfApi docstrings by @AlexxRussell in #5498
  • [Docs] Fix failing examples in the collections guide and docstrings by @AlexxRussell in #5504
  • [Docs] Fix example outputs for access requests and create_repo by @AlexxRussell in #5529

🐛 Bug and typo fixes

  • [Cache] Fix concurrent downloads without symlinks by @Wauplin in #5354 — with symlinks disabled, concurrent downloads of the same file could download it twice and hand readers a truncated snapshot file.
  • [CLI] Fix load_uv_script crash on long non-file arguments by @shashank11yadav in #5447
  • [Buckets] Keep the remote mtime when syncing downloads by @sarankumar1325 in #5449 — downloaded files no longer look newer than the remote, avoiding a full re-upload on the next push.
  • [Download] Don't retain caller frames in resolve_revision when the Hub is unreachable by @Wauplin in #5458
  • [CLI] Fix hf papers ls --date today failing east of UTC by @ShaanGS in #5466
  • [Cache] Ignore legacy version.txt marker in scan_cache_dir by @inteist in #5468
  • [Utils] Fix http_stream_backoff exception propagation after yield by @RealAdii in #5470
  • [CLI] Show missing files when the cached snapshot is incomplete by @Harp404 in #5473
  • [Utils] Don't log a lock wait once the lock timeout is reached by @ShaanGS in #5492
  • [Cache] Use extended path for the temp snapshot copy on Windows by @Wauplin in #5494
  • Fix sync_bucket(quiet=True) re-enabling disabled progress bars by @m3lonxd in #5507
  • Fix hf cache rm reporting success when files cannot be deleted by @gouravroy27 in #5509
  • [Upload] Don't mutate caller's ignore_patterns in upload_folder by @Wauplin in #5514

🏗️ Internal

  • Bump the actions group across 1 directory with 7 updates by @dependabot[bot] in #5376
  • Post-release: bump version to 2.6.0.dev0 by @huggingface-hub-bot[bot] in #5448
  • [Tests] Submit OAuth consent form in test_oauth_workflow when no grant is stored by @Wauplin in #5450
  • [Docs] Regenerate CLI reference for hf auth revoke (fix Python quality on main) by @Wauplin in #5454
  • [Cache] Fix test_repo_with_no_snapshots flaking on Python 3.12 by @mokashang in #5488
  • [Tests] Fix flaky test_scan_cache_last_modified_and_last_accessed by @Wauplin in #5493
  • Bump the actions group with 5 updates by @dependabot[bot] in #5518

Don't miss a new huggingface-hub release

NewReleases is sending notifications on new releases.