Zero-Shot SVG Benchmarking in Antigravity: Gemini 4 Neon vs. Claude Opus 5.5

Seeing Gemini 4 Neon ranked high on AI benchmarks made me curious how it actually holds up on a funny visual task inside Antigravity (agy), rather than asking models to generate yet another lookalike creative website.

For this run, I tested a strict zero-shot prompt with no follow-up fixes or refinements: drawing a heavy steel vault door held shut by a single yellow sticky note, rendered as a self-contained HTML file with pure inline SVG.

Harness Setup and Telemetry Rules

The benchmark script runs one model per test on high reasoning mode with a 30-minute timeout per model, logging start time, completion status, elapsed seconds, token counts, throughput (Tok/s), and turn count.

Two accounting rules shape how these numbers read:

  • Reasoning token reporting differs by model: Gemini 4 Neon reports thinking tokens separately in the Think column, whereas Claude Opus 5.5 folds thinking tokens into Output and reports 0 in Think.

  • Thinking tokens are billed at the output rate: Thinking tokens are not billed separately as a distinct line item above output rates; they are charged at the output token rate ($15.00 / 1M on Gemini 4 Neon and $20.00 / 1M on Claude Opus 5.5 in these calculations). Input tokens still matter when harness context is large or multi-turn loops repeat context, even though generation usually dominates short-prompt runs.

MetricGemini 4 NeonClaude Opus 5.5Difference / Ratio (Claude vs. Gemini)
StatusSUCCESSSUCCESSBoth completed within 30m limit
Turns11Single-shot execution
Elapsed Time (Time(s))347.61s (5.79 min)717.89s (11.96 min)+370.28s (2.07x slower on Claude)
Throughput (Tok/s)166.3101.3-65.0 tok/s (1.64x faster on Gemini)
Input Tokens9,58785,095+75,508 (8.88x higher on Claude)
Think Tokens15,5580 (folded into Output)Reported separately only on Gemini
Output Tokens42,23972,740 (incl. reasoning)+30,501 (1.72x higher on Claude)
Generated Tokens (Think + Output)57,79772,740+14,943 (1.26x higher on Claude)
Total Tokens (Input + Think + Output)67,384157,835+90,451 (2.34x higher on Claude)
Input Cost ($3/1M Gemini, $4/1M Claude)$0.0288$0.3404+$0.3116 (11.83x higher on Claude)
Generated Cost ($15/1M Gemini, $20/1M Claude)$0.8670$1.4548+$0.5878 (1.68x higher on Claude)
Estimated Total Cost$0.8957$1.7952+$0.8995 (2.00x higher on Claude)

Key Numbers Behind the Table

  • Speed and duration: Gemini 4 Neon finished in 347.61s (~5.8 minutes) at 166.3 Tok/s (57,797 / 347.61 = 166.27), while Claude Opus 5.5 took 717.89s (~12.0 minutes) at 101.3 Tok/s (72,740 / 717.89 = 101.32). Claude took 2.07x as long to finish the single-shot run.

  • Input bloat on a 1-turn prompt: Even though both runs had Turns = 1 and asked for a single 600x800 SVG gag, Claude Opus 5.5 logged 85,095 input tokens versus 9,587 on Gemini 4 Neon, an 8.88x jump (+75,508 tokens). That pushed Claude's input cost alone from $0.0288 to $0.3404.

  • Generated volume and cost: Gemini 4 Neon generated 15,558 thinking tokens ($0.2334 at $15/1M) and 42,239 output tokens ($0.6336 at $15/1M), totaling 57,797 generated tokens ($0.8670) and $0.8957 overall. Claude Opus 5.5 logged 72,740 output tokens (which includes folded reasoning) at $20/1M ($1.4548), bringing total cost to $1.7952, almost 2.00x (1.79518 / 0.895716 = 2.0042x) the Gemini run.



The CLI python code:

 
#!/usr/bin/env python3
"""
Headless benchmark runner for Google Antigravity CLI (agy).

"""

import json
import re
import shutil
import subprocess
import sys
import time
from datetime import datetime
from pathlib import Path

TIMEOUT_SECONDS = 1800 # 30 minutes per model

