Check the HfApi documentation page for the reference of methods to manage your Jobs on the Hub.
( **kwargs )
Parameters
str) —
Job ID. datetime or None) —
When the Job was created. str or None) —
The Docker image from Docker Hub used for the Job.
Can be None if space_id is present instead. str or None) —
The Docker image from Hugging Face Spaces used for the Job.
Can be None if docker_image is present instead. List[str] or None) —
Command of the Job, e.g. ["python", "-c", "print('hello world')"] List[str] or None) —
Arguments passed to the command Dict[str] or None) —
Environment variables of the Job as a dictionary. Dict[str] or None) —
Secret environment variables of the Job (encrypted). str or None) —
Flavor for the hardware, as in Hugging Face Spaces. See SpaceHardware for possible values.
E.g. "cpu-basic". JobStatus or None):
Status of the Job, e.g. JobStatus(stage="RUNNING", message=None)
See JobStage for possible stage values. JobOwner or None):
Owner of the Job, e.g. JobOwner(id="5e9ecfc04957053f60648a3e", name="lhoestq", type="user") Contains information about a Job.
Example:
>>> from huggingface_hub import run_job
>>> job = run_job(
... image="python:3.12",
... command=["python", "-c", "print('Hello from the cloud!')"]
... )
>>> job
JobInfo(id='687fb701029421ae5549d998', created_at=datetime.datetime(2025, 7, 22, 16, 6, 25, 79000, tzinfo=datetime.timezone.utc), docker_image='python:3.12', space_id=None, command=['python', '-c', "print('Hello from the cloud!')"], arguments=[], environment={}, secrets={}, flavor='cpu-basic', status=JobStatus(stage='RUNNING', message=None), owner=JobOwner(id='5e9ecfc04957053f60648a3e', name='lhoestq', type='user'), endpoint='https://huggingface.co', url='https://huggingface.co/jobs/lhoestq/687fb701029421ae5549d998')
>>> job.id
'687fb701029421ae5549d998'
>>> job.url
'https://huggingface.co/jobs/lhoestq/687fb701029421ae5549d998'
>>> job.status.stage
'RUNNING'( value names = None module = None qualname = None type = None start = 1 )
Enumeration of possible stage of a Job on the Hub.
Taken from https://github.com/huggingface/moon-landing/blob/main/server/job_types/JobInfo.ts#L61 (private url).