
Antigravity CLI Is Now Available on Google Colab, So I Tried It Out
This page has been translated by machine translation. View original
I'm Morinaga from Classmethod Malaysia.
"I'd like to try running some of those open-weight models that have been coming out lately on my own machine."
"...But I don't have a computer with a GPU."
"Spin up a GPU instance in the cloud? No, that's overkill when I just want to try something quickly."
"...Wait, Colab has runtimes with GPUs!"
"Plain Gemini in Colab doesn't do a great job with the setup, so I'd like to use a harness."
"...Antigravity CLI supports Colab now!"
So, this time I'm writing about Google Colab and Antigravity CLI.
Antigravity CLI (agy) can now be used right next to your Google Colab notebooks. It was announced on December 2, 2026, on the official Google Colab Medium.
With Colab, you can use a GPU just by opening your browser (on the free tier, a GPU may not be available depending on availability and usage time). And now you can even leave the setup to an agent. So in this article, I launched agy on a T4 GPU runtime and asked it to "pick a lightweight model from Hugging Face, set it up, and run it." I also had it measure inference throughput and visualize text embeddings.
What is Antigravity CLI?
Antigravity CLI is the terminal version of Antigravity, Google's agentic development platform. The command name is agy. From the terminal, you can perform multi-step reasoning, file editing, and tool calls.
Note that it is a different thing from the Google Colab CLI announced in June 2026. The names are similar, so let me sort them out.
| Google Colab CLI (June 2026) | Antigravity CLI in Colab (this time) | |
|---|---|---|
| Where it runs | Terminal on your local PC | On the Colab runtime |
| What it does | Borrows a Colab runtime from your local machine and runs scripts | An agent runs next to the notebook and adds, edits, and runs cells |
| Main commands | colab new / colab exec, etc. |
agy |
Overview of this update
According to the official Medium article, the key points are as follows.
- Antigravity CLI is built into every Colab runtime and can be used on all Colab plans, including the free tier
- It runs in the same runtime as the kernel, so it can read and edit notebooks. Files, packages, and the GPU are the same ones the kernel sees
- Gemini 4 Hydrogen is available on all plans, including the free plan. With a paid Google AI Pro / Ultra plan, you can also use Gemini 4 Carbon, Gemini 4 Neon, and Orchestrator
- It is the same CLI as the
agyyou run locally, so/swarm(parallel execution of multiple agents) and plugins also work - It can be customized with
AGENTS.mdrules, skills, and MCP servers
Trying it out
Prerequisites
- A Google account (this time I tried it with my company's Google Workspace account. For differences by account type, see "Notes" below)
- No additional installation is required
Connect to a T4 GPU runtime
Open the sample notebook, choose T4 GPU from "Change runtime type" in the "Runtime" menu, and connect.

Launch Antigravity CLI
There are two ways to launch it.
- Open the command palette (
Ctrl+Shift+Pon Windows etc.,Cmd+Shift+Pon macOS) and select "Antigravity CLI" - Open "Terminal" at the bottom of the screen and run
agy
This time I launched it from the command palette.

A terminal opens on the right side of the notebook, and agy starts.
Sign-in and initial setup
On first launch, you are asked to sign in. You can choose between two login methods: "Google OAuth" and "Use a Google Cloud project." This time I chose Google OAuth, opened the displayed URL in a browser, and granted permission.

After signing in, you proceed through choosing a color scheme, confirming the terms of service and data use, and confirming whether to trust the workspace (/content).
One thing to note here. The terms of service screen has a checkbox saying "I agree to Google collecting and using Interactions data to improve Antigravity CLI," and it is checked by default.

For business use and the like, I think it's best to turn it off before pressing "Done." I turned it off and proceeded this time. As the on-screen text says, you can also opt out later in the settings.

The screen also shows a notice about the security risks of AI coding agents (autonomous code execution, data exfiltration, prompt injection, etc.). Its message is that you should check the agent's actions yourself.
Once launched, it shows the version (1.5.5), the account and plan, and the model in use (Gemini 4 Hydrogen).

Checking the selectable models with /model, this environment listed Gemini 4 Hydrogen / Carbon / Neon and Claude Opus 5.5 / Sonnet 5.5. You can also choose Effort (reasoning depth) from low to xhigh here. Which models you can actually use depends on your plan, so please also see the notes below.

This time I'll proceed with the default Gemini 4 Hydrogen (Effort: high).
Having it set up a Hugging Face model
Now for the main part. I gave the following prompt to agy (it's written in English here, but it works if you instruct it in Japanese too).
Check this runtime's GPU, then pick one lightweight text-generation model from Hugging Face that fits on a T4 and needs no HF token. Load it with transformers and have it answer a question in Japanese. At the end of this notebook, add a markdown cell explaining which model you chose and why, plus code cells for setup and inference. Run them and show the answer and the GPU memory usage.
Translated into English (from the Japanese version):
このランタイムの GPU を確認したうえで、T4 に収まり、HF トークンが不要な軽量のテキスト生成モデルを Hugging Face から1つ選んでください。transformers で読み込み、日本語の質問に答えさせてください。このノートブックの末尾に、どのモデルをなぜ選んだかを説明する markdown セルと、セットアップ用・推論用のコードセルを追加してください。それらを実行し、回答と GPU メモリの使用量を表示してください。

Shell commands and cell operations require approval
When agy tried to run nvidia-smi to check the GPU, it asked for approval to run the command.

The four choices are "allow once," "allow during this conversation," "save to settings.json and always allow," and "cancel." Besides shell commands, approval was also requested when adding or running cells in the notebook.
Notebook operations were performed through the scripts (add_text_cell, add_code_cell, run_code_cell, etc.) of a skill called colab_notebook built into Colab. The approval screen also shows the contents of the cell it is about to add, so you can proceed while checking what it is trying to do.

Model selection and setup
After confirming that the GPU was a Tesla T4 (15GB VRAM), agy chose Qwen/Qwen2.5-1.5B-Instruct.

The reasons for the selection are written in the markdown cell added to the end of the notebook.
- About 1.54B parameters, fitting in roughly 3GB of GPU memory in float16
- Released under Apache 2.0 and downloadable without an HF token
- Supports multiple languages, including Japanese

Next, it adds and runs a code cell for setup. It finished in 59 seconds, including downloading the model (about 3GB).

The setup code that was added looks like this (excerpt).
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
assert torch.cuda.is_available(), "CUDA GPU is required."
MODEL_ID = "Qwen/Qwen2.5-1.5B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
dtype=torch.float16,
device_map="auto",
)
model.eval()
The inference cell builds a Japanese question with the chat template, calls model.generate(), and displays the answer and GPU memory usage. Inference finished in about 5–6 seconds.
| Item | Value |
|---|---|
| PyTorch Allocated | 2,952.5 MiB |
| PyTorch Peak Allocated | 2,961.4 MiB |
| PyTorch Reserved | 3,006.0 MiB |
| nvidia-smi (used / total) | 3,141 MiB / 15,360 MiB |
What I found interesting was that after running the inference cell once, agy rewrote the inference cell to use greedy decoding (do_sample=False) on its own and re-ran it. After finishing everything I asked for, it summarizes and reports the work in the terminal at the end.

From choosing a model to downloading it, running it, and checking the results, I was able to leave everything to a single prompt. Normally I'd be comparing Hugging Face model cards and calculating whether it fits in memory, so this was much easier.
Bonus experiments
Since I had the model loaded on the GPU anyway, I also asked it to do some data analysis and graphing, a common Colab use case. I continued in the same runtime and the same agy session.
Part 1: Measure inference throughput by batch size and graph it
Using the already loaded Qwen, I had it measure generation throughput and GPU memory for each batch size.
Using the Qwen model already loaded in this notebook's kernel, benchmark generation throughput on this T4. Measure output tokens/sec and peak GPU memory for batch sizes 1, 2, 4, 8, and 16 with max_new_tokens=128. Add a markdown cell and code cells at the end of the notebook, run them, show the results as a table, and plot tokens/sec and peak memory against batch size with matplotlib.
Translated into English (from the Japanese version):
このノートブックのカーネルに読み込み済みの Qwen モデルを使って、この T4 での生成スループットを計測してください。max_new_tokens=128 で、バッチサイズ 1、2、4、8、16 のそれぞれについて、出力トークン/秒と GPU メモリのピーク使用量を測ってください。ノートブックの末尾に markdown セルとコードセルを追加して実行し、結果を表で示したうえで、tokens/sec とピークメモリをバッチサイズに対して matplotlib でグラフにしてください。
agy used the model and tokenizer already loaded in the kernel as they were, without reloading the model. It clearly shows that it is running in the same runtime as the kernel. It also wrote an explanation of the measurement method (left padding, greedy decoding, warm-up, synchronizing with torch.cuda.synchronize() before measuring time, etc.) in a markdown cell on its own.
The results are as follows (46 input tokens per item, max_new_tokens=128. Reference values from a single measurement).
| Batch size | Output tokens | Elapsed time (s) | tokens/sec | Peak GPU memory (Allocated, MiB) |
|---|---|---|---|---|
| 1 | 128 | 4.495 | 28.48 | 2,959.9 |
| 2 | 256 | 4.067 | 62.94 | 2,967.2 |
| 4 | 512 | 4.536 | 112.88 | 2,981.9 |
| 8 | 1,024 | 4.693 | 218.20 | 3,011.3 |
| 16 | 2,048 | 4.211 | 486.34 | 3,074.5 |
It also made the graphs, including the titles and axis labels.

In this range, increasing the batch size barely changes the time per run, and throughput grows almost proportionally. GPU memory increased only slightly.
Part 2: Embed news headlines and make a UMAP scatter plot
The other is a classic analysis that visualizes text embeddings.
Next, a separate analysis: load 2,000 headlines from the ag_news dataset on Hugging Face (no token needed), embed them on the GPU with a small sentence-transformers model, reduce the embeddings to 2D with UMAP (install it if needed), and plot a scatter colored by news category. Add a markdown cell and code cells at the end of the notebook and run them. Also report how long the embedding step took on the GPU.
Translated into English (from the Japanese version):
次は別の分析です。Hugging Face の ag_news データセット(トークン不要)から見出しを2,000件読み込み、小さな sentence-transformers モデルを使って GPU で埋め込みにしてください。埋め込みを UMAP で2次元に削減し(必要ならインストールしてください)、ニュースのカテゴリで色分けした散布図を描いてください。ノートブックの末尾に markdown セルとコードセルを追加して実行してください。また、GPU での埋め込み処理にかかった時間も報告してください。
agy first checked whether the required packages (datasets, sentence_transformers, umap-learn) were installed. Colab had all of them from the start, so it proceeded without installing anything.
Partway through, load_dataset("ag_news") failed. Then agy switched to fancyzhx/ag_news on its own and retried, and the load succeeded. It's helpful that it looks at the error and fixes it itself.

The settings used were as follows.
- Data: 2,000 items from the shuffled AG News training data (World 509 / Sports 508 / Business 461 / Sci/Tech 522)
- Embedding model:
sentence-transformers/all-MiniLM-L6-v2(384 dimensions), run on the GPU - Dimensionality reduction: UMAP (
metric="cosine",n_neighbors=15,min_dist=0.1)
Embedding 2,000 items on the GPU took 1.8 seconds. On the other hand, UMAP runs on the CPU, so it took 41 seconds.

Sports and World formed clearly separate clusters, while Business and Sci/Tech gathered close together. Economic news and technology news have similar topics, so the result matches intuition.
Notes
What you can use varies by account type and plan
Antigravity's usage quota and available models are determined by the type of account on the Antigravity side and the Google AI plan (Google AI Pro / Ultra, etc.). It is separate from Colab's paid plans (Colab Pro, etc.), and is also a separate quota from Colab's compute resources such as the GPU.
In particular, a company Google Workspace account (an email address on a custom domain) is treated differently from a personal Google account. Depending on the organization's settings, it may not be usable, and the official docs describe switching to a personal account or using a Google Cloud project or Gemini Enterprise. In this test too, the startup screen displayed "Antigravity Starter Quota."
The Colab sample notebook also includes a cell with steps for signing in with Application Default Credentials (ADC) of a Google Cloud project and using the project's quota instead of a personal quota. For business use, it seems best to check which method fits your company's rules before using it.
The details of the plans may change in the future, so please check the official pages for the latest information.
Consent to data collection is on by default
As mentioned above, on the first-run terms of service screen, consent to the collection of Interactions data is on by default. Turn it off before proceeding if needed.
When the runtime disappears, files such as skills disappear too
According to the sample notebook, agy settings are saved to your account, but files you add under ~/.gemini (skills and rules) remain only within that runtime. The Medium article also advises keeping your own skills on Google Drive or GitHub.
Summary
Using Antigravity CLI on Google Colab, I entrusted it with everything from setting up a Hugging Face model on a T4 GPU to inference and some light data analysis.
- No installation needed; you can launch it right away from the command palette
- It runs in the same runtime as the kernel, so it uses already loaded variables and models as they are
- With a single prompt, it takes care of everything from model selection and recovering from errors to graphing the results
- Approval is requested for shell commands and for adding or running cells, and you can check the contents of the cells to be added
It greatly reduces the effort needed to "just get something running" in GPU experiments, so I think it will be handy for those who use Colab often. On the other hand, the available quota and models vary by account type and plan, so be sure to check beforehand, especially if you're using a company account.
If you're interested, try it from the sample notebook.