releases.shpreview

Hub

Python client for the Hugging Face Hub API

Mon
Wed
Fri
JunJulAugSepOctNovDecJanFebMarAprMayJun
Less
More
Releases21Avg Interval5dAvg Cadence6/mo

Trusted Publishers enable keyless CI/CD auth

โ†—This release3 featuresNew capabilities4 enhancementsImprovements to existing features3 fixesBug fixesAI-tallied from the release notes
v1.19.0

๐Ÿ” Keyless CI/CD auth via OIDC token exchange

CI workflows can now authenticate to the Hub without storing an HF_TOKEN secret, using Trusted Publishers. Set HF_OIDC_RESOURCE to the repo (or username) you want to scope the token to, and huggingface_hub performs the OIDC exchange under the hood โ€” no token, no setup code. GitHub Actions is supported out of the box (with permissions: id-token: write), and other providers can pass a pre-minted ID token via HF_OIDC_ID_TOKEN. Exchanged tokens are short-lived (1 hour), repo-scoped, and cached locally with automatic refresh.

# Publish a model without storing any HF_TOKEN secret
- name: Push the model
  env:
    HF_OIDC_RESOURCE: acme/awesome-model
  run: hf upload acme/awesome-model ./model .
  • [Auth] Keyless CI/CD auth via OIDC token exchange by @hanouticelina in #4326

๐Ÿ“š Documentation: Trusted Publishers

๐Ÿ–ฅ๏ธ hf:// URIs for upload and download

hf upload and hf download now accept an hf:// URI in place of the positional repo ID. The URI encodes repo type, revision, and file path in a single string following the grammar hf://[<TYPE>/]<ID>[@<REVISION>][/<PATH>], so you no longer need separate --repo-type and --revision flags. When a URI is provided, it is the single source of truth โ€” passing --repo-type or --revision on top of it raises an error, and a path in the URI cannot be combined with positional filenames (download) or path_in_repo (upload).

# Download a single file from a dataset at a given revision
hf download hf://datasets/HuggingFaceM4/FineVision@refs/pr/1/data/train.parquet

# Download an entire repo
hf download hf://datasets/google/fleurs

# Upload a file to a dataset on a specific branch
hf upload hf://datasets/Wauplin/my-cool-dataset@my-branch/data/train.csv ./train.csv
  • [CLI] Support hf:// URIs in hf upload and hf download by @Wauplin in #4297

๐Ÿ“š Documentation: CLI guide โ€” hf:// URIs ยท Download guide ยท Upload guide

๐Ÿš€ Expose job ports through the jobs proxy

Jobs can now expose container ports through the public jobs proxy using --expose <port> (CLI) or expose=[8000] (Python API). Each exposed port is reachable at https://<job_id>--<port>.hf.jobs and requires an HF token with read access to the job's namespace. This works on hf jobs run, hf jobs uv run, and their scheduled variants. Job responses now surface expose_urls on JobStatus.

# Expose a web server running on port 8000
> hf jobs run --expose 8000 python:3.12 python -m http.server 8000
โœ“ Job started
  id: 6a2aa7cec4f53f9fc5aa4cff
  url: https://huggingface.co/jobs/Wauplin/6a2aa7cec4f53f9fc5aa4cff
Hint: Exposed ports are reachable at (requires an HF token with read access to the job):
  https://6a2aa7cec4f53f9fc5aa4cff--8000.hf.jobs
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
from huggingface_hub import run_job
run_job(image="python:3.12", command=["python", "-m", "http.server", "8000"], expose=[8000])
  • [Jobs] Add --expose <port> option to expose job ports through the jobs proxy by @XciD in #4316

๐Ÿ“š Documentation: Jobs guide

๐Ÿ–ฅ๏ธ CLI

  • [CLI] Suppress hints in quiet output mode by @davanstrien in #4310
  • [CLI] Agent-friendly hints + examples for hf jobs by @davanstrien in #4308
  • [CLI] Accept web URLs in bucket CLI commands by @Wauplin in #4315

โšก XetSession API migration

All Xet upload and download code has been migrated from the old function-based hf_xet API to the new session-based XetSession API (hf-xet >= 1.5.0). A global singleton get_xet_session() provides fork-safe, thread-safe, and SIGINT-safe session reuse across all call sites โ€” repo commits, hf_hub_download, bucket uploads/downloads, and snapshot_download all share the same underlying Tokio runtime. Token refresh is now handled through a centralized xet_connection_info_refresh_url() builder, and progress reporting follows the new (group_report, item_reports) contract.

  • Use the new XetSession API by @seanses in #4116

๐Ÿ”ง Other QoL Improvements

  • [Auth] Take google colab token from env first by @Wauplin in #4323 โ€” get_token() now checks HF_TOKEN/HUGGING_FACE_HUB_TOKEN and the on-disk token file before the Colab secrets vault, so an explicit login() or env variable always wins over the notebook's stored secret.
  • [Agent] Dynamic agent harness registry by @Wauplin in #4325 โ€” Agent harness detection now fetches the registry from GET /api/agent-harnesses instead of using a hardcoded list, with a 24-hour on-disk cache and in-process caching for hot paths.

๐Ÿ› Bug and typo fixes

  • [Fix] Remove private _MISSING_TYPE import from dataclasses module by @xsuchy in #4322 โ€” fixes ImportError on Python 3.15 where dataclasses._MISSING_TYPE was removed upstream.
  • Fix ignored-pattern warning grammar in download CLI by @wunianze666-netizen in #4337 โ€” corrects "have being" to "have been" in hf download warning output.
  • [fix] Transient location error due to CDN by @Wauplin in #4339 โ€” fixes flaky test_get_hf_file_metadata_from_a_lfs_file by accepting cdn.hf.co in addition to xethub.hf.co in the redirect URL check.

๐Ÿ—๏ธ Internal

  • Post-release: bump version to 1.19.0.dev0 by @huggingface-hub-bot[bot] in #4313
  • [CI] Run tests on internal workers by @Wauplin in #4321
  • [Tests] Add xet/no_xet pytest markers to filter Xet vs non-Xet tests by @Wauplin in #4336
  • Bump the actions group with 6 updates by @dependabot[bot] in #4332
  • chore: update release.yml by @hf-security-analysis[bot] in #4334
  • [CI] Remove .github/workflows/python-prerelease.yml by @Wauplin in #4335