MODELS = [
# "gemini-4-neon-low",
# "gemini-4-neon-medium",
"gemini-4-neon-high",
# "claude-opus-5-5-low",
# "claude-opus-5-5-medium",
"claude-opus-5-5-high",
# "gemini-3-pro",
]

PROMPT = ""


def strip_markdown_fences(text: str) -> str:
cleaned = text.strip()
cleaned = re.sub(r"^```(?:html)?\s*", "", cleaned, flags=re.IGNORECASE)
cleaned = re.sub(r"\s*```$", "", cleaned)
return cleaned.strip()


def run_benchmark(model: str, base_dir: Path, timeout_s: int = TIMEOUT_SECONDS) -> dict:
work_dir = base_dir / model.replace("/", "_")
if work_dir.exists():
shutil.rmtree(work_dir)
work_dir.mkdir(parents=True)

cmd = [
"agy",
"-p",
PROMPT,
"--model",
model,
"--output-format",
"json",
]

started_dt = datetime.now()
started_str = started_dt.strftime("%Y-%m-%d %H:%M:%S")
t0 = time.monotonic()

print(
f"[{started_str}] Starting {model} (timeout={timeout_s}s) in {work_dir}...",
file=sys.stderr,
flush=True,
)

try:
proc = subprocess.run(
cmd,
cwd=str(work_dir),
capture_output=True,
text=True,
timeout=timeout_s,
check=False,
)
except subprocess.TimeoutExpired:
wall_s = round(time.monotonic() - t0, 2)
ended_str = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
print(f"[{ended_str}] TIMEOUT {model} after {wall_s}s", file=sys.stderr, flush=True)
return {
"model": model,
"status": "TIMEOUT",
"started_at": started_str,
"ended_at": ended_str,
"wall_time_s": wall_s,
"error": f"Timed out after {timeout_s}s (30 minutes)",
}

wall_s = round(time.monotonic() - t0, 2)
ended_str = datetime.now().strftime("%Y-%m-%d %H:%M:%S")

if proc.returncode != 0:
print(f"[{ended_str}] ERROR {model} after {wall_s}s", file=sys.stderr, flush=True)
return {
"model": model,
"status": "ERROR",
"started_at": started_str,
"ended_at": ended_str,
"wall_time_s": wall_s,
"error": proc.stderr.strip() or proc.stdout.strip(),
}

try:
payload = json.loads(proc.stdout)
except json.JSONDecodeError as exc:
print(f"[{ended_str}] PARSE_ERROR {model} after {wall_s}s", file=sys.stderr, flush=True)
return {
"model": model,
"status": "PARSE_ERROR",
"started_at": started_str,
"ended_at": ended_str,
"wall_time_s": wall_s,
"error": f"Invalid JSON from agy: {exc}\nRaw: {proc.stdout[:300]}",
}

usage = payload.get("usage", {})
reported_duration = float(payload.get("duration_seconds", 0.0))
effective_duration = reported_duration if reported_duration > 0 else wall_s

input_tokens = int(usage.get("input_tokens", 0))
cached_tokens = int(
usage.get("cached_tokens")
or usage.get("cache_read_input_tokens")
or usage.get("cached_content_token_count")
or 0
)
thinking_tokens = int(usage.get("thinking_tokens", 0))
output_tokens = int(usage.get("output_tokens", 0))
total_tokens = int(usage.get("total_tokens", 0)) or (input_tokens + thinking_tokens + output_tokens)

gen_tokens = output_tokens + thinking_tokens
gen_tok_per_sec = round(gen_tokens / effective_duration, 1) if effective_duration > 0 else 0.0
out_tok_per_sec = round(output_tokens / effective_duration, 1) if effective_duration > 0 else 0.0

html_files = list(work_dir.glob("*.html"))
if html_files:
artifact_path = html_files[0]
html_text = artifact_path.read_text(encoding="utf-8", errors="replace")
else:
artifact_path = work_dir / "render.html"
html_text = strip_markdown_fences(payload.get("response", ""))
artifact_path.write_text(html_text, encoding="utf-8")

