Skip to main content

colab-dev

Run commands on Google Colab runtimes (cpu, t4, l4, g4, a100, h100, v5e1, v6e1) as if they were local — built for both humans and coding agents (Antigravity, Claude Code, Codex, Cursor, etc.).

Keep your source code, Git branches, and AI agent sessions permanently on your local machine, and prefix any command with colab-dev <target> to run it on a live Colab runtime in ~150ms.

Install & Uninstall

# Install (automatically bundles google-colab-cli)
uv tool install colab-dev  # or: pip install colab-dev

# Guided first-time setup (Google Colab sign-in, Ed25519 SSH key, optional agent skills & ~/.ssh/config)
# Or skip this and jump straight into `colab-dev t4 <cmd>` to sign in on first use.
colab-dev setup

# Verify Colab auth, SSH key, and tooling anytime (`--fix` auto-fixes missing login/key)
colab-dev doctor

Clean, complete removal (leaves zero stray config):

colab-dev clean --all
uv tool uninstall colab-dev

Quick Start

Note: Put colab-dev flags before the remote command: colab-dev <target> [colab-dev-flags] <command> [command-flags].

# Run tests, benchmarks, or Nsight Compute on a T4 (auto-creates colab-t4)
colab-dev t4 pytest tests/ -k sm75
colab-dev t4 python benchmarks/bench.py
colab-dev t4 ncu --set basic --launch-count 1 python script.py

# Multiple concurrent runtimes (same or different hardware)
colab-dev t4:1 pytest tests/attention/
colab-dev t4:2 pytest tests/linear/
colab-dev a100 --idle 30m python train.py

# Hard timeout for kernels that might deadlock (kills remote process & frees VRAM; exits 124)
colab-dev t4 --timeout 5m pytest tests/test_kernel.py

# Persist session settings (extra repos/files, env vars, idle timer) — survives VM crashes until `stop`
colab-dev config t4 --add ../sibling-repo --idle 45m --env TRITON_DEFAULT_FP_FUSION=1
colab-dev config t4
colab-dev config t4 --remove sibling-repo

# Sync files explicitly or pull remote outputs back (sync is one-way: local -> /content/work/<repo>)
colab-dev push t4
colab-dev pull t4 outputs/report.json
colab-dev t4 --pull outputs/report.json python eval.py

# Open an interactive remote shell in your synced workspace
colab-dev shell t4

# View active runtimes, settings, and compute-unit balance; stop when done
colab-dev ls
colab-dev stop t4
colab-dev stop --all

Project Config (Optional)

Define shared project defaults under [tool.colab-dev] in pyproject.toml (PEP 518) or .colab-dev.toml, and put machine-local untracked overrides (e.g., personal keys or preferred idle timer) in .colab-dev.local.toml:

[tool.colab-dev]
add = ["../sibling-repo"]
uv_args = ["--dev"]
idle = "30m"

[tool.colab-dev.env]
TRITON_DEFAULT_FP_FUSION = "1"

Precedence: CLI flags > persisted session config > .colab-dev.local.toml > .colab-dev.toml / [tool.colab-dev].

How It Works

  1. Zero ~/.ssh/config edits required: Uses an isolated SSH config under ~/.config/colab-dev/ssh_config with automatic connection reuse and stale-connection recovery.
  2. Git-aware delta sync (~150ms): Mirrors tracked + untracked non-ignored files to /content/work/<repo> over rsync (with tar fallback), leaving remote .venv and compiler caches untouched.
  3. Hash-stamped Python environments: Hashes pyproject.toml + uv.lock (or requirements.txt) and runs uv sync --dev only when dependencies change (--reinstall to force). Keeps UV_CACHE_DIR, TRITON_CACHE_DIR, and TORCHINDUCTOR_CACHE_DIR on Colab's fast local SSD.
  4. Idle auto-stop vs. hang timeout:
    • --idle 30m stops the runtime after 30 minutes with no active commands, interactive shells, or GPU compute processes (nvidia-smi) — never kills running work.
    • --timeout 5m enforces a wall-clock limit on a single command so wedged kernels terminate cleanly and release VRAM.

Metadata

Release files for colab-dev 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 colab-dev 0.1.0
File Size Uploaded Provenance Actions
colab_dev-0.1.0.tar.gz 32.6 kB With provenance Details for colab_dev-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 70.2 kB

Release files / colab_dev-0.1.0.tar.gz

Download URL colab_dev-0.1.0.tar.gz
Size 32.6 kB
Tags Source
SHA-256 checksum
How to use checksums
816ab8328c2558b91fa0b0dce69bbffd5c4d1f545642dd9f31a6f02cf7bedc78
BLAKE2b-256 checksum
How to use checksums
295b2cdd38fc05afe3f35b94c503e540c0afa4cd7ffdcba97bd6d644a0c200ab
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 Dec 3, 2026.

Transparency log

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

Download URL colab_dev-0.1.0-py3-none-any.whl
Size 37.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4458db54ef125b05647a984e27f027d98fef77702967227079b33208de1fc9d7
BLAKE2b-256 checksum
How to use checksums
f3f2238e27b8c2d508f14845f8d04f935e9e7dd60257b987c5b84c52362c75f8
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 Dec 3, 2026.

Transparency log

Security for colab-dev 0.1.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 colab_dev-0.1.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 Dec 3, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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