Skip to main content

KaggleFleet: run local Jupyter notebooks on Kaggle GPUs across your research team's own accounts

PyPI version Python versions CI MIT license Linux, macOS, WSL

Run your local Jupyter notebooks on Kaggle GPUs, across your research team's own Kaggle accounts,
from the terminal, a local web panel, or an AI agent.

Install · Quick start · Web panel · AI agents · Changelog

Terminal demo: list accounts and notebooks, push a notebook to a co-author's account, check status and logs, download the outputs

pipx install kaggle-fleet
kfleet account login --label "Me"
kfleet run push train.ipynb --watch      # runs on a Kaggle GPU, downloads outputs when done

Why KaggleFleet?

Kaggle gives every account a free weekly GPU quota. A research group with several co-authors has several quotas, but using them means logging in and out of Kaggle, copying notebooks around, and tracking who ran what. KaggleFleet does that part for you:

  • Keep your notebooks local. Edit in your own editor and git repo; KaggleFleet stages and pushes them as Kaggle kernels.
  • One machine, many co-author accounts. Each Kaggle account lives in its own credential sandbox, so runs can go to different accounts at the same time without leaking into each other.
  • Push, watch, collect. Pick an account and accelerator (T4, P100, TPU or CPU), push, follow status and logs, and download the outputs when the run finishes.
  • A web panel for the team. Accounts, approximate GPU hours used per account this week, live job status, logs, and one-click launches.
  • Built for AI agents. Every CLI command has --json output and meaningful exit codes, and AGENTS.md documents the workflow for coding agents.
  • No runtime dependencies besides the official kaggle CLI. The tool itself is pure Python standard library.
Accounts Jobs
Accounts view Jobs view

Contents

Install

You need Python 3.9 or newer on Linux or macOS. On Windows, use WSL.

pipx install kaggle-fleet          # recommended: isolated, puts `kfleet` on your PATH
# or
pip install kaggle-fleet

To try the latest unreleased code: pipx install git+https://github.com/towhaEL/KaggleFleet.git.

This installs two commands, kfleet and its longer alias kaggle-fleet, and pulls in the official kaggle CLI. Browser sign-in (kfleet account login) requires Kaggle CLI 2.x. API-key accounts work with 1.7 and newer.

Check your setup:

kfleet doctor

Quick start

cd my-research-project/            # a folder with your notebooks, or a ./notebooks subfolder

kfleet account login --label "Me"  # sign in with your Kaggle account in the browser
kfleet notebook list               # see what KaggleFleet found
kfleet run push train.ipynb --watch

To try it on something small first, push examples/hello_gpu.ipynb, which reports the GPU it got.

With --watch, KaggleFleet polls the run until it finishes and then downloads the kernel's output files to ./outputs/<kernel-slug>/. Without it, the push returns right away and you can check on the run later:

kfleet run list
kfleet run status            # latest job; or pass a job id / kernel slug
kfleet run logs
kfleet run download

Or open the web panel:

kfleet serve --open          # http://127.0.0.1:8080

Adding co-author accounts

Each co-author adds their own account once, on the machine that runs KaggleFleet.

kfleet account login --label "Co-author B"

This opens Kaggle's sign-in page in your normal browser. Whichever Kaggle account is signed in there is the account that gets added, so switch the browser to the co-author's account first, or use --no-browser to get a link you can open in a private window or on another device and paste the verification code back.

The login runs inside a throwaway sandbox. Your own ~/.kaggle login is never read or changed, and adding an account that is already configured and valid is refused. If an account has become invalid (for example its token expired or was revoked), sign in again as that account: its credentials are replaced in place and it keeps its ID and job history.

In the web panel, Sign in with browser offers the same flow as a link plus a code field, which works well when a co-author signs in from their own laptop.

Option B: API key (kaggle.json)

The co-author creates a token at kaggle.com → Settings → API → Create New Token and sends you the kaggle.json file, or its username and key:

kfleet account add --username alice --key 0123456789abcdef... --label "Alice"

Option C: import what is already on this machine

kfleet account import        # picks up ~/.kaggle/kaggle.json and ~/.kaggle/credentials.json

Managing accounts

kfleet account list
kfleet account test alice    # checks that the credentials authenticate as *alice*, not just as someone
kfleet account switch alice  # change the default account for pushes
kfleet account remove alice  # deletes the local sandbox only; the Kaggle account is untouched

Running notebooks

kfleet run push 02_train.ipynb \
    --account bob \
    --accelerator NvidiaTeslaP100 \
    --dataset bob/preprocessed-data \
    --kernel-source alice/nb-00-data-prep \
    --max-runtime 7200 \
    --watch
