hf jobs wait blocks for terminal job outcomes
Introduced 2026-06-18 · score 0.97
HOW TO USE IT
When chaining steps after Hugging Face Jobs finish, use `hf jobs wait` for one or more IDs; it returns success only when every Job completed. Set `--timeout` to cap the wait, and use `&&` to run the next step only on success.
hf jobs wait <job_id> && next-stephf jobs wait <id1> <id2> --timeout 10mhf jobs wait <job_id> [<job_id>...]WHY THIS HELPS
Chain CI or shell steps after one or more Hugging Face Jobs finish, and act on their result.
BEFORE THIS CHANGE
Use `hf jobs ssh` while the Job is still scheduling only after it becomes available; it previously failed immediately before the Job was running. Non-detached `hf jobs run` and `hf jobs uv run` previously exited 0 regardless of Job outcome.
REQUIREMENTS AND LIMITATIONS
- Version: v1.20.0
- JOB_IDS... (required): One or more Job IDs, or `namespace/job_id`; every Job must belong to the same namespace.
- --timeout TEXT: Maximum wait duration; accepts an integer followed by `s` (seconds, default unit), `m` (minutes), `h` (hours), or `d` (days).
- --namespace TEXT: Namespace where the Job runs; defaults to the current user’s namespace.
- --token TEXT: Hugging Face User Access Token.
- `hf jobs wait` exits 0 only if all waited-on Jobs ended `COMPLETED`.
- `wait_for_job` returns final `JobInfo` on failure and only raises `TimeoutError` on timeout.
- SSH launch requires `--ssh` and an SSH key registered on huggingface.co/settings/keys.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.20.0
- https://github.com/huggingface/huggingface_hub/pull/4345
- https://huggingface.co/docs/huggingface_hub/en/package_reference/cli
Check the installed version and the source before using it. Entry JSON