hf jobs ls and list_jobs support server-side filters and lazy pagination
Introduced 2026-06-25 · score 0.97
HOW TO USE IT
When listing Jobs, use `list_jobs(status=..., labels=...)` to filter server-side and iterate its paginated results lazily; use `hf jobs ls` with `--status`, repeated `--label`, and `--limit` to filter and cap CLI output. Use `--limit 0` to show all Jobs.
from huggingface_hub import list_jobs
for job in list_jobs(status=["RUNNING", "SCHEDULING"], labels={"env": "prod"}):
print(job.id)hf jobs ls --status running,scheduling --label env=prod --label team=ml --limit 500hf jobs ls -a --limit 0WHY THIS HELPS
List and process Jobs in a repository, filtering by status or labels and handling large result sets.
BEFORE THIS CHANGE
The CLI used `-f`/`--filter` for client-side filtering, including glob patterns, negation, and filtering by `id`, `image`, or `command`; `list_jobs()` returned results without lazy page-by-page iteration.
REQUIREMENTS AND LIMITATIONS
- Version: v1.21.0
- list_jobs(status): A status string or list of statuses; examples include `RUNNING` and `SCHEDULING`.
- list_jobs(labels): A dictionary of label key/value pairs used to filter Jobs.
- --status: Filters by status; accepts comma-separated or repeated statuses. Cannot be combined with `-a`/`--all`.
- -l, --label TEXT: Filters by `key=value` label; repeat to require several labels. A Job must match every filter.
- -a, --all: Shows all Jobs; cannot be combined with `--status`.
- --limit INTEGER: Maximum Jobs displayed; default is 100. Set to 0 for no limit.
- -f, --filter TEXT: Deprecated; use `--status` and `--label` instead.
- `-f`/`--filter` is deprecated.
- Glob patterns (`data-*`), negation (`key!=value`), and filtering by `id`, `image`, or `command` are no longer supported.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.21.0
- https://github.com/huggingface/huggingface_hub/pull/4395
- https://huggingface.co/docs/huggingface_hub/guides/jobs
- https://huggingface.co/docs/huggingface_hub/en/package_reference/cli
Check the installed version and the source before using it. Entry JSON