Unified hf cp command; concurrent downloads now safe on broken file locks

โ†—This release3 featuresNew capabilities1 enhancementImprovements to existing features4 fixesBug fixesAI-tallied from the release notes
v1.18.0

๐Ÿ–ฅ๏ธ Unified hf cp command

A single hf cp command now handles all file-copy workflows (upload a local file, download from the Hub, or copy between two remote locations) with consistent hf:// URI syntax for both repositories and buckets. It is also available as hf repos cp and hf buckets cp; all three aliases are identical, so you can use whichever reads best for your workflow. You can stream from stdin (-) or to stdout (-), and a trailing / on the source path gives you rsync-style semantics (copy the folder contents, not the folder itself). Note that remote-to-remote copies only work within the same storage region, and bucket-to-repo is not yet supported.

# Upload a local file to a repo
hf cp ./model.safetensors hf://username/my-model/model.safetensors

# Download a file to stdout
hf cp hf://username/my-model/config.json - | jq .

# Copy between two Hub repos
hf cp hf://username/source-model/config.json hf://username/dest-model/config.json

๐Ÿ“š Documentation: CLI guide โ€” Copy files

  • [CLI] Add unified hf cp command (aliased as hf repos cp and hf buckets cp) by @Wauplin in #4295

๐Ÿฅš Easter egg:explore your storage usage

<img width="2282" height="832" alt="image" src="https://github.com/user-attachments/assets/fa4047b2-c62e-4e92-b556-ae18db8c98a8" />
  • [CLI] Easter egg: city skyline in hf repos ls by @Wauplin in #4287

๐Ÿ”— Paste web URLs directly

parse_hf_uri now accepts Hugging Face web URLs so you can paste a link straight into the CLI or the library and it "just works".

# Copy-paste a URL from the website
hf cp https://huggingface.co/nvidia/LocateAnything-3B/blob/main/config.json - | jq '.architectures'

๐Ÿ“š Documentation: HF URIs โ€” Web URLs

  • [URIs] Parse web URLs in parse_hf_uri + add HfUri.to_url by @Wauplin in #4296

๐Ÿšจ Breaking change

On Lustre, GPFS, and some NFS mounts, flock(2) silently succeeds for every caller, which means filelock provides no mutual exclusion. When multiple hf_hub_download calls race for the same file, they can append to the same .incomplete file and silently corrupt the blob cache. This release fixes that by always downloading to a fresh temporary file instead of resuming an incomplete one, making the download path safe even when file locking is broken. filelock is still used as a "best-effort" hint to avoid unnecessary duplicate downloads, but correctness no longer depends on it. This is a breaking change: resuming a previously failed partial download is no longer possible. However, file resumability was already a niche use case only applicable when hf_xet is disabled.

  • [Fix] Make concurrent downloads safe even when file locking is broken by @Wauplin in #4306

๐Ÿ–ฅ๏ธ CLI

  • [CLI] inline enum choices in the generated CLI skill by @hanouticelina in #4299

๐Ÿ› Bug and typo fixes

  • Fix ~ user home not expanded in local_dir and cache_dir on file download by @Wauplin in #4293
  • Do not fail on repo/bucket creation if HTTP 401 and already exists by @Wauplin in #4294
  • Fix umask probe writing tmp file outside download dir by @Wauplin in #4305

๐Ÿ“– Documentation

  • [Docs] Document missing endpoint and template_str parameters by @aicayzer in #4298
  • [Docs] Document missing parameters in hf_hub_url and preupload_lfs_files by @aicayzer in #4300
  • [Docs] Mention storage region limitation for server-side copy by @Wauplin in #4302

๐Ÿ—๏ธ Internal

Copy files across repos; SSH into Spaces; CLI tables auto-fit terminal width

โ†—This release5 featuresNew capabilities3 enhancementsImprovements to existing features3 fixesBug fixesAI-tallied from the release notes
v1.17.0

๐Ÿ“‹ Copy files between repositories

You can now copy files or entire folders between different repositories on the Hub โ€” model to model, model to dataset, any combination โ€” without downloading or re-uploading data. CommitOperationCopy accepts src_repo_id and src_repo_type for cross-repo sources, and LFS blobs are deduplicated server-side via the /lfs-files/duplicate endpoint. Non-LFS files are fetched from the source repo and committed as regular payloads. copy_files and hf buckets cp now support repo-to-repo in addition to the existing bucket destinations.

>>> from huggingface_hub import copy_files

# Copy an entire folder
>>> copy_files(
...     "hf://datasets/username/source-dataset/data/",
...     "hf://datasets/username/target-dataset/data/",
... )
  • [Copy] Support cross-repo file copies by @Wauplin in #4203

๐Ÿ“š Documentation: Upload guide โ€” Copy files between repositories

๐Ÿ–ฅ๏ธ SSH into a Space with hf spaces ssh

A new hf spaces ssh command opens an SSH session directly into a Space's Dev Mode container. If Dev Mode is not enabled yet, the CLI prompts you to enable it. You can also use --dry-run to print the SSH command without running it, or -i to forward a specific key. Your SSH public key must be registered in your HF user settings.

# SSH into a Space
$ hf spaces ssh username/my-space

# Print the SSH command without running it
$ hf spaces ssh username/my-space --dry-run
  • [CLI] Add hf spaces ssh by @gary149 in #4241

๐Ÿ“š Documentation: CLI guide โ€” SSH into a Space | Spaces guide โ€” SSH into a Space

๐Ÿ“‚ List all your repos with hf repos ls

A new hf repos ls command lists all your repositories โ€” models, datasets, spaces, and buckets โ€” with storage size and percentage of namespace total, sorted by storage usage. It supports --type, --search, --namespace, and --limit (default 30, --limit 0 for all), plus the standard --format family.

# List all your repos
$ hf repos ls

# List all datasets under org with JSON output
$ hf repos ls --namespace my-org --type dataset --limit 0 --format json | jq '.[].id'
  • [CLI] Add hf repos ls command by @Wauplin in #4283

๐Ÿ“š Documentation: CLI guide โ€” List repos | Repository guide โ€” List your repositories

๐Ÿ“Š CLI tables auto-fit terminal width and right-align numbers

Human-mode CLI tables now use a column-aware algorithm that computes per-column width caps from the actual terminal width, shrinking only the widest columns when needed. Non-TTY output keeps the legacy fixed cap, and --no-truncate bypasses truncation entirely. Numeric columns (all int/float values) are automatically right-aligned.

