Colab cli

From samirpatil2000/skills · View interactive version

Colab cli is an AI agent skill from the GitHub repository samirpatil2000/skills. Run code on Google Colab CPU, GPU (T4, L4, A100, H100), and TPU (v5e1, v6e1) runtimes via `colab`.

How to use this skill

Skill file

Colab CLI Delegation

Remote execution via colab. Non-interactive only (exec, run, install). Never run repl, console, or drivemount without a human TTY.

1. Hardware Tiers

| Tier | Hardware | Flag | Use |

|---|---|---|---|

| CPU | 2 vCPU, 13 GB RAM | (default) | Fast scripts, data parsing, testing |

| GPU Entry | Nvidia T4 (16 GB) | --gpu T4 | Inference, light fine-tuning, PyTorch |

| GPU Mid | Nvidia L4 (24 GB) | --gpu L4 | Diffusion, medium LLMs, fast inference |

| GPU Ultra | Nvidia A100 / H100 | --gpu A100 / --gpu H100 | Heavy training (paid compute units) |

| TPU | TPU v5e1 / v6e1 | --tpu v5e1 / --tpu v6e1 | JAX / PyTorch-XLA workloads |

| High-RAM | High memory shape | --high-mem | Large dataset processing (Pro/Pro+) |

2. Recipes

# One-shot ephemeral job (spins up VM, executes, tears down VM)
colab run --gpu T4 train.py --epochs 10 | tee run.log

# Ephemeral with keep-alive (inspect after finish)
colab run --gpu L4 --keep -s worker script.py

# Persistent session lifecycle (state persists between exec calls)
colab new -s job --gpu T4
colab install -s job torch transformers
colab upload -s job ./data.csv /content/data.csv
colab exec -s job -f train.py | tee train.log
colab download -s job /content/model.pt ./model.pt
colab stop -s job

# Piped stdin / inline execution
echo 'import torch; print(torch.cuda.get_device_name(0))' | colab exec -s job

# Notebook execution (writes output to <name>_output.ipynb)
colab exec -s job -f notebook.ipynb

# Save plots directly to local file
colab exec -s job -f plot.py --output-image plot.png

3. Rules & Gotchas

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.