Skip to main content

kagglex

Execute local Python code, modules, and experiments seamlessly on Kaggle GPUs and TPUs.

Overview

kagglex enables machine learning practitioners and researchers to transparently package and dispatch local Python code, standalone scripts, or complete packages to Kaggle's cloud GPU and TPU environments without tedious manual uploading or notebook maintenance.

Features

  • Flexible project detection for standalone scripts, flat packages, or src/ layout projects
  • Pre-flight validation with local AST syntax checking and credential verification
  • Automatic ignore filtering powered by pathspec supporting .gitignore and .kaggleignore
  • Dual-tier packaging preventing bloated uploads and base64 truncation
  • Automated multi-GPU execution using torchrun
  • Secure Kaggle Secrets integration for WandB, HuggingFace, and custom credentials
  • Local experiment history repository for tracking past runs, statuses, and durations
  • Interactive REPL execution on active Kaggle notebooks via Jupyter proxy URL
  • Programmatic Python SDK alongside the kagglex CLI

Installation

Install via uv or pip:

uv pip install kagglex

CLI Usage

Run a Standalone Script

kagglex run --file train.py --gpu t4-2x --title "Pilot Training"

Run a Module with Multi-GPU

kagglex run "python -m mypkg.train --epochs 10" --gpu t4-2x --multi-gpu

Stream Remote Logs in Real-Time

kagglex run "python train.py" --stream

List Recent Runs

kagglex list

Check Status or Cancel a Run

kagglex status my-experiment
kagglex cancel my-experiment

Pull Downloaded Outputs

kagglex pull my-experiment --output-dir ./results --include-outputs "*.json" "checkpoints/*"

Push a Kaggle Dataset

kagglex dataset push --data-dir ./data/embeddings --title "Embeddings Dataset"

Interactive REPL on Running Kaggle Notebooks

When a notebook is already open in Kaggle, copy its proxy URL (Run -> Kaggle Jupyter Server -> Copy URL) and run commands with sub-second feedback:

# Verify connection
kagglex exec --url "https://kkb-production.jupyter-proxy.kaggle.net?token=..." --test

# Query remote GPU status
kagglex exec --url "https://kkb-production.jupyter-proxy.kaggle.net?token=..." --gpu-info

# Execute inline Python snippets
kagglex exec "import torch; print(torch.cuda.device_count())"

# Execute a local Python file remotely
kagglex exec --file evaluate.py

# List and transfer files
kagglex exec --list-files
kagglex exec --upload ./checkpoint.pt
kagglex exec --download run_results.json -o ./local_results.json

Alternatively, set the environment variable:

export KAGGLE_JUPYTER_URL="https://kkb-production.jupyter-proxy.kaggle.net?token=..."

Python SDK Usage

from kagglex import KaggleRunner, RunConfig

runner = KaggleRunner()
job = runner.run(
    command="python -m mypkg.train --batch-size 64",
    title="Fine Tuning Run",
    gpu="t4-2x",
    multi_gpu=True,
    wait=True,
)

print(f"Status: {job.status}")
job.pull_outputs(destination_dir="./results")

Metadata

Release files for kagglex 0.1.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 kagglex 0.1.0
File Size Uploaded
kagglex-0.1.0.tar.gz 158.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kagglex 0.1.0
File Interpreter ABI Platform
kagglex-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 193.2 kB

Release files / kagglex-0.1.0.tar.gz

Download URL kagglex-0.1.0.tar.gz
Size 158.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cf0dcd1de468db85b36fa9ec2f65966623150613ccaf955167753a6c1cec57d6
BLAKE2b-256 checksum
How to use checksums
5de9bb329f31ac2fc075f9d3222341fe5565400040702e8a6490af9ba83db706
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 16, 2026.

Transparency log

Release files / kagglex-0.1.0-py3-none-any.whl

Download URL kagglex-0.1.0-py3-none-any.whl
Size 34.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ab04d8be0de4edb63fdf35e3bcf1594050062a019bd11e4f1eba7910c33e7cc
BLAKE2b-256 checksum
How to use checksums
275ce8de8a99ba509d4ec856e7021be1988359ad1704933a21b23fe228848766
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

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