# Tables adapt to your terminal width
$ hf models ls --search qwen3

# Force full values regardless of width
$ hf models ls --no-truncate
  • [CLI] Auto-fit human tables to terminal width by @hanouticelina in #4251
  • [CLI] Auto right-align numeric columns in human table output by @Wauplin in #4288

๐Ÿ“š Documentation: CLI guide โ€” Output formatting

๐Ÿ”ง Jobs hardware decoupled from Spaces, auto-synced with Hub API

Jobs now have their own JobHardware enum, independent of SpaceHardware, so the two catalogs can diverge as needed. The old JobHardware dataclass (return type of list_jobs_hardware()) has been renamed to JobHardwareInfo. CLI --flavor / --hardware flags use a new SoftChoice type that shows known values for autocomplete but accepts any string โ€” older CLI versions won't reject new server-side flavors. A daily CI workflow (update-hardware-flavors.yaml) runs utils/check_hardware_flavors.py to sync both enums from the live Hub API and opens a bot PR when something changes.

# Unknown flavors pass through instead of raising a validation error
$ hf jobs run --flavor future-gpu-x99 python:3.12 echo "works with unknown flavors"
  • [Jobs] Decouple Job hardware from Spaces, auto-sync enums with Hub API by @Wauplin in #4266

๐Ÿ“š Documentation: Jobs guide

๐Ÿ’” Breaking Change

  • [Inference] Remove Together ASR task to drop urllib3 dependency by @Wauplin in #4248
  • [CLI] migrate hf jobs to out singleton by @hanouticelina in #4254

Note: The second item changes hf jobs ps and hf jobs scheduled ps to use --format auto|human|agent|json|quiet (removing --format table and -q). JSON output for hf jobs ps now flattens command to a string and status to a stage string.

๐Ÿ–ฅ๏ธ CLI

  • [CLI] Migrate extensions, lfs-enable-largefiles, version to out singleton by @hanouticelina in #4284
  • [CLI] Fix parent aliases leaking into subcommand headers in CLI reference by @Wauplin in #4253

๐Ÿ“Š Jobs

  • [Jobs] Add update_job_labels and update_scheduled_job_labels by @Wauplin in #4252
  • feat: add rtx-pro-6000 hardware flavors by @christophe-rannou in #4259

๐Ÿ“š Documentation: Jobs guide โ€” Update labels | Jobs guide โ€” Hardware

๐Ÿ”ง Other QoL Improvements

  • Fix failing on read-only file system even if the non-existence of file is already cached by @ydshieh in #4274
  • [CLI] Add click as an explicit dependency (typer 0.26.0 fix) by @hanouticelina in #4270

๐Ÿ“– Documentation

  • [Docs] Document missing parameters in lfs, hf_file_system, and repocard_data by @kratos0718 in #4289

๐Ÿ› Bug and typo fixes

  • fix local_files_only grammar by @hunterhogan in #4255
  • Fix typos in comments and debug log message by @Sanjays2402 in #4278

๐Ÿ—๏ธ Internal

  • Post-release: bump version to 1.17.0.dev0 by @huggingface-hub-bot[bot] in #4247
  • ci(release): migrate PyPI publish to Trusted Publishing + attestations by @XciD in #4249
  • [CI] Add import check with base dependencies only by @Wauplin in #4250
  • [Internal] Update style bot permissions by @hanouticelina in #4260
  • chore: enable Dependabot weekly GitHub Actions bumps by @hf-dependantbot-rollout[bot] in #4262
  • Bump actions in the actions group by @dependabot[bot] in #4263
  • chore: update release.yml by @hf-security-analysis[bot] in #4264
  • fix(release.yml): restore env: block on 'Detect version' step by @paulinebm in #4267
  • [Internal] Cap typer below 0.26.0 (CLI incompatibility) by @hanouticelina in #4272
  • [Internal] Run pinact (lock versions in workflow files) by @Wauplin in #4275
  • [Internal] Use Comment bot in model card gh action by @Wauplin in #4277
  • [CI] fix collection test by making its name unique by @Wauplin in #4279
  • Bump astral-sh/setup-uv from 7.6.0 to 8.1.0 in the actions group by @dependabot[bot] in #4281
  • [CLI] Drop legacy printing helpers from _cli_utils.py by @hanouticelina in #4285
v1.15.0

๐ŸŒ Pick a region when creating buckets and repos

create_bucket and create_repo now accept an optional region argument ("us" or "eu") so you can pin a new bucket or repo to a specific cloud region at creation time. The same option is exposed on the CLI via a --region flag on hf buckets create and hf repos create.

>>> from huggingface_hub import create_bucket, create_repo
>>> create_bucket("my-bucket", region="us")
>>> create_repo("my-model", region="eu")
$ hf buckets create my-bucket --region us
$ hf repos create username/my-model --region eu
  • [Bucket/Repo] Support 'region' option in create_bucket and create_repo by @Wauplin in #4194

๐Ÿงฉ Discover marketplace skills with hf skills list

A new hf skills list (alias ls) command lists every skill available in the Hugging Face marketplace and shows whether each one is already installed in the four supported locations (project, global, project Claude, global Claude). Handy when you want to check what's installable and what you've already got before running hf skills add.

$ hf skills ls
NAME                        DESCRIPTION                         PROJECT PROJECT (CLAUDE) GLOBAL GLOBAL (CLAUDE)
--------------------------- ----------------------------------- ------- ---------------- ------ ---------------
hf-cli                      Execute Hugging Face Hub operati...     yes              yes    yes             yes                                
  • [CLI] Add hf skills list command by @Wauplin in #4180

๐ŸŽจ Polished --help output with ANSI styling

hf --help and every subcommand now render with underlined section headings and bold option/command names, making the help screens much easier to scan in a terminal. The new styling is automatically disabled when NO_COLOR is set or when the CLI detects it's running under an AI agent, so script and agent output stays clean.

  • [CLI] Pretty-print --help with ANSI styling by @Wauplin in #4192

๐Ÿ–ฅ๏ธ CLI

  • [CLI] Check Homebrew registry for updates when installed via brew by @Wauplin in #4204 โ€” hf update no longer suggests a version that isn't on brew yet for Homebrew installs.
  • [CLI] No traceback on LocalEntryNotFoundError by @Wauplin in #4190 โ€” offline/cache-miss errors now print a clean message instead of a Python traceback (set HF_DEBUG=1 for the full stack).