Option Meaning
--account, -a Account id or username, or auto to pick the valid account with a free session slot and the most estimated quota left. Defaults to the active account.
--accelerator NvidiaTeslaT4 (default), NvidiaTeslaP100, TpuV5E8 or None
--no-gpu Run on CPU
--no-internet Disable internet access inside the kernel
--dataset, --competition, --kernel-source, --model Attach Kaggle inputs. Each flag can be repeated.
--title, --slug Override the kernel title and slug, which are derived from the notebook by default
--max-runtime SECONDS Ask Kaggle to stop the kernel after this long. The default is Kaggle's own session limit.
--watch, -w Wait for completion, then download outputs (turn this off with --no-download)
--timeout SECONDS How long --watch waits. The kernel itself is not affected.
--strip-outputs Upload a copy of the notebook without saved cell outputs. Your file is not changed.
--force Push even when preflight checks fail (see below)
--on-complete CMD, --on-error CMD Shell command to run when the watched job completes, or fails or is cancelled. Gets the event as JSON on stdin and KFLEET_* environment variables.

Kernel naming. The kernel title comes from the notebook's first # heading. The slug comes from the file name: 02_train.ipynb becomes <username>/nb-02-train. File names that start with a digit get a prefix, nb- by default; set KAGGLE_FLEET_SLUG_PREFIX=myproject to use your project's name instead. Kernels are always created as private.

Re-running a notebook pushes a new version of the same kernel. Every push starts a new run on Kaggle and uses GPU quota.

Preflight checks. Before pushing, KaggleFleet checks for problems that would waste a push and stops without contacting Kaggle if it finds one. It blocks the push when the notebook has no non-empty code cells, the account's last sign-in test failed, the account already has 2 active GPU/TPU runs, or its estimated weekly quota is used up. It also warns when fewer than 2 quota hours are left or the notebook carries more than 1 MB of saved outputs. --force pushes anyway. Usage is estimated from KaggleFleet's own job history, so if a run that already finished still shows as active, refresh it with kfleet run status <job>.

Notifications

KaggleFleet can tell you when a run finishes or fails, through Telegram, a webhook (Slack, Discord or anything that accepts JSON) or a local shell command:

kfleet notify telegram --chat-id 123456789     # asks for the bot token without echoing it
kfleet notify webhook https://hooks.slack.com/services/...
kfleet notify command 'notify-send "KaggleFleet" "$KFLEET_MESSAGE"'
kfleet notify events COMPLETE ERROR CANCELLED DOWNLOADED
kfleet notify test
kfleet notify status                            # secrets are never shown

Settings are stored in ~/.kaggle_fleet/notifications.json (mode 0600). For Telegram you can instead set KAGGLE_FLEET_TELEGRAM_BOT_TOKEN and KAGGLE_FLEET_TELEGRAM_CHAT_ID. Credentials that appear in error text are masked before a message is sent.

There is no background daemon yet, so notifications are sent only by a kfleet process that notices the change: run push --watch, run status, or a running kfleet serve.

Usage reports

kfleet report usage                            # Markdown, current quota week
kfleet report usage --since 30d -f html -o usage.html
kfleet report usage --since all -f csv -o usage.csv

For each account the report shows GPU and TPU hours used and GPU hours left this quota week, active runs, jobs by outcome, average run time, average queue wait and overhead, and the size of downloaded outputs. --since (week, all, 7d or an ISO date) sets the period for the job counts. Quota hours always cover the current quota week.

Web panel

kfleet serve                       # http://127.0.0.1:8080
kfleet serve --port 9000 --open

The panel has three views:

  • Accounts: add, test, switch and remove accounts, with each account's estimated GPU hours this quota week and a countdown to the weekly reset.
  • Launch notebook: pick a notebook, an account and hardware, then push.
  • Jobs: live status, logs, refresh and download for every run.

The panel has no login. It listens on 127.0.0.1 and rejects requests from other websites (it checks the Origin and Host headers and requires JSON request bodies). To use it from another machine, prefer an SSH tunnel over exposing it:

ssh -L 8080:127.0.0.1:8080 your-gpu-box     # then open http://127.0.0.1:8080 locally

The panel is backed by a small JSON REST API, documented in docs/rest-api.md.

Using KaggleFleet from AI agents and scripts

Add --json to any command, before or after the subcommand, to get a single JSON document on stdout. Failures print {"error": "..."} and exit with a non-zero code. Account secrets are never printed.

$ kfleet run push 02_train.ipynb --account bob --json
{
  "success": true,
  "job": {
    "id": "job_20261121_101500_nb-02-train_3f2a",
    "kernel_id": "bob/nb-02-train",
    "status": "RUNNING",
    ...
  }
}

$ kfleet run status job_20261121_101500_nb-02-train_3f2a --json
$ kfleet run logs   job_20261121_101500_nb-02-train_3f2a --json
$ kfleet run download job_20261121_101500_nb-02-train_3f2a --json   # lists the downloaded files

AGENTS.md is a guide written for coding agents such as Claude Code or Codex: the workflow, the JSON shapes, how to pick an account with spare GPU quota, and what not to do. Copy it, or link to it, from your research repo's own AGENTS.md / CLAUDE.md.

Configuration

