Google AI Ultra + Antigravity (AGY) · 2,000 Monthly Colab GPU Units · 10 Chronological Research ⇄ Applied Labs
Build AI History Hands-On with AGY & GPUs
Reading papers explains what changed; building and deliberately breaking each historical architecture on your included Google AI Ultra GPUs makes the intuition permanent. Activate every perk in your plan, then code straight from 2013 VAEs & Self-Attention through LangChain Drift, QLoRA, ControlNet & vLLM up to 2026 MCP, Skills & Agent Harnesses.
Yes — your Google AI Ultra plan includes 2,000 monthly Colab Compute Units (giving you cloud NVIDIA L4/A100/G4/H100 GPUs without buying a separate Colab Pro+ plan) plus Developer Program Cloud/AI Studio credits, Antigravity inside Colab, NotebookLM, Flow, and Jules. Check off each perk below as you verify it.
0 / 6 Ultra perks activated
Cloud GPUs2,000 CU / mo Included
Google Colab Premium GPUs & 24h Background Runs
Your Google AI Ultra plan automatically unlocks 2,000 monthly Colab Compute Units — enough for hundreds of hours on T4/L4 or dozens of hours on A100/G4/H100 GPUs — plus uninterrupted 24-hour background execution.
Sign into colab.research.google.com with the exact Google Account subscribed to Google AI Ultra.
Create a notebook → Runtime → Change runtime type → pick T4, L4, A100, G4, or H100.
Click the top-right RAM/Disk meter dropdown to confirm your 2,000 monthly Compute Units balance.
Mount your included 20 TB Google Drive (drive.mount("/content/drive")) to save checkpoints, LoRAs, and datasets permanently.
Pro Tip: Always disconnect your runtime (Runtime → Disconnect and delete runtime) when finished with a lab so idle GPUs stop burning Compute Units.
Agentic CodingLocal + Inside Colab
Google Antigravity (agy CLI, Desktop App & Built-In Colab CLI)
Highest Ultra limits on frontier Gemini models inside Antigravity — AND Google wired agy directly inside every Colab runtime so your agent can inspect live GPUs, notebook variables, and files side-by-side.
Locally: run agy in your terminal (or open Antigravity 2.0 Desktop App) signed into your Ultra account.
Inside Colab: press Cmd+Shift+P (or Ctrl+Shift+P) → type “Antigravity CLI” (or open the Colab Terminal) so agy runs directly on the GPU machine.
Optional bridge: install google-colab-cli (colab --gpu A100 / colab exec) so your local agy can dispatch GPU jobs straight from your Mac.
Use AGENTS.md, SKILL.md skills, and MCP servers to evolve from prompt hacks into true Harness Engineering.
Pro Tip: Start every lab by pasting its ready-made agy prompt — treat Antigravity as your pair-programming engineer while YOU run experiments and observe failures firsthand.
API & Cloud CreditsRecurring Monthly Credits
Google Developer Program Premium & AI Studio / Cloud Credits
Google AI Ultra grants Google Developer Program Premium automatically plus recurring monthly Google Cloud / GenAI API credits (accumulating up to 12 months) for Gemini API calls, embeddings, and structured outputs.
Visit developers.google.com/program (and developers.google.com/profile) with your Google AI Ultra account to verify Premium membership.
Claim your recurring monthly Google Cloud / GenAI credit allocation from your developer dashboard or one.google.com benefits page.
Open aistudio.google.com → create an API key linked to that billing project so your RAG, Structured Output, and Agent labs draw from included credits.
Set a tiny $5/mo billing alert in Google Cloud Console as good engineering hygiene.
Pro Tip: Your API labs (Labs 04, 08, 10) cost pennies in Gemini Flash / Embedding tokens — easily covered many times over by your monthly credit pool.
Research BrainHigher Ultra Limits
NotebookLM (Gemini Notebook) + Your 20 TB Drive
Upload the downloadable reference PDFs from /learn-ai straight into a NotebookLM study notebook for grounded multi-paper Q&A, citation checks, Audio Overviews, and spec generation before writing code in agy.
Run node learn-ai/download-papers.mjs --essential (or grab PDFs from the /learn-ai Reference Library) and sync them to a folder in your 20 TB Google Drive.
Create a NotebookLM notebook per Era (e.g., “Era V–VI: Attention, Quantization & Serving”) and attach the PDFs directly from Drive.
Ask NotebookLM to contrast two papers (e.g., “Compare GQA vs. DeepSeek-V2 MLA equations”) and paste its grounded architecture summary into agy as your implementation spec.
Pro Tip: Pairing NotebookLM (grounded research brain) + Antigravity (hands-on code & GPU executor) mirrors the exact two-sided Research ⇄ Applied structure of /learn-ai.
Video & Audio StudioHigher Veo Access
Google Flow (Veo Synchronized Audio-Video Studio)
Included directly on your Google AI Ultra plan: experiment with camera choreography, scene extensions, reference continuity, and synchronized audio-video generation alongside open Colab video models.
Sign into Google Flow with your Google AI Ultra account to unlock elevated Veo generation limits.
Use Flow in Lab 09 to compare closed synchronized audio-video generation directly against open Colab LTX-Video / Wan + TeaCache pipelines.
Save storyboards and output clips to your 20 TB Google Drive to track prompt/camera iteration.
Pro Tip: Comparing closed Veo 3 directing in Flow against open 3D-VAE / TeaCache pipelines on Colab A100 gives you rare practitioner intuition for both sides of video AI.
Async Cloud AgentHigh Ultra Concurrency
Jules Autonomous Cloud Coding Agent & Gemini Deep Research
Offload async repo chores (test coverage, refactors, dependency audits, doc generation) to Jules cloud VMs while Gemini App Deep Research (5× Ultra quota) synthesizes frontier literature.
Connect a GitHub learning repository (e.g., learn-ai-labs) to jules.google using your Ultra account.
Use agy interactively for core lab implementation and debugging; hand off unit-test expansion and benchmark plotting to Jules asynchronously.
Use Gemini Deep Research before tackling Era VII labs to pull fresh 2026 benchmarks on CSA2, NVFP4, or LTX-2.
Pro Tip: Experience Harness Engineering firsthand: give Jules a strict pytest suite and clear verification acceptance criteria so its cloud PRs self-verify.
Colab GPU Compute-Unit Planner
Stretch Your 2,000 Monthly Compute Units
Burn rates are approximate & vary dynamically with demand
MONTHLY ULTRA COMPUTE-UNIT BUDGET UTILIZATION (OUT OF 2,000 CU)
Select Cloud Accelerator
Accelerator
VRAM
Approx. Burn
Est. Hrs / 2,000 CU
Best Suited For in This Lab Track
NVIDIA T4
16 GB
~1.5 CU/hr
~1333 hrs/mo
Embeddings, Micro-VAE, Mini-GPT from scratch, RAG experiments & light inference
vLLM PagedAttention throughput benchmarks, fast QLoRA/DPO, LTX-Video & Wan inference
NVIDIA G4 (RTX PRO 6000)
96 GB
~10 CU/hr
~200 hrs/mo
27B–32B dense models, 70B 4-bit quantized LLMs, FLUX/SDXL ComfyUI & 14B open video models
NVIDIA H100
80 GB
~18 CU/hr
~111 hrs/mo
FP8 native Tensor Core kernels, high-speed FlashAttention / SageAttention & heavy video runs
Cloud TPU (v5e / v6e)
High-BW HBM
~2.5 CU/hr
~800 hrs/mo
JAX/Flax experiments and massive parallel batch inference
02 · The Unified Google AI Ultra Workflow
How All Five Tools Fit Together
Instead of treating each app in isolation, connect your Ultra tools into one repeatable engineering loop — from reading source papers to running GPU benchmarks and shipping self-verifying harnesses.
01NotebookLM + /learn-aiResearch Grounding
Load the Essential PDFs from your 20 TB Drive into NotebookLM to master the math, failure modes, and equations before writing a line of code.
02Antigravity (agy)Interactive Engineering
Run agy locally or press Cmd+Shift+P inside Colab to pair-program the baseline hack first, deliberately trigger the historical bottleneck, then build the modern fix.
03Colab GPU (2,000 CU/mo)Real Hardware Evidence
Measure actual VRAM bytes, tokens/sec, denoising steps, and loss curves on T4, L4, A100, and G4 GPUs — persisting checkpoints straight to your 20 TB Drive.
04AI Studio + FlowProduction APIs & Media
Spend included monthly credits on Gemini API embeddings, constrained JSON schemas, and Veo audio-video directing to contrast API vs. open-weight tradeoffs.
05Jules + Skills / MCPModern Harness Shipping
Package repeatable lab workflows as SKILL.md playbooks, wire real MCP tools, and delegate async test suites & benchmark docs to Jules.
03 · Chronological Hands-On Engineering Curriculum (Era I → Era VII)
10 Labs Building the Research ⇄ Applied Evolution Yourself
Work sequentially from 2013 to 2026. Every lab intentionally asks you to build & break the historical pattern first (brittle rules, unmasked attention, LangChain summary drift, naive vector search, raw regex JSON) before upgrading to the modern solution — with runnable code, 1-click Colab .ipynb downloads, and copyable agy pair-programming prompts.
All checkboxes save automatically in your browser
LAB 01Era I · 2013–2016ImageColab T4 (16GB)~1 CU (35 min)
Embeddings, Micro-VAE & Why Latent Space Beats Raw Pixels
Build a brittle 2015 keyword/intent matcher vs. semantic vectors, then train a real PyTorch VAE on a Colab T4 GPU in 90 seconds.
Implement the VAE Reparameterization Trick (z = μ + σ ⊙ ε) and ELBO loss (Reconstruction + KL Divergence) directly in PyTorch so you watch a continuous latent space organize clothing shapes smoothly.
First build a 2015-era rigid rule/intent chatbot (if "refund" in msg) and watch how slight paraphrasing breaks it immediately — then swap in dense vector similarity to feel why embeddings transformed NLP and visual search.
✕ 1. Break History First (Feel the Pain)
Test 5 paraphrased customer messages against a keyword intent router (watch 3/5 fail!) and try linear interpolation directly in raw pixel space (watch blurry ghosting vs. crisp VAE latent morphing).
✓ 2. Build the Modern Upgrade
Train a 2D latent VAE on Fashion-MNIST (T4 GPU) and sample a smooth 10×10 latent grid — the exact blueprint behind Stable Diffusion, SDXL, and Sora’s compressed latent VAEs.
I am doing Lab 01 (Era I: Embeddings & Micro-VAE) on a Google Colab T4 GPU. Help me run the PyTorch Micro-VAE on Fashion-MNIST, then add a side-by-side matplotlib plot comparing raw pixel-space blending vs. 2D latent-space interpolation — and show what happens when I set the KL divergence weight beta=0 vs beta=1 vs beta=4.
What You Should Observe: With β = 0 (plain autoencoder), random points in latent space decode to garbage; turning on KL divergence (β = 1) packs the latent space into a smooth bell curve where every midpoint decodes to a plausible garment!
LAB 02Era II · 2017–2019TextColab T4 or L4 GPU~1.5 CU (45 min)
Build Causal Self-Attention, RoPE & a Mini-GPT From Scratch
Code scaled dot-product attention, causal masking, and Rotary Position Embeddings (RoPE) in ~80 lines of PyTorch and train your own autoregressive Transformer.
Feel why one pretrained generative decoder replaced dozens of single-purpose task-specific microservices (sentiment, NER, QA) by watching one tiny next-token predictor learn syntax, formatting, and style from raw text.
✕ 1. Break History First (Feel the Pain)
Remove the causal triangular mask (tril) during training and watch validation loss cheat toward 0.00 while generation outputs total gibberish (future-token leakage bug!).
✓ 2. Build the Modern Upgrade
Add RoPE relative rotations + RMSNorm + temperature/top-p sampling and plot the real attention weight matrix so you see heads tracking quotes, punctuation, and indentation.
# Lab 02 — Era II (2017–2019): Mini-GPT with Causal Self-Attention & RoPE from Scratch
# Runtime: Google Colab T4 or L4 GPU (~1.5–2.8 CU/hr)
import math, torch, torch.nn as nn, torch.nn.functional as F
device = "cuda" if torch.cuda.is_available() else "cpu"
torch.manual_seed(42)
# Tiny corpus (replace with any .txt file from your 20 TB Drive!)
text = (
"Attention is all you need. Transformers attend across every token in parallel.\n"
"RoPE rotates queries and keys so dot products depend strictly on relative distance.\n"
) * 120
chars = sorted(list(set(text)))
stoi = {c: i for i, c in enumerate(chars)}
itos = {i: c for i, c in enumerate(chars)}
data = torch.tensor([stoi[c] for c in text], dtype=torch.long)
def apply_rope(x):
# x: (B, H, T, D) — Su et al. (2021) Rotary Position Embedding
B, H, T, D = x.shape
pos = torch.arange(T, device=x.device).float()
freqs = 1.0 / (10000.0 ** (torch.arange(0, D, 2, device=x.device).float() / D))
angles = torch.outer(pos, freqs) # (T, D/2)
cos, sin = angles.cos()[None, None, :, :], angles.sin()[None, None, :, :]
x1, x2 = x[..., 0::2], x[..., 1::2]
return torch.stack([x1 * cos - x2 * sin, x1 * sin + x2 * cos], dim=-1).flatten(-2)
class CausalSelfAttention(nn.Module):
def __init__(self, dim=128, heads=4, block_size=64, use_causal_mask=True):
super().__init__()
self.heads, self.head_dim = heads, dim // heads
self.use_causal_mask = use_causal_mask
self.qkv = nn.Linear(dim, dim * 3, bias=False)
self.proj = nn.Linear(dim, dim, bias=False)
self.register_buffer("mask", torch.tril(torch.ones(block_size, block_size)))
def forward(self, x):
B, T, C = x.shape
q, k, v = self.qkv(x).chunk(3, dim=-1)
q = apply_rope(q.view(B, T, self.heads, self.head_dim).transpose(1, 2))
k = apply_rope(k.view(B, T, self.heads, self.head_dim).transpose(1, 2))
v = v.view(B, T, self.heads, self.head_dim).transpose(1, 2)
att = (q @ k.transpose(-2, -1)) / math.sqrt(self.head_dim)
if self.use_causal_mask:
att = att.masked_fill(self.mask[:T, :T] == 0, float("-inf"))
att = F.softmax(att, dim=-1)
out = (att @ v).transpose(1, 2).contiguous().view(B, T, C)
return self.proj(out)
class MiniGPT(nn.Module):
def __init__(self, vocab_size, dim=128, layers=3, heads=4, block_size=64):
super().__init__()
self.block_size = block_size
self.tok = nn.Embedding(vocab_size, dim)
self.blocks = nn.ModuleList([
nn.ModuleDict(dict(
ln1=nn.RMSNorm(dim), attn=CausalSelfAttention(dim, heads, block_size),
ln2=nn.RMSNorm(dim), ffn=nn.Sequential(nn.Linear(dim, dim*4), nn.GELU(), nn.Linear(dim*4, dim))
)) for _ in range(layers)
])
self.ln_f = nn.RMSNorm(dim)
self.head = nn.Linear(dim, vocab_size, bias=False)
def forward(self, idx, targets=None):
x = self.tok(idx)
for b in self.blocks:
x = x + b.attn(b.ln1(x))
x = x + b.ffn(b.ln2(x))
logits = self.head(self.ln_f(x))
loss = F.cross_entropy(logits.view(-1, logits.size(-1)), targets.view(-1)) if targets is not None else None
return logits, loss
model = MiniGPT(len(chars)).to(device)
opt = torch.optim.AdamW(model.parameters(), lr=3e-3)
for step in range(1, 401):
ix = torch.randint(len(data) - 65, (64,))
x = torch.stack([data[i:i+64] for i in ix]).to(device)
y = torch.stack([data[i+1:i+65] for i in ix]).to(device)
_, loss = model(x, y)
opt.zero_grad(); loss.backward(); opt.step()
if step % 100 == 0:
print(f"Step {step:03d} | Cross-Entropy Loss: {loss.item():.4f}")
# Autoregressive sampling
idx = torch.tensor([[stoi["A"]]], device=device)
for _ in range(140):
logits, _ = model(idx[:, -64:])
probs = F.softmax(logits[:, -1, :] / 0.7, dim=-1)
idx = torch.cat([idx, torch.multinomial(probs, 1)], dim=1)
print("\nSampled:", "".join(itos[i] for i in idx[0].tolist()))
I am working on Lab 02 (Era II: Mini-GPT with Causal Attention & RoPE) in Colab. Help me instrument the CausalSelfAttention block to return attention weights so we can plot an interactive heatmap of what Head 0 vs Head 1 attends to, and compare Sinusoidal PE vs RoPE when extrapolating beyond block_size.
What You Should Observe: Without causal masking the model memorizes future characters and collapses at inference; with causal masking + RoPE, loss drops smoothly and sampling temperature visibly trades coherence for creativity.
LAB 03Era III–IV · 2020–2022ImageColab L4 (24GB)~2.5 CU (45 min)
Use Hugging Face Diffusers on a Colab L4 GPU to compare DDPM vs. DDIM vs. DPM++ 2M, sweep CFG scale until images “fry,” and run SDEdit strength curves.
Master Hugging Face diffusers modular Pipelines & Schedulers — the exact programmable primitives under AUTOMATIC1111, ComfyUI KSamplers, and production image APIs.
✕ 1. Break History First (Feel the Pain)
Run a 5-step Euler sampler vs. a 15-step DPM++ 2M Karras sampler, AND push guidance_scale=18.0 to see classic CFG color-burning artifacts firsthand!
✓ 2. Build the Modern Upgrade
Swap schedulers cleanly in 1 line of diffusers, find the crisp CFG sweet spot (6.5–7.5), run an SDEdit (strength = 0.25 / 0.55 / 0.85) img2img grid, and compare against a fast Rectified Flow model (FLUX.1-schnell in 4 steps!).
I am running Lab 03 (Samplers, CFG & SDEdit) on a Colab L4 GPU (24GB). Help me extend this script to save a clean labeled 2x4 comparison grid comparing DDIM vs DPM++ 2M at 10 & 20 steps, plus a 4-step FLUX.1-schnell / SDXL-Turbo Flow comparison if my Hugging Face token is loaded.
What You Should Observe: At identical 15 steps and identical seed, DPM++ 2M produces noticeably sharper details than naive DDIM; above CFG ~12 textures clip neon; and SDEdit strength cleanly acts as the exact starting noise timestep t₀.
LAB 04Era IV–V · 2022–2023TextAI Studio Credits (0 Colab CU!)0 CU (uses included AI Studio credits)
Re-Live the LangChain Era: Break Summary-Buffer Memory & Naive RAG
Deliberately build 2022 rolling summary-buffers and naive chunk vector RAG — watch both fail on exact facts & error codes — then upgrade to Hybrid BM25 + Dense RRF + Reranking.
✕ 1. Break History First (Feel the Pain)
Run 12 turns through a naive rolling summary-buffer containing an exact invoice ID (INV-88412-X) and budget ($4,210) — watch repeated re-summarization silently drop or mutate exact numbers! Then run Dense-only search on ERR_KV_9042 and watch it rank a generic blog post #1.
✓ 2. Build the Modern Upgrade
Replace rolling summaries with pinned structured memory facts (core_memory.json) + exact log search, and replace naive dense search with Hybrid BM25 + Dense Embeddings fused via Reciprocal Rank Fusion (1 / (60 + rank)).
Hands-On Milestones · Track Your Progress
Runnable Starter Code · AI Studio Monthly Credits · Antigravity CLI (agy) · Python local or Colab CPU
# Lab 04 — Era IV–V (2022–2023): Break Naive Vector RAG -> Upgrade to Hybrid BM25 + Dense RRF
# Runs locally via Antigravity (agy) or Colab CPU using your included AI Studio credits!
# !pip -q install google-genai rank-bm25 numpy
import os, numpy as np
from rank_bm25 import BM25Okapi
from google import genai
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
DOCS = [
"Runbook 4.2: Error ERR_KV_9042 occurs in vLLM when PagedAttention block tables exceed gpu_memory_utilization=0.92. Fix: set --swap-space 8.",
"Blog: General guide to GPU throughput, KV caches, and batch serving latency for large language models.",
"Architecture Note: Separating parametric weights from an updatable external document index prevents stale facts without retraining.",
"Finance Memo: Retraining hardware electricity costs rose 14% across private enterprise data centers in 2022.",
]
def embed(texts):
res = client.models.embed_content(model="text-embedding-004", contents=texts)
arr = np.array([e.values for e in res.embeddings], dtype=np.float32)
return arr / (np.linalg.norm(arr, axis=1, keepdims=True) + 1e-9)
doc_vecs = embed(DOCS)
bm25 = BM25Okapi([d.lower().split() for d in DOCS])
def retrieve(query, k=60):
# 1. BM25 lexical rank
bm_scores = bm25.get_scores(query.lower().split())
bm_rank = np.argsort(-bm_scores)
# 2. Dense semantic rank (DPR style)
q_vec = embed([query])[0]
dense_scores = doc_vecs @ q_vec
dense_rank = np.argsort(-dense_scores)
# 3. Hybrid Reciprocal Rank Fusion (RRF)
rrf = np.zeros(len(DOCS))
for r, idx in enumerate(bm_rank): rrf[idx] += 1.0 / (k + r + 1)
for r, idx in enumerate(dense_rank): rrf[idx] += 1.0 / (k + r + 1)
rrf_rank = np.argsort(-rrf)
print(f"\nQUERY: {query}")
print(" BM25 #1 :", DOCS[bm_rank[0]][:82])
print(" Dense #1 :", DOCS[dense_rank[0]][:82])
print(" Hybrid #1:", DOCS[rrf_rank[0]][:82])
retrieve("How do I fix ERR_KV_9042 in vLLM?")
retrieve("How can an AI stay current on private knowledge without retraining weights?")
I am doing Lab 04 (Breaking 2022 LangChain Summary Memory & Naive RAG, then upgrading to Hybrid RRF + Pinned State) using my Google AI Studio Gemini API key. Run this Python benchmark with me, add real `google-genai` embeddings (`text-embedding-004`), and build a tiny 10-query eval table scoring Dense vs BM25 vs Hybrid RRF.
What You Should Observe: Dense embeddings win conceptual synonyms yet lose exact codes; BM25 wins exact codes yet loses paraphrases; Hybrid RRF wins BOTH consistently — and pinning structured facts eliminates telephone-game memory drift.
LAB 05Era V · 2023SharedColab L4 (24GB) or A100~3–6 CU (45 min)
Open Weights on Your GPU: QLoRA 4-Bit Fine-Tuning & VRAM Benchmark
Measure BF16 vs. 4-bit NF4 VRAM live on your Colab L4/A100 GPU, train a custom QLoRA adapter in ~8 minutes, and save the ~40MB adapter to your 20 TB Drive.
Master the exact open-weights adaptation stack that democratized domain-specific fine-tuning on single GPUs (Hugging Face PEFT, TRL SFTTrainer, and adapter hot-swapping).
✕ 1. Break History First (Feel the Pain)
Check torch.cuda.max_memory_allocated() loading a 7B/8B model in BF16 (~15–16 GB before optimizer states — OOM on 24GB during full fine-tuning!) vs. 4-bit NF4 (~5.5 GB!).
✓ 2. Build the Modern Upgrade
Attach rank-16 LoRA adapters to q_proj, k_proj, v_proj, o_proj (~0.5% trainable params), fine-tune on a small JSON/style dataset with SFTTrainer, and hot-load the tiny 40MB adapter back onto the frozen base.
I am doing Lab 05 (QLoRA 4-bit Fine-Tuning) on a Colab L4/A100 GPU. Help me benchmark BF16 vs NF4 VRAM usage first, then run a clean 80-step TRL SFTTrainer fine-tune on a small structured-output dataset and save the LoRA adapter to my Google Drive.
What You Should Observe: Peak VRAM drops ~3× with NF4 double quantization, loss descends smoothly in minutes, and your saved adapter is ~300× smaller than saving a full fine-tuned checkpoint.
LAB 06Era V · 2023ImageColab L4 (24GB) or G4 (96GB)~3–6 CU (45 min)
Go from random “slot-machine” text prompts to repeatable, art-directed visual assets by stacking Canny/Depth ControlNet with IP-Adapter style conditioning on Colab L4/G4.
Build a repeatable production pipeline mirroring a ComfyUI node graph: lock exact architecture/pose geometry while transferring lighting & material palette from a reference photo across 4 variations.
✕ 1. Break History First (Feel the Pain)
Generate 4 images of the same room/product using text prompts alone — observe how camera angle, geometry, and style drift wildly every single seed.
✓ 2. Build the Modern Upgrade
Extract Canny edges from a reference layout, pass them through SDXL ControlNet (conditioning_scale=0.65), and attach an IP-Adapter reference photo (scale=0.55) to lock BOTH layout AND visual style simultaneously.
I am doing Lab 06 (ControlNet + IP-Adapter) on a Colab L4 GPU. Help me run this SDXL ControlNet Canny script on a sample image, add IP-Adapter style conditioning from a second reference image, and plot a 3-column grid: Input Edge Map | Text-Only Baseline | ControlNet + IP-Adapter Locked Output.
What You Should Observe: Text prompts alone randomize layout every run; ControlNet locks exact spatial edges while IP-Adapter transfers color/lighting/material texture independently via its decoupled cross-attention scale.
LAB 07Era V–VI · 2023–2024TextColab A100 (40/80GB)~5 CU (30 min)
Serving at Scale: Naive Generate vs. vLLM PagedAttention & Prefix Caching
Put your included Colab A100 GPU to work benchmarking raw PyTorch/HF generation against vLLM’s PagedAttention + Automatic Prefix Caching across 24 concurrent prompts.
Learn how production inference engines (vLLM / SGLang) and API Prompt Caching handle high concurrency and long shared system prompts without wasting 60–80% of GPU HBM.
✕ 1. Break History First (Feel the Pain)
Serve 24 prompts sequentially with standard Hugging Face model.generate() and record total wall-clock time and throughput (tokens/sec).
✓ 2. Build the Modern Upgrade
Run the exact same 24 prompts (sharing a 3,000-token system document!) through vLLM with enable_prefix_caching=True — watch throughput leap 5–10× and observe cached prefill hits!
I am doing Lab 07 (vLLM PagedAttention & Prefix Caching Benchmark) on a Colab A100 GPU. Help me benchmark naive Hugging Face `generate()` vs `vllm.LLM(enable_prefix_caching=True)` over 24 prompts sharing a 3,000-token context, and print a clean comparison table of total time, tokens/sec, and speedup multiplier.
What You Should Observe: Continuous batching + PagedAttention drives GPU Tensor Core utilization up dramatically (4–10× higher tokens/sec), and Prefix Caching reuses physical KV blocks across all 24 shared-system-prompt requests.
LAB 08Era VI · 2024TextLocal Mac + AI Studio Credits (0 CU!)0 CU (uses included AI Studio credits + local agy)
From Brittle ReAct Regex to Structured Outputs, Stateful Graphs & MCP
Build a fragile 2023 prompt-parsed tool loop, watch it crash, then upgrade to guaranteed Pydantic Structured Outputs, bounded retry graphs, and a live local MCP server wired into agy.
Implement Yao et al.’s ReAct (Thought → Action → Observation) + Shinn et al.’s Reflexion self-critique loop, then constrain decoding with JSON grammar masks.
Experience the exact 2023→2024 agent reliability leap: replacing AutoGPT-style unbounded loops and brittle JSON regexes with grammar-constrained Structured Outputs, bounded LangGraph-style state machines, and a real Model Context Protocol (MCP) server.
✕ 1. Break History First (Feel the Pain)
Prompt an LLM to emit Action: tool(arg) in raw free text and parse with regex — test tricky quotes/markdown fences until json.loads() crashes.
✓ 2. Build the Modern Upgrade
Enforce a strict Pydantic response_schema via Gemini API Structured Outputs (100% valid typed JSON!), cap retry loops with explicit state transitions, and expose a real tool (e.g., querying your /learn-ai/papers.json) as a local MCP server connected to Antigravity!
Hands-On Milestones · Track Your Progress
Runnable Starter Code · Antigravity CLI (agy) · AI Studio Credits · MCP SDK (Python/Node)
# Lab 08 — Era VI (2024): Guaranteed Structured Outputs + Bounded Tool-Calling Agent
# Runs locally via Antigravity (agy) using your included AI Studio monthly credits!
# !pip -q install google-genai pydantic
import os, json
from pydantic import BaseModel, Field
from google import genai
from google.genai import types
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
# 1. Strict Typed Contract — Constrained Decoding guarantees 100% schema adherence!
class PaperComparison(BaseModel):
innovation_a: str
innovation_b: str
bottleneck_solved: str = Field(description="Exact engineering wall that triggered the shift")
tradeoff_summary: str
recommended_for_2026: str
# 2. Native Tool Declaration (replaces brittle 2023 ReAct regex parsing)
def lookup_vram_gb(params_b: float, bits: int) -> dict:
"""Estimate GPU weight VRAM in GB for a given parameter count (billions) and bit precision."""
gb = round(params_b * (bits / 8.0) * 1.12, 2)
return {"params_b": params_b, "bits": bits, "estimated_vram_gb": gb, "fits_24gb_l4": gb <= 22.0}
# Step A: Native Tool Loop (bounded to max 4 turns — anti-AutoGPT runaway guard!)
chat = client.chats.create(
model="gemini-2.5-flash",
config=types.GenerateContentConfig(tools=[lookup_vram_gb], temperature=0.1)
)
reply = chat.send_message("Compare whether a 12B FLUX model fits on my 24GB Colab L4 GPU in 16-bit vs 4-bit.")
print("Tool-Grounded Answer:\n", reply.text)
# Step B: Schema-Guaranteed Structured Output
structured = client.models.generate_content(
model="gemini-2.5-flash",
contents="Compare Multi-Head Attention (2017) vs DeepSeek-V2 MLA (2024) for 128K serving.",
config=types.GenerateContentConfig(
response_mime_type="application/json",
response_schema=PaperComparison,
),
)
parsed = PaperComparison.model_validate_json(structured.text)
print("\n100% Valid Typed JSON:\n", json.dumps(parsed.model_dump(), indent=2))
I am doing Lab 08 (Structured Outputs + Stateful Agent Loop + Local MCP Server). First help me run this Gemini Structured Outputs + native tool loop using my AI Studio key, then help me wrap a tiny Python/Node MCP server around `learn-ai/papers.json` and connect it via Antigravity MCP config.
What You Should Observe: Grammar-constrained decoding eliminates JSON parsing exceptions completely, explicit state bounds kill infinite loops, and MCP separates tool plumbing cleanly from your agent logic.
LAB 09Era VI–VII · 2024–2026VideoColab A100 / G4 + Google Flow~6–10 CU (40 min) + Flow included
Video Diffusion Efficiency (LTX-Video / Wan) + Google Flow Audio-Video
Generate open-weight video on your Colab A100/G4 GPU, measure spacetime token count & step-caching speedups, and benchmark against synchronized audio-video in Google Flow.
Feel how LTX-Video’s high-compression 3D VAE (8×32×32, 1:192) shrinks spacetime tokens to render in seconds vs. heavy 4×8×8 backbones — plus understand TeaCache, FramePack, and LTX-2 joint audio-video.
Compare hands-on open-weight video engineering (Diffusers / LightX2V / First-Last-Frame control) directly against closed native audio-video directing inside Google Flow (included in your Ultra plan!).
✕ 1. Break History First (Feel the Pain)
Render an unoptimized 40-step clip at high resolution first to feel raw 3D spacetime attention latency and VRAM pressure firsthand.
✓ 2. Build the Modern Upgrade
Run LTX-Video’s ultra-compressed 3D VAE in BF16/FP8 on Colab A100/G4, time wall-clock seconds/clip, then craft the exact same camera-choreographed scene with synchronized dialogue & foley inside Google Flow and compare controllability vs. cinematic audio-visual cohesion!
I am doing Lab 09 (Open Video Diffusion LTX-Video on Colab A100/G4 + Google Flow comparison). Help me run this LTXPipeline script cleanly with peak VRAM & wall-clock timing, export the MP4 straight to my Google Drive, and add an image-to-video cell anchoring our Lab 06 image as Frame 0.
What You Should Observe: High-compression 3D VAEs cut render time from minutes to seconds on one GPU; open models give surgical frame/LoRA/node control while Flow/Veo currently shines on native synchronized audio-physics coherence.
LAB 10Era VII · 2025–2026SharedFull Google AI Ultra Stack (0–2 CU)0–2 CU (60 min capstone)
Capstone: Context Engineering, Agent Skills & Harness Engineering in AGY
Unite your entire Google AI Ultra stack — NotebookLM (research spec) + Antigravity agy (SKILL.md & harness loop) + Colab GPU + Jules (async PR verifier) — to ship a self-verifying AI engineering workflow.
Practice the exact 2025–2026 applied frontier: progressive-disclosure SKILL.md playbooks, context compaction & clean resets via progress.md, automated deterministic verifiers, and delegating async work to Jules.
✕ 1. Break History First (Feel the Pain)
Dump 50KB of unedited docs + noisy logs into one long multi-hour chat session without tests or handoff files — observe “context rot” and premature victory declarations.
✓ 2. Build the Modern Upgrade
Author a crisp .agents/skills/gpu-benchmark/SKILL.md playbook (progressive disclosure!), create a structured progress.md + pytest deterministic verification harness in agy, run a clean context reset mid-project, and assign test-suite expansion to Jules!
I am doing Capstone Lab 10 (Context Engineering, Agent Skills & Harness Engineering). Help me scaffold `.agents/skills/gpu-benchmark/SKILL.md`, a `progress.md` multi-session handoff template, and an automated `pytest` verifier in my lab repo — then show me how to hand off a scoped test-coverage task cleanly to Jules.
What You Should Observe: With progressive skills, persistent progress.md artifacts, and automated tests, a brand-new clean context window picks up complex engineering work immediately with higher accuracy than a bloated 150K-token thread.