๐Ÿ› Bug and typo fixes

  • Make HF_HUB_ENABLE_HF_TRANSFER deprecation warning visible to users by @Adithya191101 in #4220
  • Fix hint message to use 'hf skills update' by @Pierrci in #4206

๐Ÿ“– Documentation

  • [docs] Drop duplicated Key Features list from hf jobs CLI section by @davanstrien in #4222

๐Ÿ—๏ธ Internal

  • [CI] Harden style-bot workflow against TOCTOU by @paulinebm in #4183
  • Only sync skill if SKILL.md has changed by @evalstate in #4210
v1.14.0

๐Ÿ–ฅ๏ธ Manage Space secrets and variables from the CLI

You can now manage Space secrets and environment variables directly from the command line with two new hf spaces subgroups: secrets and variables. Use hf spaces secrets to add, list, and delete write-only secrets, and hf spaces variables to add, list, and delete readable environment variables. Both add commands support multiple -s/-e flags and --secrets-file/-env-file for loading from dotenv files. On the Python side, HfApi.get_space_secrets() returns secret metadata (key, description, updated timestamp) without ever revealing values.

# List secrets (values are write-only โ€” only keys and timestamps are shown)
$ hf spaces secrets ls username/my-space

# Add secrets
$ hf spaces secrets add username/my-space -s OPENAI_API_KEY=sk-...
$ hf spaces secrets add username/my-space --secrets-file .env.secrets

# Delete a secret (confirmation prompt, use --yes to skip)
$ hf spaces secrets delete username/my-space OPENAI_API_KEY --yes

# List, add, and delete variables (values are readable)
$ hf spaces variables ls username/my-space
$ hf spaces variables add username/my-space -e MODEL_ID=gpt2 -e MAX_TOKENS=512
$ hf spaces variables delete username/my-space MAX_TOKENS --yes
  • [CLI] Add hf spaces secrets and variables subgroups by @davanstrien in #4170
  • [CLI] Add get_space_secrets + hf spaces secrets ls by @Wauplin in #4182

๐Ÿ“š Documentation: CLI guide ยท Manage your Space

๐Ÿชฃ Rsync-style trailing slash for bucket folder copies

hf buckets cp now supports rsync-style trailing slash semantics when copying folders. A trailing / on the source path copies only the folder's contents to the destination, while omitting it nests the folder itself โ€” matching the behavior you'd expect from rsync. This makes it possible to flatten directory structures during copies, which was not possible before. Additionally, copy_files now raises an explicit EntryNotFoundError when the source path resolves to no files, instead of silently succeeding with zero operations.

# Without trailing slash: "logs" dir is nested => dst/logs/...
$ hf buckets cp hf://buckets/username/src-bucket/logs hf://buckets/username/dst/

# With trailing slash: only contents of "logs" are copied => dst/...
$ hf buckets cp hf://buckets/username/src-bucket/logs/ hf://buckets/username/dst/
  • [Buckets] Support rsync-style trailing slash in copy_files by @Wauplin in #4187
  • [CLI] Raise error when copy_files source doesn't exist by @Wauplin in #4186

๐Ÿ“š Documentation: Buckets guide ยท CLI guide

๐Ÿ’” Breaking Change

  • [CLI] Rename hf skills upgrade -> hf skills update by @hanouticelina in #4176 โ€” hf skills upgrade no longer exists; use hf skills update instead.
  • [CLI] Add out.status() by @hanouticelina in #4171 โ€” status updates (spinners/progress) on hf extensions install and hf spaces dev-mode are now suppressed when using --format json, --quiet, or --format agent.

๐Ÿ–ฅ๏ธ CLI

  • [CLI] Add hints and example to hf datasets leaderboard by @Wauplin in #4174
  • [CLI] Shortcut hf update when already on latest version by @julien-c in #4177
  • [CLI] Remove progress bars on skills update by @Wauplin in #4179
  • [CLI] Increase default --limit from 10 to 30 for list commands by @Wauplin in #4181
  • [CLI] Support hf -v to print version by @Wauplin in #4185
  • [CLI] migrate hf skills to bucket by @hanouticelina in #4175

๐Ÿ› Bug and typo fixes

  • Update typer dependency version in setup.py by @tomaarsen in #4193

๐Ÿ—๏ธ Internal

  • Post-release: bump version to 1.14.0.dev0 by @huggingface-hub-bot[bot] in #4172
  • [Release] Move social drafts to minor-release and archive release notes to bucket by @Wauplin in #4173
  • Update unit test warnings check to ignore unrelated deprecation warnings by @seanses in #4188
  • [internal] Untrack useless files by @Wauplin in #4191
v1.13.0

๐Ÿ–ฅ๏ธ New CLI commands: repo cards, file listings, and dataset leaderboards

This release adds three new CLI capabilities for exploring Hub content. hf models card, hf datasets card, and hf spaces card fetch the README of any repo and print it to stdout, with --metadata (YAML frontmatter as JSON) and --text (prose only) flags for splitting the card into its structured and unstructured parts. Calling hf models ls <repo_id>, hf datasets ls <repo_id>, or hf spaces ls <repo_id> now switches from listing repos to listing files inside that repo, with --tree, -R, -h, and --revision options mirroring the existing hf buckets ls behavior. And hf datasets leaderboard <dataset_id> surfaces model scores submitted to a benchmark dataset, making it easy to compare models by score from the terminal.

# Get model card metadata as JSON
hf models card google/gemma-4-31B-it --metadata --format json

# List files in a model repo (tree view with sizes)
hf models ls meta-llama/Llama-3.2-1B-Instruct --tree -h

# Show top 5 models on SWE-bench
hf datasets leaderboard SWE-bench/SWE-bench_Verified --limit 5

๐Ÿ“š Documentation: CLI guide

  • [CLI] Add hf models card and hf datasets card commands by @davanstrien in #4118
  • [CLI] Add file listing to models/datasets/spaces ls by @Wauplin in #4166
  • [CLI] add hf datasets leaderboard by @hanouticelina in #4154

๐Ÿš€ Manage Spaces from the CLI

