New on main: port forwarding and session history

A Kaggle notebook as your remote dev box.

One command starts a GPU box you can ssh into or open in VS Code. Leave whenever you like: your files are there next time, on any account in your Kaggle group, from any machine.

uv tool install kdev-cli
Read the docs
GPU-hours a week, per account
30
TPU-hours a week, per account
20
RAM on a T4 box
31 GB
public ports opened
0
~/project — zsh
kdev up submits the notebook, waits for a machine, installs an SSH server, starts the Cloudflare tunnel and restores 1505 files, then ssh kaggle opens a root shell with two T4 GPUs.
What you get

A notebook that behaves like a server you own.

Kaggle's API can save a notebook and run it. It has no "give me a shell" call. kdev adds that, then fixes what makes a notebook a bad place to keep work.

Files that come back

Whatever is in /kaggle/working when a session ends returns at the next start, however it ended. Kaggle keeps the files; kdev puts back the symlinks, empty folders and exec bits it drops, so a virtualenv survives.

v14 · sessionv14kept by Kagglenext kdev uplinksdirs+xends any wayregular files

One box, pooled quota

Each account in your Kaggle group brings 30 GPU-hours and 20 TPU-hours a week to the same notebook. When one runs short, kdev up asks which takes over.

Kaggle's machine, your editor

Pick the accelerator once and every kdev up uses it. The box runs Kaggle's own image with 934 packages already installed and the internet switched on, so pip, apt and git work as usual.

$ kdev config set gpu t412h sessions · 30 GPU-hours a week
measured on a live T4 box · 15 Nov 2026
NVIDIAGPU 0
Tesla T4
15 GB VRAM
NVIDIAGPU 1
Tesla T4
15 GB VRAM
RAM31 GB
CPU4 vCPU
Disk20 GB saved · ~960 GB scratch free

Ubuntu 22.04 · CUDA 12.8 · 934 packages preinstalled

  • Python3.12
  • PyTorch2.10
  • TensorFlow2.20
  • JAX0.7
  • Transformers5.0
  • scikit-learn1.6
  • pandas2.3
  • NumPy2.0
  • Jupyter
  • uv
  • VS Code

    Remote-SSH just works

    The box is a host called kaggle in ~/.ssh/config. Open a folder, install extensions, debug on the GPU.

  • tunnel

    No open port

    Both ends dial out to Cloudflare and meet at a hostname that never changes. Public-key auth only.

  • git

    A repo that keeps up

    Set git-remote and the box clones it at boot, pushes every 15 minutes and once more at teardown.

  • forwardnext release

    Ports to localhost

    kdev forward 8888 puts Jupyter, TensorBoard or your API on localhost, with a clear error if nothing listens.

  • warnnext release

    Warned before the end

    Every open shell hears about it 15 and 5 minutes before the session runs out.

  • json

    Built for scripts

    status, history, account and workspace files speak --json. Every prompt has a flag; NO_COLOR is honoured.

How it works

One cell on top of your notebook.
Six steps to a shell.

The simple picture is on the right. When you want every module, file and API call, open the full architecture.

Your machine talks to the Kaggle API to start the box; the box dials out to Cloudflare's edge, which your ssh reaches by hostname; saved notebook versions are restored into the box.Your machinekdevVS Code / sshKaggle APIsave · run · quotaSaved versionsv12 · v13 · v14 …CloudflareedgeThe boxa notebook sessionsshd · tunnel/kaggle/workingT4 ×2
Architecture

How kdev is built

Your machinelaptop, any OS kdev runs on
The networkCloudflare and your git host
Kaggleapi.kaggle.com and storage
The boxone notebook session
Your files

However it ends,
you start where you were.

Kaggle starts every batch session with an empty /kaggle/working. kdev finds the version you left off at, and the new box downloads it before you connect. Eight ways a session ends, each measured.

~/project — zsh

What the next kdev up gives you

Everything

It stops early and hands the quota back. Kaggle keeps /kaggle/working as that version's output.