Environment variable Default Purpose
KAGGLE_FLEET_DIR ~/.kaggle_fleet State: accounts, credential sandboxes, job history, staging
KAGGLE_FLEET_NOTEBOOKS_DIR ./notebooks if it exists, else . Where notebooks are discovered
KAGGLE_FLEET_OUTPUTS_DIR ./outputs Where kernel outputs are downloaded
KAGGLE_FLEET_KAGGLE_BIN auto-detected Path to the kaggle executable
KAGGLE_FLEET_SLUG_PREFIX nb Prefix for slugs derived from file names that start with a digit
KAGGLE_FLEET_TELEGRAM_BOT_TOKEN, KAGGLE_FLEET_TELEGRAM_CHAT_ID unset Telegram notifications without a config file
KAGGLE_FLEET_QUOTA_RESET sat 00:00 Weekly quota reset as <weekday> HH:MM in UTC; change it if Kaggle's quota page shows a different reset

--notebooks-dir and --outputs-dir override the matching variables for a single command.

How credential isolation works

Every account gets a private directory, ~/.kaggle_fleet/envs/<account-id>/ (mode 0700, files 0600). Each kaggle command for that account runs with:

  • KAGGLE_CONFIG_DIR pointing at that directory, and
  • HOME set to a per-account home whose .kaggle links to that directory. The Kaggle SDK reads OAuth tokens from the hard-coded path ~/.kaggle/credentials.json and ignores KAGGLE_CONFIG_DIR, so without a separate HOME, every OAuth account would silently run as whoever is logged in to your real ~/.kaggle.
  • Any KAGGLE_KEY or KAGGLE_API_TOKEN from your shell removed, because those take priority over all other credentials.

When the Kaggle CLI refreshes an OAuth token, the new token is copied back into accounts.json. kfleet account test checks the identity Kaggle reports (kaggle config view), so a credential leaking from another account would be caught instead of passing silently.

Credentials are stored unencrypted on disk and protected only by file permissions, the same way the Kaggle CLI stores them. Run KaggleFleet on a machine you trust. See SECURITY.md.

CLI reference

kfleet [--json] [--notebooks-dir DIR] [--outputs-dir DIR] <command>

account   list | add | add-oauth | login | switch | test | remove | import
notebook  list | inspect <notebook>
run       push <notebook> | list | status [job] | logs [job] | download [job]
serve     [--host] [--port] [--open] [--allow-host HOST]
doctor
notify    status | telegram | webhook <url> | command <cmd> | events <EVENT...> | remove <channel> | test
report    usage [--since] [--format md|html|csv|json] [-o FILE]

Run kfleet <command> <subcommand> --help for every option. python -m kaggle_fleet works the same way as kfleet.

Limitations

  • The GPU hours shown are estimates. They count only runs launched through KaggleFleet, and a run's end time is when KaggleFleet noticed it finished. Kaggle's own quota page is authoritative.
  • Status is polled. Status comes from kaggle kernels status, so runs are refreshed while you watch them (CLI --watch or the web panel) or when you ask (run status).
  • Kernels cannot be cancelled from here because the Kaggle CLI does not support it. Stop a run on kaggle.com.
  • Linux and macOS only (symlink-based sandboxes). On Windows, use WSL.

Development

git clone https://github.com/towhaEL/KaggleFleet.git
cd KaggleFleet
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

pytest                 # or: python -m unittest discover -s tests -t .
ruff check src tests

The test suite never contacts Kaggle: the kaggle CLI is mocked or replaced with a fake script. See CONTRIBUTING.md.

Contributing and releases

Bug reports, feature ideas and pull requests are welcome. Please read CONTRIBUTING.md first, and report security issues privately as described in SECURITY.md.

Releases are listed on the GitHub releases page and PyPI. Maintainers: see docs/RELEASING.md.

License

MIT

Metadata

Release files for kaggle-fleet 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kaggle-fleet 0.2.0
File Size Uploaded Provenance Actions
kaggle_fleet-0.2.0.tar.gz 107.6 kB With provenance Details for kaggle_fleet-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kaggle-fleet 0.2.0
File Interpreter ABI Platform Actions
kaggle_fleet-0.2.0-py3-none-any.whl Python 3 none any Details for kaggle_fleet-0.2.0-py3-none-any.whl

Total release size: 191.3 kB

Release files / kaggle_fleet-0.2.0.tar.gz

Download URL kaggle_fleet-0.2.0.tar.gz
Size 107.6 kB
Tags Source
SHA-256 checksum
How to use checksums
97746751b6ebc1161b1a9ec39b0f64e86662593ca2bcf643626b7e91d10b29a5
BLAKE2b-256 checksum
How to use checksums
71cc6078b2604c286131a53c372e50d4b9794faabaa1a897ae44a029b6d933de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / kaggle_fleet-0.2.0-py3-none-any.whl

Download URL kaggle_fleet-0.2.0-py3-none-any.whl
Size 83.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1db01abdd18e57f74549dcb9e2c0cf3679dd663fb8f82310ccc85dd2159c6848
BLAKE2b-256 checksum
How to use checksums
ae8c5b7c665a40e05487a7421422f2223f53122cdba86a52c292cbe9a8c83083
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for kaggle-fleet 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kaggle_fleet-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page