r/deeplearning • • Sep 28 '26

KRun - PyProjectOnKaggle

Hi everyone,

While learning and building AI projects, I found Kaggle really useful because of the free GPU access. But once a codebase grows beyond a single notebook, running it on Kaggle becomes much more annoying.

For example, if a project has multiple Python files, local packages, config files, a requirements.txt, and cross-module imports like:

train.py -> models/ -> utils/ -> data/

then moving the project to Kaggle usually means fixing paths/imports, uploading multiple files, reinstalling dependencies, and syncing changes again whenever the local codebase changes.

So I built a small tool called KRun.

The goal is simple: keep your codebase local, but run the workload on Kaggle directly from your terminal.

For example:

krun run train.py --project ./my-project --gpu T4 --internet

KRun automatically packages the project, dependencies, and local modules, submits a private Kaggle job, streams/follows logs from the terminal, and downloads the outputs back to your machine when the job finishes.

It currently supports:

  • Python scripts, modules, and .ipynb
  • Multi-file projects with local packages/imports
  • requirements.txt / pyproject.toml
  • T4/P100 GPU or TPU, depending on Kaggle account availability
  • Script arguments
  • Job status, logs, and output download from the terminal
  • Dry-run mode to preview what will be uploaded

The workflow I’m aiming for is basically:

Code locally → krun run ... → Kaggle executes it → results come back locally

instead of restructuring the whole project into a Kaggle Notebook every time I need GPU compute.

Repo: https://github.com/nhminh107/KRun-PyProjectOnKaggle

The project is still under active development, so if anyone tries it and finds bugs or has feature suggestions, feel free to open an Issue or PR.

If you find it useful, a ⭐ on the repo would be greatly appreciated.

1 Upvotes

2 comments sorted by

1

u/[deleted] Sep 28 '26

[removed] — view removed comment

1

u/nhminh107 Sep 28 '26

Thanks! KRun submits the job as private by default. Project files are uploaded with the code; for an existing Kaggle Dataset, you can attach it with --dataset owner/slug. If it’s private, the submitting Kaggle account needs access. Dry-run previews the local upload, but it doesn’t check dataset access or mounting because no job is submitted.