Three new hf spaces subcommands bring full lifecycle control to the terminal. hf spaces pause and hf spaces restart stop or rebuild a Space (with --factory-reboot for a clean rebuild), and hf spaces settings lets you configure sleep time and hardware in one call. A companion hf spaces hardware command lists all available hardware flavors with pricing, so you can discover options before changing settings. Pause and restart include a confirmation prompt (-y to skip) since they tear down the running container.

# Pause a Space when not in use (not billed while paused)
hf spaces pause username/my-space

# Restart with a GPU
hf spaces settings username/my-space --hardware t4-medium --sleep-time 3600

# List available hardware options
hf spaces hardware

๐Ÿ“š Documentation: CLI guide โ€” Spaces

  • [CLI] Add spaces lifecycle commands: pause, restart, sleep by @davanstrien in #4155
  • [CLI] Add hf spaces hardware command by @Wauplin in #4169
  • [CLI] Add --hardware flag to hf spaces settings by @davanstrien in #4163

๐Ÿ”ƒ hf update replaces the auto-update prompt

The blocking interactive Y/n auto-update prompt at CLI startup is gone. It was catching too many non-interactive contexts (CI runners, Homebrew post-install hooks, Jupyter notebooks) and hanging automation. In its place, a single yellow stderr warning suggests running hf update โ€” a new command that detects how hf was installed (Homebrew, standalone installer, or pip) and runs the right upgrade command. Set HF_HUB_DISABLE_UPDATE_CHECK=1 to silence the startup check entirely, for example in offline CI.

hf update

๐Ÿ“š Documentation: CLI guide โ€” Updating

  • [CLI] Add hf update + drop interactive update prompt by @Wauplin in #4131

โœ๏ธ Global output formatting for every command

The --format, --json, and -q / --quiet flags are now handled globally by the CLI framework instead of being declared individually on each command. This means every hf command automatically accepts them โ€” no more per-command --format boilerplate, and the flags are properly documented in a dedicated "Formatting options" section in every --help page. --format auto (the default) picks human for interactive terminals and agent when invoked by an AI agent, making CLI output automatically suitable for both people and tools.

# JSON output for scripting
hf models ls --search bert --limit 2 --json | jq '.[].id'

# IDs only, one per line
hf collections ls --owner nvidia -q

๐Ÿ“š Documentation: CLI guide โ€” Output formatting

  • [CLI] Make --format / --json / -q global by @Wauplin in #4162

๐Ÿ”— Centralized hf:// URI parsing

A new parse_hf_uri function and HfUri dataclass provide a single source of truth for parsing hf://... strings across the library. Whether you reference a model, dataset, space, bucket, or file inside a repo, the parser handles all valid URI shapes โ€” type prefixes, revisions, and paths โ€” and rejects invalid ones with clear error messages. A companion parse_hf_mount / HfMount handles volume mount specifications (hf://...:/mnt:ro). Both are pure string parsers (no network calls) and round-trippable via .to_uri().

from huggingface_hub import parse_hf_uri, parse_hf_mount

parse_hf_uri("hf://datasets/namespace/my-dataset@refs/pr/3/train.json")
# HfUri(type='dataset', id='namespace/my-dataset', revision='refs/pr/3', path_in_repo='train.json')

parse_hf_mount("hf://buckets/my-org/my-bucket/sub/dir:/mnt:ro")
# HfMount(source=HfUri(type='bucket', id='my-org/my-bucket', ...), mount_path='/mnt', read_only=True)

๐Ÿ“š Documentation: HF URIs reference

  • Centralize hf:// URI parsing by @Wauplin in #4158

๐Ÿš€ Bucket transport for Jobs script upload

Local scripts uploaded by hf jobs uv run are now stored in a {namespace}/jobs-artifacts bucket and mounted into the job container at /data instead of being base64-encoded into an environment variable. The old bash -c + xargs + base64 -d pipeline was fragile and required manual shell quoting. Bucket transport is simpler, easier to debug, and supports write-back: jobs can persist output artifacts to /data/ since the mount is read-write. The base64 transport path has been fully removed with no fallback.

  • Add bucket+mount transport for Jobs script upload by @davanstrien in #4025

๐Ÿ–ฅ๏ธ CLI

  • [CLI] Print help when leaf command with required args is called without args by @Wauplin in #4135

๐Ÿค– Inference

  • [Inference Providers] Add DeepInfra support by @hanouticelina in #4114
  • Support list[str] inputs in feature_extraction by @SJeffZhang in #4115

๐Ÿ“– Documentation

  • [CLI] Add benchmark dataset filter examples by @hanouticelina in #4156

๐Ÿ› Bug and typo fixes

  • [BUG FIX]: hf_hub_download crashes when stderr lacks a real file descriptor by @tobocop2 in #4065
  • [CLI] Fix datasets list table rendering by @hanouticelina in #4157
  • [CLI] Fix installation method detection for curl-installed hf with Homebrew Python by @Wauplin in #4142
  • Avoid reuploading preuploaded LFS files in upload-large-folder by @Dev-Jahn in #4165

๐Ÿ—๏ธ Internal

  • [Release] Make release-notes job fail loudly on bad model/empty output by @Wauplin in #4138
  • [Release] Fix bucket URL in social posts Slack notification by @Wauplin in #4139
  • Post-release: bump version to 1.13.0.dev0 by @huggingface-hub-bot[bot] in #4140
  • [CI] Fix two flaky Windows tests (root causes, not skips) by @Wauplin in #4141
  • [Quality] Fix uvx ty check src errors by @Wauplin in #4159
  • [Release] Mark minor releases as "latest" on GitHub by @Wauplin in #4167
v1.12.0

๐Ÿ–ฅ๏ธ Unified output format for hf buckets commands

All hf buckets commands now use the unified --format [auto|human|agent|json|quiet] flag and the out singleton for consistent, scriptable output. The previous --quiet and --format table|json flags have been replaced by a single --format option that works across create, list, info, delete, rm, move, and cp. Success messages use out.result(), detail views use out.dict(), and listings use out.table() with proper empty-results handling โ€” making the buckets CLI consistent with the rest of the hf command suite.

# Quiet mode: print only bucket IDs
hf buckets list --format quiet

# JSON output for scripting
hf buckets create my-bucket --format json

# Agent-friendly structured output
hf buckets info username/my-bucket --format agent
  • [CLI] Migrate buckets commands to out singleton by @hanouticelina in #4111

๐Ÿ“š Documentation: Buckets guide ยท CLI guide

