hf_job_launch
Launch a Hugging Face GPU training script as a background job, returning immediately so you can monitor status, logs, metrics, and checkpoints while the rented machine runs.
Instructions
Run a training script on its own rented Hugging Face machine; returns immediately.
The machine is billed per minute and stops when the script ends, fails, or hits
timeout — so set timeout generously for real trainings (e.g. "6h").
The script may use the injected helpers log_metric(step, **kv),
save_checkpoint_file(path) (uploads a file or folder to the private Hub repo
<you>/<run_name>) and SEED. Follow it with get_run_status / get_logs /
get_metrics / plot_metrics, cancel with stop_run, fetch results with save_checkpoint.
flavor: machine type from hf_hardware, e.g. "t4-small", "a10g-small", "a100-large".
timeout: time limit such as "30m", "2h", "1d".
requirements: space-separated pip packages, e.g. "torch transformers peft datasets".
env_json: JSON object of extra environment variables.
image: optional Docker image that has uv installed (default: a plain Python image;
pip-installed torch brings its own CUDA libraries).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script": "<script>",
"run_name": "<run_name>"
},
"name": "hf_job_launch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | No | ||
| flavor | No | cpu-basic | |
| script | Yes | ||
| timeout | No | 1h | |
| env_json | No | ||
| run_name | Yes | ||
| requirements | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |