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.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 kagglex 0.2.0
File Size Uploaded
kagglex-0.2.0.tar.gz 160.8 kB Details

Built distribution (wheel)

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

Total release size: 195.5 kB

Release files / kagglex-0.2.0.tar.gz

Download URL kagglex-0.2.0.tar.gz
Size 160.8 kB
Tags Source
SHA-256 checksum
How to use checksums
780bf9deaffe522faefab571765e44e05e77968c3f3f9f73287ad05eeaadc508
BLAKE2b-256 checksum
How to use checksums
fd65cb874e5282fc4cff1db9041364da7a5f78f96cc04e46e846a09b00d92c53
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 17, 2026.

Transparency log

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

Download URL kagglex-0.2.0-py3-none-any.whl
Size 34.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f13149a18274bb8f2a98ee8040ca26f31398551ad1ec4bd8253ecac878d30ab2
BLAKE2b-256 checksum
How to use checksums
06c68405460f486f796f1593d7c5227ae812945b196d29add171d2c3cccfa3de
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 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

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