๐Ÿชฃ Search buckets by name

You can now filter buckets by name when listing them, both from the Python API and the CLI. Pass search="checkpoint" to list_buckets() or --search "checkpoint" to hf buckets list to find buckets matching a name pattern, without having to list and filter client-side.

# Filter buckets by name
hf buckets list --search "checkpoint"
# Filter buckets by name in Python
for bucket in list_buckets(search="checkpoint"):
    print(bucket.id)
  • [Buckets] Add search param to list_buckets by @alexpouliquen in #4130

๐Ÿ“š Documentation: Buckets guide ยท CLI guide

๐Ÿ–ฅ๏ธ CLI

๐Ÿ› Bug and typo fixes

๐Ÿ”ง Other QoL Improvements

  • [Buckets] Skip local walk for download sync without delete by @abidlabs in #4123
  • [HfApi] Add mainSize to ExpandDatasetProperty_T by @Wauplin in #4136

๐Ÿ—๏ธ Internal

  • [Internal] Fix slack-message draft release permissions + update model by @hanouticelina in #4119
  • Post-release: bump version to 1.12.0.dev0 by @huggingface-hub-bot[bot] in #4120
  • [Internal] Make RELEASE_NOTES_MODEL configurable via repo variable by @Wauplin in #4126
  • [Release] Add social media draft generation to release workflow by @Wauplin in #4132
  • chore: bump doc-builder SHA for main doc build workflow by @rtrompier in #4137
  • [Release] Make release-notes job fail loudly on bad model/empty output by @Wauplin in #4138
v1.11.0

๐Ÿ” Semantic search for Spaces

Discover Spaces using natural language. The new search_spaces() API and hf spaces search CLI use embedding-based semantic search to find relevant Spaces based on what they do - not just keyword matching on their name.

>>> from huggingface_hub import search_spaces

>>> results = search_spaces("remove background from photo")
>>> for space in results:
...     print(f"{space.id} (score: {space.score:.2f})")
briaai/BRIA-RMBG-1.4 (score: 0.87)

The same capability is available in the CLI:

$ hf spaces search "remove background from photo" --limit 3
ID                           TITLE                 SDK    LIKES STAGE   CATEGORY           SCORE
---------------------------- --------------------- ------ ----- ------- ------------------ -----
not-lain/background-removal  Background Removal    gradio 2794  RUNNING Image Editing      0.85 
briaai/BRIA-RMBG-2.0         BRIA RMBG 2.0         gradio 918   RUNNING Background Removal 0.84 
Xenova/remove-background-web Remove Background Web static 739   RUNNING Background Removal 0.81 
Hint: Use --description to show AI-generated descriptions.

# Filter by SDK, get JSON with descriptions
$ hf spaces search "chatbot" --sdk gradio --description --json --limit 1 | jq
[
  {
    "id": "BarBar288/Chatbot",
    "title": "Chatbot",
    "sdk": "gradio",
    "likes": 4,
    "stage": "RUNNING",
    "category": "Other",
    "score": 0.5,
    "description": "Perform various AI tasks like chat, image generation, and text-to-speech"
  }
]

๐Ÿ“œ Programmatic access to Space logs

When a Space fails to build or crashes at runtime, you can now retrieve the logs programmatically โ€” no need to open the browser. This is particularly useful for agentic workflows that need to debug Space failures autonomously.

>>> from huggingface_hub import fetch_space_logs

# Run logs (default)
>>> for line in fetch_space_logs("username/my-space"):
...     print(line, end="")

# Build logs โ€” for BUILD_ERROR debugging
>>> for line in fetch_space_logs("username/my-space", build=True):
...     print(line, end="")

# Stream in real time
>>> for line in fetch_space_logs("username/my-space", follow=True):
...     print(line, end="")

The CLI equivalent:

$ hf spaces logs username/my-space              # run logs
$ hf spaces logs username/my-space --build      # build logs
$ hf spaces logs username/my-space -f           # stream in real time
$ hf spaces logs username/my-space -n 50        # last 50 lines

๐Ÿ–ฅ๏ธ CLI output standardization continues

This release continues the CLI output migration started in v1.9, bringing 11 more command groups to the unified --format flag. The old --quiet flags on migrated commands are replaced by --format quiet.

$ hf cache ls                          # auto-detect (human or agent)
$ hf cache ls --format json            # structured JSON
$ hf cache ls --format quiet           # minimal output, great for piping
$ hf upload my-model . .               # auto-detect (human or agent)

Confirmation prompts (e.g., hf cache rm, hf repos delete, hf buckets delete) are now mode-aware: they prompt in human mode, and require --yes in agent/json/quiet modes - no more hanging scripts.

Commands migrated in this release: collections, discussions, extensions, endpoints, webhooks, cache, repos, repo-files, download, upload, and upload-large-folder. Remaining commands (jobs, buckets, auth login/logout) will follow in a future release.

๐Ÿ“ฆ Space volumes management from the CLI

A new hf spaces volumes command group lets you manage volumes mounted in Spaces directly from the command line โ€” list, set, and delete using the familiar -v/--volume syntax.

# List mounted volumes
$ hf spaces volumes ls username/my-space
TYPE    SOURCE                MOUNT_PATH READ_ONLY
------- --------------------- ---------- ---------
model   gpt2                  /data      โœ”
dataset badlogicgames/pi-mono /data2     โœ”

# Set volumes
$ hf spaces volumes set username/my-space -v hf://buckets/username/my-bucket:/data
$ hf spaces volumes set username/my-space -v hf://models/username/my-model:/models

# Delete all volumes
$ hf spaces volumes delete username/my-space

๐Ÿ”ง More CLI improvements

hf auth token - Prints the current token to stdout, handy for piping into other commands:

$ hf auth token
hf_xxxx
Hint: Run `hf auth whoami` to see which account this token belongs to.

# Use it in a curl call
$ hf auth token | xargs -I {} curl -H "Authorization: Bearer {}" https://huggingface.co/api/whoami-v2

๐Ÿ’” Breaking change

model_name deprecated in list_models - Use search instead. Both were always equivalent (both map to ?search=... in the API), but now model_name emits a deprecation warning. Removal is planned for 2.0.

# Before
>>> list_models(model_name="gemma")

# After
>>> list_models(search="gemma")

The CLI is not affected - hf models ls already uses --search.

๐Ÿ”ง Other improvements

๐Ÿ› Bug fixes