Commands

Four commands a day.
The rest are one question away.

  1. once
    $ kdev setup

    SSH key, cloudflared, Kaggle sign-in, workspace, tunnel. Only what is missing.

  2. start
    $ kdev up

    Starts the box, or connects to the one already running.

  3. work
    $ ssh kaggle

    Or VS Code → Remote-SSH → kaggle. Leave whenever you like.

  4. optional
    $ kdev down

    Stop early and hand the quota back. Files are saved anyway.

The box

Start, reach, watch and stop it
  • kdev

    The overview: the box, every account’s quota, the workspace, then a menu of what makes sense now.

    $ kdev
  • kdev up

    Start the box, or connect to the one already running from any account or machine.

    --gpu--hours--account--open--no-restore--replace-y

    $ kdev up --gpu t4 --hours 9
  • kdev ssh

    A shell on the box. Pass a command after --; ssh's exit code is kdev's.

    -- ARGS

    $ kdev ssh -- python train.py
  • kdev forwardnext release

    Forward localhost ports to services on the box, with a clear error if one is taken or nothing listens.

    PORTLOCAL:REMOTE

    $ kdev forward 8888 9000:6006
  • kdev status

    Running? Who started it, when it ends, whether it answers, and the restore state.

    --json

    $ kdev status --json
  • kdev logs

    What the box itself is saying: the session log, without the kernel’s noise.

    -n N--all

    $ kdev logs -n 50
  • kdev down

    Stop the box now. It saves /kaggle/working however it stops; cancels as the starting account if it must.

    --account--session-id

    $ kdev down

Files & history

What was saved, and getting it back
  • kdev restore

    Finish or repeat the restore on the running box, or add what an older version has. Never a rollback.

    --from vN--from-backup

    $ kdev restore --from v12
  • kdev workspace files

    Exactly what a saved version holds: what the next kdev up would restore.

    --version vN--json

    $ kdev workspace files --version v12
  • kdev historynext release

    Recent saved sessions: who ran them, how they ended, how many files, restore state.

    -n N--json

    $ kdev history -n 5
  • kdev backup

    An exact copy of the running box on this machine, kept in ~/.config/kdev/workspace.

    $ kdev backup

Accounts & workspace

Who pays, and the shared notebook
  • kdev account

    Every signed-in account with its GPU and TPU hours left this week.

    --json

    $ kdev account
  • kdev account use

    Pick the account that runs, and pays for, the next box.

    $ kdev account use bob
  • kdev account add

    Sign an account in through the browser; run it again to refresh a token.

    $ kdev account add bob
  • kdev workspace

    The shared notebook: owner, sharing, members and saved versions.

    $ kdev workspace
  • kdev workspace create

    Make the group notebook and share it as Can Edit. The owner runs this once.

    --group

    $ kdev workspace create --group my-team
  • kdev workspace join

    Use the group notebook someone already shared with you.

    $ kdev workspace join

Setup & health

Once per machine, and when something is off
  • kdev setup

    Get this machine ready. Does only what is missing, so it is safe to run again.

    $ kdev setup
  • kdev tunnel setup

    Create the Cloudflare tunnel and its DNS record in your zone, once.

    $ kdev tunnel setup
  • kdev config set

    Change a setting: gpu, hours, git-remote, ssh-alias and the rest. kdev config lists them.

    KEY VALUE

    $ kdev config set gpu t4
  • kdev doctor

    Check every dependency, account token, the workspace and the tunnel DNS. Exits 1 if something is broken.

    --fix

    $ kdev doctor --fix

Exit codes: 0 ok · 1 failed, with the command that fixes it · 2 usage · 130 cancelled. Add -v to any command to log each Kaggle API call. Full reference →

Security and limits

Plain about what
it can't do.

kdev is a thin layer over Kaggle and Cloudflare. It does nothing to hide what it does, and it is not a way around anyone's rules.

