submit_job
Run a local Python project as a private background job on Kaggle with code, datasets, and optional GPU, returning immediately so training or batch processing runs unattended.
Instructions
Run a Python project on Kaggle as a private background job; returns immediately.
The project's code (excluding .git, virtualenvs, caches and data_dir) is bundled; on Kaggle
`entry` runs as `__main__` with cwd=/kaggle/working. Files written there become the job's
output (limit ~20 GB). If the project has requirements.txt it is pip-installed first
(needs internet=True). Each run is limited to 12 hours.
Args:
project_dir: Local project directory.
entry: Script to run, relative to project_dir (e.g. "train.py").
data_dir: Optional local directory uploaded as a private dataset for this job only.
On Kaggle its path is in env var KJOB_DATA_DIR. Subdirectories are uploaded zipped.
datasets: Existing Kaggle dataset refs ("owner/slug") to attach, mounted under
/kaggle/input. Use upload_dataset for data shared by many jobs.
gpu: Request a GPU (counts against the weekly GPU quota).
internet: Allow network access (pip installs, downloads).
ephemeral: Delete the job's kernel, outputs and per-job dataset from Kaggle after
job_output downloads them, so Kaggle storage does not fill up.
resume_from: job_id of a finished job whose output (e.g. checkpoints) this job continues
from; on Kaggle its path is in env var KJOB_RESUME_DIR (read-only).
time_limit_h: Stop the run after this many hours (max 12, Kaggle's cutoff) so its
output is saved. Env var KJOB_DEADLINE holds the deadline as epoch seconds; the run
is stopped there if the script has not exited, and job_output reports incomplete.
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": {
"project_dir": "<project_dir>",
"entry": "<entry>"
},
"name": "submit_job"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gpu | No | ||
| entry | Yes | ||
| data_dir | No | ||
| datasets | No | ||
| internet | No | ||
| ephemeral | No | ||
| project_dir | Yes | ||
| resume_from | No | ||
| time_limit_h | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||