๐Ÿ“– Documentation

๐Ÿ—๏ธ Internal

v1.9.0

๐Ÿš€ Spaces Volumes: Mount Models, Datasets, and Buckets Directly

Hugging Face Spaces now support mounting volumes, giving your Space direct filesystem access to models, datasets, and storage buckets. This replaces the deprecated persistent storage feature.

from huggingface_hub import HfApi, Volume

api = HfApi()
api.set_space_volumes(
    repo_id="username/my-space",
    volumes=[
        Volume(type="model", source="username/my-model", mount_path="/models", read_only=True),
        Volume(type="bucket", source="username/my-bucket", mount_path="/data"),
    ],
)

Volumes can also be set at creation time via create_repo(space_volumes=...) and duplicate_repo(space_volumes=...), and from the CLI with the --volume / -v flag:

# Create a Space with volumes mounted
hf repos create my-space --type space --space-sdk gradio \
    -v hf://gpt2:/models -v hf://buckets/org/b:/data

# Duplicate a Space with volumes
hf repos duplicate org/my-space my-space --type space \
    -v hf://gpt2:/models -v hf://buckets/org/b:/data
  • Add support for mounted volumes by @Wauplin in #4018
  • Support volumes at repo creation and duplication by @Wauplin in #4035

๐Ÿค– The hf CLI Now Auto-Detects AI Agents and Adapts Its Output

AI coding agents (Claude Code, Cursor, Codex, Copilot, Gemini, ...) increasingly use the hf CLI to interact with the Hub. Until now, the output was designed for humans - ANSI colors, padded tables, emoji booleans, truncated cells - making it hard for agents to parse reliably.

Starting with v1.9, the CLI automatically detects when it's running inside an agent and adapts its output: no ANSI, no truncation, tab-separated tables, compact JSON, full timestamps. No configuration needed - it just works. This is only a first step toward making the hf CLI the primary entry point to the Hugging Face Hub for AI agents!

Agent mode is auto-detected but you can also force a mode explicitly with --format:

hf models ls --limit 5                  # auto-detect
hf models ls --limit 5 --format agent   # force agent-friendly output
hf models ls --limit 5 --format json    # structured JSON
hf models ls --limit 5 --format quiet   # IDs only, great for piping

Here's what an agent sees compared to a human:

hf auth whoami

# Human
โœ“ Logged in
  user: Wauplin
  orgs: huggingface, awesome-org

# Agent
user=Wauplin orgs=huggingface,awesome-org

# JSON
{"user": "Wauplin", "orgs": ["huggingface", "awesome-org"]}

hf models ls --author google --limit 3

# Human
ID                         DOWNLOADS TRENDING_SCORE
-------------------------- --------- --------------
google/embeddinggemma-300m 1213145   17            
google/gemma-3-4b-it       1512637   16            
google/gemma-3-27b-it      988618    12   

# Agent (TSV, no truncation, no ANSI)
id      downloads       trending_score
google/embeddinggemma-300m      1213145 17
google/gemma-3-4b-it    1512637 16
google/gemma-3-27b-it   988618  12

hf models info google/gemma-3-27b-it

# Human โ€” pretty-printed JSON (indent=2)
{
  "id": "google/gemma-3-27b-it",
  "author": "google",
  ...
}

# Agent โ€” compact JSON (~40% fewer tokens)
{"id": "google/gemma-3-27b-it", "author": "google", "card_data": ...}

Commands migrated so far: hf models ls|info, hf datasets ls|info|parquet|sql, hf spaces ls|info, hf papers ls|search|info, hf auth whoami. More commands will be migrated soon

  • Add out output singleton with agent/human mode rendering by @hanouticelina in #4005
  • Migrate models, datasets, spaces, papers to out singleton by @hanouticelina in #4026
  • Add FormatWithAutoOpt with callback to auto-set output mode by @hanouticelina in #4028
  • Add tests for out output singleton by @hanouticelina in #4020
  • Add agent detection helpers by @hanouticelina in #4015
  • Enrich CLI errors with available options and commands by @hanouticelina in #4034

๐Ÿงฉ Install Agent Skills from the Hugging Face Marketplace