Security and limits, in full →
  • Public-key SSH only

    Password login is off. The box accepts the keys saved in the workspace; delete a line to revoke a machine.

  • Secrets live in the notebook

    Kaggle has no API for notebook Secrets, so tunnel credentials sit in the private notebook. Anyone with Can Edit can read them.

  • Kaggle's limits still apply

    12 hours per GPU session, 9 on TPU, a weekly quota per account, 20 GB of /kaggle/working saved per version.

  • Know the rules you work under

    Kaggle allows one account per person and restricts tunnelling out of notebooks. Accounts have been banned for both. kdev hides nothing.

Questions

Asked before
you install.

Still unsure? Ask in Discussions.

How do I SSH into a Kaggle notebook?

Install kdev (uv tool install kdev-cli), run kdev setup once, then kdev up. kdev submits your notebook with a small cell on top that starts an SSH server and a Cloudflare tunnel, then writes a host called kaggle into ~/.ssh/config. After that, ssh kaggle gives you a root shell on the Kaggle machine.

Can I use VS Code with a free Kaggle GPU?

Yes. Once kdev up reports ready, open VS Code, choose Remote-SSH and connect to the host kaggle. Extensions, the terminal and the debugger run on the Kaggle box with its GPUs, CUDA and Python environment.

How do I keep my files between Kaggle sessions?

Kaggle saves /kaggle/working as the output of every Save & Run All session, however it ends. kdev finds the version you left off at and restores it into the next box before you connect, including the symlinks, empty folders and executable bits Kaggle drops, so a virtualenv keeps working.

What hardware does a kdev box get?

Whatever Kaggle gives the account: CPU, two NVIDIA T4s, a P100 or a TPU, and L4, A100 or H100 where an account has them. A T4 box we measured had 2 × 15 GB of VRAM, 31 GB of RAM, 4 vCPUs, Python 3.12, CUDA 12.8 and over 900 preinstalled Python packages. Each account gets 30 GPU-hours and 20 TPU-hours a week; sessions last up to 12 hours, 9 on TPU.

Can several Kaggle accounts share one dev box?

Every account in a Kaggle group can run the same shared notebook, each on its own weekly quota. When the active account runs short, kdev up shows every account’s remaining hours and asks which one should run the box. Only real, distinct people’s accounts should be used: Kaggle allows one account per person.

Do I need my own domain?

No. Without a domain kdev uses a Cloudflare quick tunnel with a new hostname each session, and kdev up finds it for you. With a domain on Cloudflare’s free plan, kdev tunnel setup creates a named tunnel once and the hostname never changes.

Is kdev free, and is it official?

kdev is free and open source under the MIT licence. It is an independent project for research and education, not affiliated with or endorsed by Kaggle, Google or Cloudflare. Kaggle restricts tunnelling out of notebooks; read its terms before you use kdev.

What happens if my laptop sleeps or the Wi-Fi drops?

Nothing ends. The box keeps running on Kaggle until its time is up. Run kdev up again from any machine or account in the group and it connects to the running box instead of starting a second one.

Open source · MIT

Small, opinionated,
and open to you.

About seven thousand lines of Python with an offline test suite against a fake Kaggle. You can read the whole thing in an afternoon. For anything bigger than a fix, open an issue first and say what you want to change and why.

src/kdev

  1. cli.pyentry point, one error boundary
  2. commands/parse, call logic, render with ui
  3. session · persistence · quotathe behaviour, testable without a terminal
  4. api · auth · tunnel · sshcfgthe edges
  5. kdev_box.pystandard library only; runs on the box

✓ A bug fix comes with a test that fails without it

✓ Tests stay offline: the fake Kaggle in test_cli.py

✓ Conventional Commits, the why in the body

✓ Everything the user sees goes through ui.py

Four commands.
Then it's yours.

# once per machine
$ kdev setup
# start the box, or connect to the running one
$ kdev up
# or VS Code → Remote-SSH → kaggle
$ ssh kaggle
# optional: stop early and hand the quota back
$ kdev down

Type to search every docs page. Results load from this site; nothing is sent anywhere.