sincecutoff.com
← all changes

hf jobs run adds retries, rerun, schedule rescheduling, and port exposure

Introduced 2026-10-01 · score 0.98

HOW TO USE IT

When maintaining a Hugging Face Job workflow, use `--attempts` to retry failures, `hf jobs rerun` to create a fresh Job from a saved spec, and `hf jobs scheduled reschedule` to change a schedule. Use `hf jobs expose` to replace exposed ports on a running Job.

hf jobs run --attempts 3 --detach python:3.12 python train.py
hf jobs rerun <job_id>
hf jobs scheduled reschedule <scheduled_job_id> "0 9 * * 1" hf jobs expose <job_id> 8000 --public 9000

WHY THIS HELPS

When maintaining a Hugging Face Job workflow, retry failed jobs, rerun saved job specifications, reschedule scheduled jobs, or expose job ports.

REQUIREMENTS AND LIMITATIONS

  • Version: v2.1.0
  • --attempts <n>: Maximum attempts, including the first run; defaults to 1. `3` allows two retries.
  • --detach: Run the Job in the background and print its ID.
  • JOB_ID (required): Job ID to rerun or expose ports for.
  • SCHEDULED_JOB_ID (required): Scheduled Job ID to reschedule.
  • SCHEDULE (required): Cron expression or supported preset such as `@daily` or `@hourly`.
  • PORTS: Positional ports to expose with token-protected access; omitted ports are closed when replacing the configuration.
  • --public INTEGER: Expose a port without authentication; repeat for multiple ports. May be combined with positional token-protected ports.
  • --clear: Close all exposed ports.
  • Prerequisite: The machine must be logged in to Hugging Face; Jobs require a positive credit balance.
  • Prerequisite: Manage only Jobs you own or Jobs in organizations where you have write permission.
  • Prerequisite: Accessing token-protected exposed ports requires an HF token with read access to the Job's namespace.
  • Retries are automatic on failure.
  • A rerun starts a fresh Job using an existing Job's saved spec, including secrets and hardware settings.
  • Scheduled Jobs can change their cron expression or preset without being recreated.
  • Port exposure may be configured at Job creation time or on a running Job.
  • `expose` provides token-protected access; `expose_public` provides unauthenticated access.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card