The hf skills add command now supports installing skills directly from the Hugging Face skills marketplace (https://github.com/huggingface/skills) - pre-built tools that give AI agents new capabilities.

# Install a marketplace skill
hf skills add gradio

# Install with Claude Code integration
hf skills add huggingface-gradio --claude

# Upgrade all installed skills
hf skills upgrade
  • Support skills from hf skills by @burtenshaw in #3956
  • Improve hf CLI skill description for better agent triggering by @hanouticelina in #3973

๐Ÿ”ง More CLI Improvements

  • Auto-install official HF CLI extensions on first invocation by @hanouticelina in #4007
  • Add summary field to hf papers search CLI output by @Wauplin in #4006
  • Interactive CLI autoupdate prompt by @Wauplin in #3983

๐Ÿ”ง Other Improvements

  • Clarify 404 access guidance in errors by @Pierrci in #4010
  • Add HF_HUB_DISABLE_SYMLINKS env variable to force no-symlink cache by @Wauplin in #4032
  • Add CACHEDIR.TAG to cache directories by @Wauplin in #4030
  • Support None type in strict dataclass by @Wauplin in #3987
  • Reject bool/int cross-type confusion in @strict dataclass validation by @Wauplin in #3992

๐Ÿ› Bug Fixes

  • Fix PyTorchModelHubMixin not calling eval() on safetensors load by @joaquinhuigomez in #3997
  • Bump to hf-xet 1.4.3 and add regression test by @Wauplin in #4019
  • Validate shard filenames in sharded checkpoint index files by @Wauplin in #4033
  • Fix test_create_commit_conflict test by @Wauplin in #3986
  • Do not scan CACHEDIR.TAG file in cache by @Wauplin in #4036
  • Deduplicate repo folder name generation logic by @cphlipot in #4024

๐Ÿ“– Documentation

  • Add tip about AI agents skill to CLI guide by @gary149 in #3970
  • Link to Hub local cache docs from manage-cache guide by @Wauplin in #3989
  • Note that environment variables are read at import time by @Wauplin in #3990
  • Add DatasetLeaderboardEntry and EvalResultEntry to docs reference by @pcuenca in #3982
  • Fix typos and outdated references in CONTRIBUTING.md by @GopalGB in #4009
  • no explicit models/ in hf:// protocol by @lhoestq in #3980
  • Add CLAUDE.md symlink pointing to AGENTS.md by @hanouticelina in #4013

๐Ÿ—๏ธ Internal

v1.8.0

๐Ÿš€ Jobs can now mount volumes

Jobs can now access Hugging Face repositories (models, datasets, Spaces) and Storage Buckets directly as mounted volumes in their containers. This enables powerful workflows like running queries directly against datasets, loading models without explicit downloads, and persisting training checkpoints to buckets.

from huggingface_hub import run_job, Volume

job = run_job(
    image="duckdb/duckdb",
    command=["duckdb", "-c", "SELECT * FROM '/data/**/*.parquet' LIMIT 5"],
    volumes=[
        Volume(type="dataset", source="HuggingFaceFW/fineweb", mount_path="/data"),
    ],
)
hf jobs run -v hf://datasets/HuggingFaceFW/fineweb:/data duckdb/duckdb duckdb -c "SELECT * FROM '/data/**/*.parquet' LIMIT 5"
  • Add volume mounting support for buckets and repos by @XciD in #3936

๐Ÿ“– Papers CLI is now complete

The hf papers command now has full functionality: search papers by keyword, get structured JSON metadata, and read the full paper content as markdown. The ls command is also enhanced with new filters for week, month, and submitter.

# Search papers
hf papers search "vision language"

# Get metadata
hf papers info 2601.15621

# Read as markdown
hf papers read 2601.15621
  • Complete hf papers with search, info, read + ls filters by @mishig25 in #3952

๐Ÿ–ฅ๏ธ CLI repo ID shorthand

You can now use repo ID prefixes like spaces/user/repo, datasets/user/repo, and models/user/repo as a shorthand for user/repo --type space. This works automatically for all CLI commands that accept a --type flag.

# Before
hf download user/my-space --type space
hf discussions list user/my-dataset --type dataset

# After
hf download spaces/user/my-space
hf discussions list datasets/user/my-dataset
  • Accept spaces/user/repo as repo ID prefix shorthand by @Wauplin in #3929

๐Ÿ”ง More repo visibility options

Repositories can now be created or updated with explicit visibility settings (--public, --protected) alongside the existing --private flag. This adds a visibility parameter to HfApi.create_repo, update_repo_settings, and duplicate_repo, with --protected available for Spaces only.

Protected Spaces allow for private code while being publicly accessible.

  • Add visibility parameter to HfApi repo create/update/duplicate methods by @hanouticelina in #3951

๐Ÿ–ฅ๏ธ CLI

  • Add space-specific options to hf repos create and hf repos duplicate by @Wauplin in #3888
  • Add --format json to hf auth whoami by @hanouticelina in #3938 โ€” docs
  • Expand nested groups, inline flags & common options glossary in SKILL.md by @hanouticelina in #3941
  • Include common options inline in generated SKILL.md by @hanouticelina in #3955
  • Fix hf extensions install on uv-managed Python by using uv when available by @hanouticelina in #3957
  • Add dataset leaderboard method to HfApi by @davanstrien in #3953
  • More explicit spaces hot-reload docs by @cbensimon in #3964
  • Update hardware flavors with HF Hub (cpu-performance, sprx8, h200, inf2x6) by @cbensimon in #3965 โ€” docs

๐Ÿ”ง Other QoL Improvements

  • Rename .env to .venv in virtual environment instructions by @julien-c in #3939 โ€” docs
  • Fix typo in --every help text by @julien-c in #3950
  • More robust stream to stdout in hf cp command by @Wauplin in #3968

๐Ÿ› Bug and typo fixes

  • Use module logger consistently and narrow bare except clauses by @mango766 in #3924
  • Fix HfFileSystem glob in missing subdir by @lhoestq in #3935

๐Ÿ—๏ธ Internal

  • Remove conda workflow by @Wauplin in #3928
  • Replace huggingface-cli with hf in brew upgrade command by @hanouticelina in #3946
  • Fix version check message leaking into generated SKILL.md by @hanouticelina in #3949
  • Mention hf-mount in CLI skill by @hanouticelina in #3966
  • Use huggingface-hub-bot for post-release PR creation in release.yml by @Wauplin in #3967
v1.7.2

๐Ÿ› ๏ธ CLI improvements

hf CLI skill now fully expands subcommand groups and inlines all flags and options, making the CLI self-describing and easier for agents to discover.

  • Expand nested groups, inline flags & common options glossary in SKILL.md (#3941) by @hanouticelina
  • include common options inline (#3955) by @hanouticelina

hf extension install now uses uv for Python extension installation when available making extension installation faster:


> hyperfine "hf extensions install alvarobartt/hf-mem --force"
# Before
Benchmark 1: hf extensions install alvarobartt/hf-mem --force
  Time (mean ยฑ ฯƒ):      3.490 s ยฑ  0.220 s    [User: 1.925 s, System: 0.445 s]
  Range (min โ€ฆ max):    3.348 s โ€ฆ  4.097 s    10 runs

# After
Benchmark 1: hf extensions install alvarobartt/hf-mem --force
  Time (mean ยฑ ฯƒ):     519.6 ms ยฑ 119.7 ms    [User: 216.6 ms, System: 95.2 ms]
  Range (min โ€ฆ max):   371.6 ms โ€ฆ 655.2 ms    10 runs

  • Use uv python extension installation when available (#3957) by @hanouticelina

Other QoL improvements:

  • Add --format json to hf auth whoami (#3938) by @hanouticelina
  • Replace huggingface-cli with hf in brew upgrade command (#3946) by @hanouticelina

๐Ÿ› Bug & Typo fixes

  • Fix HfFileSystem glob in missing subdirectory (#3935) by @lhoestq
  • Fix: use module logger consistently and narrow bare except clauses (#3924) by @mango766
  • Fix typo in --every help text (#3950) by @julien-c

๐Ÿ“š Docs

  • Rename .env to .venv in virtual environment instructions (#3939) by @julien-c

๐Ÿ—๏ธ Internal

  • Remove conda workflow (#3928) by @Wauplin
  • Fix version check message leaking into generated SKILL.md (#3949) by @hanouticelina

Full Changelog: https://github.com/huggingface/huggingface_hub/compare/v1.7.1...v1.7.2

Latest
Jun 11, 2026
Category
.jsonยท.mdยท.atom