◉ANTIGRAVITY LABJP
Articles/App Development
▣ App Development/2026-11-23Intermediate

From December 1, Someone Else Answers gemini-2.5-flash: Find Every Place You Hard-Coded the Name First

On December 1 the Gemini API starts routing gemini-2.5-pro to gemini-3.8-flash and gemini-2.5-flash to gemini-3.5-flash-lite, billed at the new models' rates. Nothing errors, so it is easy to miss. Here is a script that finds model names across code, config and MCP settings, plus a way to log modelVersion so you can see the switch yourself.

Gemini API7Model migrationAntigravity421MCP30Python28

One evening, with an Antigravity terminal still open, I remembered a small script I use as an indie developer to draft tags for the images in my wallpaper app with the Gemini API. I realized I couldn't say, off the top of my head, which file held its model name.

That mattered because the Gemini API deprecation notice says that from December 1, gemini-2.5-pro will be routed to gemini-3.8-flash and gemini-2.5-flash to gemini-3.5-flash-lite. It isn't a shutdown. Your calls keep working; only the model that answers — and the price — changes.

The one thing I'd like to say up front: the changes that don't break anything are the ones you need to map before they land. A 404 would get my attention the next morning. This one will quietly shift output quality and the bill, with nothing looking broken.

What changes on December 1

Reading the notice alongside the forum threads and the write-ups that followed, it comes down to two rows.

Name in your codeModel that answers from Dec 1Billing
gemini-2.5-progemini-3.8-flashNew model's rates
gemini-2.5-flashgemini-3.5-flash-liteNew model's rates

gemini-2.5-flash-lite and the image or audio variants are handled separately. Anything with a suffix deserves its own check against the deprecation table — the names are close enough that it's easy to treat them as the same model.

There is already a post on the Google AI Developers Forum from someone using gemini-2.5-flash as an audio relevance guard, asking for an opt-out because the routed model no longer matches their thresholds. If your logic leans on how a model tends to answer, I suspect you'll feel this in the output before you feel it in the invoice.

Step 1: Find every place the name is written

Model names don't only live in code. .env files, MCP server configs, CI YAML, README instructions — the .env is the one I'd be most likely to forget.

This script walks a repository, picks up gemini-2.5-pro and gemini-2.5-flash, and splits them into ROUTED (affected) and CHECK (a variant you should look up individually). It exits with 1 if anything is ROUTED, so in CI it works as a fence until December 1.

#!/usr/bin/env python3
"""Find the Gemini 2.5 model names that get routed elsewhere on Dec 1."""
import re, sys, pathlib
 
ROUTED = {"gemini-2.5-pro": "gemini-3.8-flash", "gemini-2.5-flash": "gemini-3.5-flash-lite"}
# Names followed by -lite / -image / -preview-xx are different models; flag them as CHECK
PAT = re.compile(r"gemini-2\.5-(pro|flash)([\w.-]*)")
SKIP_DIRS = {".git", "node_modules", ".next", "dist", "build", ".venv"}
EXTS = {".py", ".ts", ".tsx", ".js", ".mjs", ".json", ".toml", ".yaml", ".yml", ".env", ".sh", ".md"}
 
def scan(root):
    hits = {"routed": [], "check": []}
    for p in pathlib.Path(root).rglob("*"):
        if any(d in SKIP_DIRS for d in p.parts) or not p.is_file():
            continue
        if p.suffix not in EXTS and p.name not in {".env", ".env.local"}:
            continue
        try:
            lines = p.read_text(encoding="utf-8", errors="ignore").splitlines()
        except OSError:
            continue
        for n, line in enumerate(lines, 1):
            for m in PAT.finditer(line):
                name = m.group(0).rstrip(".-")
                key = "routed" if name in ROUTED else "check"
                hits[key].append((str(p), n, name))
    return hits
 
if __name__ == "__main__":
    h = scan(sys.argv[1] if len(sys.argv) > 1 else ".")
    for f, n, name in h["routed"]:
        print(f"ROUTED  {f}:{n}  {name} -> {ROUTED[name]}")
    for f, n, name in h["check"]:
        print(f"CHECK   {f}:{n}  {name} (variant: look it up in the deprecations table)")
    print(f"-- routed {len(h['routed'])} / check {len(h['check'])}")
    sys.exit(1 if h["routed"] else 0)

A file called .env has no suffix as far as pathlib is concerned, so filtering on p.suffix alone would skip it. That's why there's a separate check on the file name.

I ran it against a tiny folder with one name in code, one in an MCP config and one in .env:

$ python3 scan_25.py demo
ROUTED  demo/.env:1  gemini-2.5-flash -> gemini-3.5-flash-lite
ROUTED  demo/src/tagger.py:1  gemini-2.5-flash -> gemini-3.5-flash-lite
ROUTED  demo/mcp/config.json:1  gemini-2.5-pro -> gemini-3.8-flash
CHECK   demo/mcp/config.json:1  gemini-2.5-flash-lite (variant: look it up in the deprecations table)
-- routed 3 / check 1
$ echo $?
1

Even with the base model and the -lite variant on the same JSON line, they're counted separately. A pattern of just gemini-2\.5-flash would sweep -lite into ROUTED too, and you'd end up rewriting lines that never needed touching. Capturing the trailing characters before deciding is what prevents that.

Step 2: Decide, line by line — rewrite, keep, or wait

With the hits in front of me, I sort them three ways.

  • Rewrite: anything that depends on how the model answers — judging, classifying, extracting. Write the new model name yourself, review the output on that model, then switch.
  • Keep: rough-draft uses where a slightly different answer doesn't hurt. The rate still changes to the new model's, so keep an eye on monthly call volume.
  • Wait: names baked into an MCP server or third-party tool you can't edit. Wait for the provider's update, and in the meantime make sure you have a way to stop your own calls if needed.

My tag-drafting script goes in "rewrite": if tag granularity shifts with the model, it ripples into how the app groups categories. I'd rather write the new name myself than let routing decide for me. Automatic routing is a kindness, but not being able to say which model is answering is the thing I find most unsettling in operations.

Step 3: Log modelVersion and watch the switch yourself

Reading the notice doesn't tell you what will actually answer on December 1. I haven't seen it yet either. So I log the modelVersion field from each generateContent response, one line per day.

import json, os, datetime, urllib.request
 
def probe(model: str) -> dict:
    """Call the given model once and record which model version the response reports."""
    url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent"
    body = json.dumps({"contents": [{"parts": [{"text": "Reply with just: ok"}]}]}).encode()
    req = urllib.request.Request(url, data=body, headers={
        "Content-Type": "application/json",
        "x-goog-api-key": os.environ["GEMINI_API_KEY"],
    })
    with urllib.request.urlopen(req, timeout=30) as r:
        res = json.load(r)
    usage = res.get("usageMetadata", {})
    return {
        "at": datetime.datetime.now().isoformat(timespec="seconds"),
        "requested": model,
        "served": res.get("modelVersion"),  # if routing kicks in, this should stop matching "requested"
        "tokens": usage.get("totalTokenCount"),
    }
 
if __name__ == "__main__":
    for m in ("gemini-2.5-pro", "gemini-2.5-flash"):
        print(json.dumps(probe(m), ensure_ascii=False))

Append it once a day with >> probe.log and you'll have a record of the day requested and served start to differ. If served still hasn't changed after December 1, that's a fact worth having too. Either way, you're talking from a log rather than a guess.

Cost is a separate question

What the routed calls will cost depends heavily on volume and caching. Gemini 4 Carbon's introductory price also ends around the same time, so I've written up how I estimate a monthly bill on my own key in estimating a session's cost before Carbon's December price. For the case where the tool you depend on goes away entirely, auditing dependencies ahead of the Gemini CLI sunset follows a similar idea.

What to do tonight

There are 8 days left. Running the script once on your own repository and counting the ROUTED lines is enough for tonight. However many lines it finds, letting a machine find them beats searching by eye — a line in a .env you don't remember writing is exactly the kind that slips past.

Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

▣ App Dev2026-10-22
Translations Drifted Apart Without Me Noticing: A 70-Line strings.xml Check to Run Before Asking an Agent to Review
A small Python script that finds missing keys, empty strings, placeholder mismatches, and missing plurals across Android locales, how it divides the work with Lint, and how to hand only its findings to Antigravity for fix proposals.
▣ App Dev2026-09-19
I Asked for the Whole Quote PDF Tool at Once, Then Split It Into Four Requests
How I moved my client quote paperwork from copy-and-edit to a small PDF tool built with Antigravity, why the first single-shot request had to be thrown away, and the four smaller requests that replaced it, with working code.
⬡ Integrations2026-09-20
antigravity-preview-05-2026 shuts down October 5: which setups need more than a string swap
The shutdown date for antigravity-preview-05-2026 is set for October 5, and the official page gives you the date and the successor name, nothing more. If you only read output_text, swapping the string is the whole migration. If you read steps, it is not.