📊 Jobs listing revamped: filter, paginate, and ls instead of ps
The Jobs listing API and CLI have been overhauled with server-side filtering, proper pagination, and a CLI rename that aligns with the rest of hf. list_jobs() now accepts status and labels parameters that push filtering to the server, and returns a lazy iterator (matching list_models, list_datasets, etc.) so large result sets are fetched page by page. On the CLI side, hf jobs ps has been renamed to hf jobs ls for consistency with hf repos ls, hf models ls, and friends — ps and list still work as aliases.
list_jobs()now returns anIterable[JobInfo]instead oflist[JobInfo]. If you indexed the result (jobs[0]), wrap it withlist(...).-f/--filterinhf jobs lsis deprecated. Use--statusand--labelinstead. Glob patterns (data-*), negation (key!=value), and filtering byid/image/commandare no longer supported.
from huggingface_hub import list_jobs
# Filter by status and labels
list_jobs(status=["RUNNING", "SCHEDULING"], labels={"env": "prod"})
# Iterate lazily
for job in list_jobs():
print(job.id)
# Materialize all results
all_jobs = list(list_jobs())# Filter by status and labels
hf jobs ls --status running,scheduling --label env=prod --label team=ml
# Paginate with --limit
hf jobs ls -a --limit 500
hf jobs ls -a --limit 0 # no limit- [Jobs] Add stage/label filtering to list_jobs API and CLI by @Wauplin in #4395
- [Jobs] Paginate list_jobs and add --limit to
hf jobs psby @Wauplin in #4403 - [CLI] [Jobs] Rename job listing to 'hf jobs ls' (and keep 'hf jobs ps' alias) by @Wauplin in #4409
📚 Documentation: CLI guide, Jobs guide
🐛 Fix circular import on from huggingface_hub import login
A regression introduced in v1.20.0 caused from huggingface_hub import login to raise an ImportError on a fresh interpreter, due to a circular dependency between _oauth_device and utils._http. The fix moves _oauth_device.py into the utils layer so all imports resolve downward, eliminating the cycle. No lazy imports or workarounds required.
- Fix circular import on
from huggingface_hub import loginby @hanouticelina in #4385
🔧 Other QoL Improvements
- Retry requests on httpx.RemoteProtocolError by @hanouticelina in #4398
📖 Documentation
- Add Kannada (kn) translation of README by @spideyashith in #4370
- docs: put
hf jobs uv runflags before the script for consistency by @davanstrien in #4396 - [i18n-HI] Add Hindi translation for guides overview by @Mr-Abhinav-Pandey in #4405
🐛 Bug and typo fixes
- [Serialization] Exclude skipped string tensors from single-shard index by @nyxst4ck in #4391
- Fix IndexError in filter_repo_objects on an empty allow/ignore pattern by @CharlesCNorton in #4402
🏗️ Internal
- Post-release: bump version to 1.21.0.dev0 by @huggingface-hub-bot[bot] in #4383
- [CI] Catch circular imports in the check-imports job by @hanouticelina in #4386
- [Tests] Fix kernel tests for moved file on production by @Wauplin in #4387
- [Release] Report trigger actor, drop social drafts, archive raw + edited notes by @Wauplin in #4388
- [Tests] Fix flaky security-scan assertions by @Wauplin in #4392
- [Bot] Update hardware flavor enums and docs by @huggingface-hub-bot[bot] in #4406
- [CLI] Fix ty/mypy errors with click 8.4.2 by @Wauplin in #4408