html_kb = round(len(html_text.encode("utf-8")) / 1024, 1)
html_lines = len(html_text.splitlines())
has_doctype = html_text.lstrip().lower().startswith("<!doctype html>")
has_svg = "<svg" in html_text.lower()

print(
f"[{ended_str}] Finished {model} in {effective_duration:.2f}s "
f"(out={output_tokens}, think={thinking_tokens}, {html_kb} KB)",
file=sys.stderr,
flush=True,
)

return {
"model": model,
"status": payload.get("status", "UNKNOWN"),
"started_at": started_str,
"ended_at": ended_str,
"duration_s": round(effective_duration, 2),
"wall_time_s": wall_s,
"input_tokens": input_tokens,
"cached_tokens": cached_tokens,
"thinking_tokens": thinking_tokens,
"output_tokens": output_tokens,
"total_tokens": total_tokens,
"gen_tok_per_sec": gen_tok_per_sec,
"out_tok_per_sec": out_tok_per_sec,
"turns": payload.get("num_turns", 1),
"html_kb": html_kb,
"html_lines": html_lines,
"valid_html_svg": has_doctype and has_svg,
"artifact": str(artifact_path),
"raw_usage": usage,
}


def main() -> None:
if shutil.which("agy") is None:
sys.exit("Error: 'agy' binary not found in PATH. Install Antigravity CLI and authenticate first.")

batch_start = datetime.now()
stamp = batch_start.strftime("%Y%m%d_%H%M%S")
run_root = Path.home() / "antigravity_benchmarks" / f"creative_tech_{stamp}"
run_root.mkdir(parents=True, exist_ok=True)
summary_file = run_root / "results.json"

print(f"Benchmark run started at: {batch_start.strftime('%Y-%m-%d %H:%M:%S')}")
print(f"Per-model timeout: {TIMEOUT_SECONDS}s (30 minutes)\n")

unique_models = list(dict.fromkeys(MODELS))
results: list[dict] = []

for model in unique_models:
res = run_benchmark(model, run_root, timeout_s=TIMEOUT_SECONDS)
results.append(res)
# Flush incremental progress after every model so Ctrl+C never loses completed runs
summary_file.write_text(json.dumps(results, indent=2), encoding="utf-8")

batch_end = datetime.now()
total_elapsed_s = round((batch_end - batch_start).total_seconds(), 2)

print(f"\n=== Creative Tech SVG Benchmark Results (Started: {batch_start.strftime('%Y-%m-%d %H:%M:%S')} | Total: {total_elapsed_s}s) ===")
header = (
f"{'Model':<22} | {'Status':<7} | {'Start':<8} | {'Time(s)':>7} | "
f"{'Input':>6} | {'Cached':>6} | {'Think':>7} | {'Output':>7} | "
f"{'GenTok/s':>8} | {'OutTok/s':>8} | {'KB':>5} | {'Lines':>5} | {'Turns':>5} | {'SVG':<3}"
)
print(header)
print("-" * len(header))

for r in results:
start_hms = r.get("started_at", "")[-8:]
if r.get("status") in {"ERROR", "PARSE_ERROR", "TIMEOUT"} and "duration_s" not in r:
print(f"{r['model']:<22} | {r['status']:<7} | {start_hms:<8} | {r.get('wall_time_s', 0):>7.2f} | {r.get('error', '')}")
continue

svg_ok = "YES" if r.get("valid_html_svg") else "NO"
print(
f"{r['model']:<22} | {r['status']:<7} | {start_hms:<8} | {r['duration_s']:>7.2f} | "
f"{r['input_tokens']:>6} | {r['cached_tokens']:>6} | {r['thinking_tokens']:>7} | {r['output_tokens']:>7} | "
f"{r['gen_tok_per_sec']:>8.1f} | {r['out_tok_per_sec']:>8.1f} | {r['html_kb']:>5.1f} | "
f"{r['html_lines']:>5} | {r['turns']:>5} | {svg_ok:<3}"
)

print(f"\nArtifacts & full JSON (including raw_usage) saved to: {run_root}")


if __name__ == "__main__":
main()

Comments

Popular posts from this blog

Is BI + NoSQL = NoGo?

Azure Functions Documentation

MongoDB Server specifications