Google’s New Colab CLI Lets Developers and AI Agents Run Python on Remote Colab GPUs and TPUs From the Terminal
This week, Google AI crew launched the Colab CLI. The software connects your native terminal to distant Colab runtimes. It lets builders and AI brokers run code on cloud GPUs and TPUs. You keep in your terminal the complete time. The CLI is open supply below the Apache 2.0 license.
What is Google Colab CLI
The Colab CLI is a command-line interface for Google Colab. You can create classes, run code, and handle information from the terminal.
Any agent with terminal entry can name the software. That consists of Claude Code, Codex, and Google’s Antigravity. Google ships a prepackaged ability file named COLAB_SKILL.md. It offers brokers built-in context on tips on how to use the CLI.
Installation makes use of a single uv software set up command from the GitHub repository.
uv software set up git+https://github.com/googlecolab/google-colab-cli
A minimal session seems like this:
colab new # provision a CPU session
echo "print('good day')" | colab exec # run code
colab cease # launch the VM
How the Commands Work
The CLI teams instructions into classes, execution, information, and automation. colab new provisions a session, with CPU as the default. Add --gpu T4, --gpu L4, --gpu A100, or --gpu H100 for a GPU. TPU choices are v5e1 and v6e1.
colab exec runs Python from stdin, a .py file, or a pocket book. The exec reads information regionally and ships their contents. Local edits subsequently want no separate add step. colab cease terminates the session and releases the VM.
Other instructions cowl information and authentication. colab add and colab obtain transfer information between native and distant. colab drivemount mounts Google Drive, defaulting to /content material/drive. colab auth authenticates the VM for Google Cloud providers.
colab exec and Artifact Recovery: The Core Loop
The core loop is brief. You provision a runtime, run a script, then pull outcomes again. colab obtain retrieves fashions, datasets, and different information. colab log exports session historical past as .ipynb, .md, .txt, or .jsonl.
So a distant run turns into a replayable pocket book on your disk. colab repl and colab console give interactive entry to the VM. colab set up provides packages with uv, falling again to pip. Session metadata is saved at ~/.config/colab-cli/classes.json.
Example: Fine-Tuning Gemma 3 1B
Google’s official launch demonstrates an agent-driven fine-tuning job. The job fine-tunes google/gemma-3-1b-it utilizing QLoRA. It trains on a Text-to-SQL dataset to enhance SQL technology. The Antigravity agent runs the full pipeline with 5 instructions.
colab new --gpu T4
colab set up transformers datasets peft trl bitsandbytes speed up
colab exec -f finetune_run.py
colab log --output gemma_finetune_log.ipynb
colab cease
The agent then downloads the adapter mannequin, adapter config, tokenizer config, and tokenizer. You can load and serve the fine-tuned mannequin regionally. No handbook cloud provisioning command was typed by the person.
Use Cases
- Offload laptop-bound coaching to a distant GPU or TPU with out leaving the terminal.
- Let brokers like Claude Code, Codex, or Antigravity run end-to-end ML pipelines.
- Fine-tune small fashions, equivalent to Gemma 3 1B, with QLoRA remotely.
- Script pocket book execution and export replayable
.ipynblogs for reproducibility. - Debug interactively on the VM via
colab replorcolab console.
Colab CLI vs Browser-Based Colab
The CLI doesn’t substitute the pocket book UI. It targets scripted, automated, and agent-driven work as an alternative. Here is how the two workflows examine throughout widespread duties.
| Dimension | Browser-Based Colab | Colab CLI |
|---|---|---|
| Interface | Web pocket book UI | Local terminal |
| Accelerator choice | Runtime menu in the browser | --gpu / --tpu flags on colab new |
| Agent use | Manual, UI-driven | Any terminal agent by way of instructions |
| Run native scripts | Paste or add into cells | colab exec -f script.py |
| Artifact retrieval | Manual obtain or Drive | colab obtain, colab log |
| Package set up | !pip inside a cell |
colab set up (uv, then pip) |
| Session management | Browser-managed runtime | colab new, colab cease, colab standing |
| Agent ability file | None | Bundled COLAB_SKILL.md |
Strengths and Considerations
Strengths:
- Terminal-native workflow suits scripts, CI, and agent loops.
- One command provisions T4, L4, A100, or H100 GPUs.
execships native file contents, so no add step is required.- Logs export to replayable pocket book codecs for reproducibility.
- Open supply below Apache 2.0, with a bundled agent ability file.
- Works with a number of brokers, not a single vendor’s software.
Considerations:
- Access requires authentication; the default technique is
oauth2. replandconsolewant a TTY when run interactively.- Pipe stdin to make use of these two instructions inside scripts.
- Compute nonetheless runs on Colab’s backend and its runtime mannequin.
Key Takeaways
- Google’s Colab CLI runs code on distant Colab GPUs and TPUs out of your native terminal.
- One command provisions accelerators:
colab new --gpu T4viaA100andH100, plus TPUs. colab execships native.pyand.ipynbinformation to the runtime with out an add step.- Any terminal agent — Claude Code, Codex, Antigravity — can drive it by way of a bundled
COLAB_SKILL.md. - It is open supply below Apache 2.0, and
colab logexports replayable pocket book logs.
Marktechpost Visual Explainer
1 / 8
Source: Marktechpost.com
Check out the Technical details and GitHub Repo here. Also, be at liberty to observe us on Twitter and don’t overlook to hitch our 150k+ ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
Need to associate with us for selling your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar and so forth.? Connect with us
The publish Google’s New Colab CLI Lets Developers and AI Agents Run Python on Remote Colab GPUs and TPUs From the Terminal appeared first on MarkTechPost.
