cotop
top for Google Colab: compute units, runtimes and what they cost, live in your terminal.
- Your account: compute units left, the hourly rate, when you run out, and the rate over the last day. Compute units left turn red when they run out within a day.
- Runtimes: every VM on your account, most expensive first, including ones opened in a browser, with a live GPU sparkline, rate, spend, uptime and state. A runtime idle while it bills, out of RAM or disk, or unreachable says so in its row.
- The selected runtime: a braille graph of GPU utilization, read every two seconds, with VRAM, RAM and disk meters, what it has cost and its recent activity. On a runtime without a GPU, the graph shows RAM.
- History: press
hfor past sessions, how long each ran and roughly what it cost. - Actions: stop a runtime, restart its kernel, or open a shell on it.
cotop works on top of the official Colab CLI. It uses the CLI's sign-in, session names and history, so runtimes you start with colab new show up by name.
Install
uv tool install cotop
cotop
cotop --demo # a made-up account with twelve runtimes; no sign-in
cotop needs Python 3.12 or later. It is tested on macOS and should work on Linux. If you have not signed in to the Colab CLI yet, cotop runs the same Google sign-in on first launch. On macOS, Keychain may ask once whether cotop's Python can read the Colab CLI's token.
Keys
| Key | Action |
|---|---|
↑ ↓ |
Select a runtime |
h |
Past sessions and the hardware your account can use |
r |
Refresh now (cotop also refreshes every 15 seconds) |
s |
Stop the selected runtime |
k |
Restart its kernel |
x |
Open a shell on it with colab ssh |
q |
Quit |
Stop and restart ask first, and Cancel has focus. colab ssh looks for ~/.ssh/id_ed25519.pub or ~/.ssh/id_ecdsa.pub. For another key, start cotop with cotop -i ~/.ssh/KEY.pub. Restart and ssh work only on runtimes started with the Colab CLI. Stop works on any runtime.
Which numbers are estimates
Colab reports one hourly rate for the whole account, not one per runtime. cotop shows a per-runtime rate as follows:
- With one runtime, the rate is exact.
- With several runtimes on the same hardware, cotop splits the total evenly.
- Otherwise cotop uses a rate it learned earlier, when only that hardware was running. These rates are stored in
~/.cache/cotop/rates.json. - With no learned rate, the column shows
?.
Estimates start with ≈, and upper bounds start with ≤. Colab boots VMs before it assigns them, so uptime and spend count from the assignment time in the CLI's history. A runtime opened in a browser has no assignment time, so cotop counts from VM boot and shows an upper bound.
docs/data-sources.md lists each request cotop makes and what it reads.
Privacy
- cotop sends requests only to Google: Colab, and the account endpoint that supplies your email address.
- It keeps its own files in
~/.cache/cotop: learned rates, and balance and rate samples. - It never shows or stores tokens.
- From the CLI's history it shows only event types, times and file names. It never shows code, outputs or anything typed at a prompt.
Not affiliated with Google
cotop is an independent project. It relies on internal parts of google-colab-cli and on Colab endpoints that are not public APIs. Either can change without notice. cotop pins the Colab CLI's minor version for that reason.
Development
uv sync
uv run pytest
uv run python scripts/screenshots.py OUT_DIR # README screenshots, rendered from the demo account
To release, set version in pyproject.toml, then push a matching tag such as v0.1.0. The publish workflow builds the package and uploads it to PyPI with trusted publishing.
License
Metadata
Release files for cotop 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cotop-0.2.0.tar.gz | 854.5 kB | Without provenance | Details for cotop-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cotop-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for cotop-0.2.0-py3-none-any.whl |
Total release size: 884.8 kB
Release files / cotop-0.2.0.tar.gz
| Download URL | cotop-0.2.0.tar.gz |
|---|---|
| Size | 854.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f3418e156aaa8229a72896012a9ddc6cf04015e08e90f18e82cacc202a99512
|
|
BLAKE2b-256 checksum How to use checksums |
109e715e0f4d98ac83f765c7db84817d5c80ce68aebc278bb4e4c9f5874520b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cotop-0.2.0-py3-none-any.whl
| Download URL | cotop-0.2.0-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25a56cc932db1dacc78faf85b4eebf3619b9b5e26683a914517224a87e670c10
|
|
BLAKE2b-256 checksum How to use checksums |
f6851bf55eb28de79d7ed7dacc332c65bb143abae9b71412e318484ca8a91626
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for cotop 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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.