GEMINI LABJP
FLASH35 — Gemini 3.5 Flash is now GA and powers gemini-flash-latest, making everyday generation faster and more affordableAGENTS — Managed Agents launch in public preview in the Gemini API, running in secure, isolated Google-hosted Linux sandboxesMEDIA — Nano Banana 2 Lite and Gemini Omni Flash bring faster image and high-quality video generation across AI Studio and the APITTS — Streaming speech generation is now supported for gemini-3.1-flash-tts-preview via streamGenerateContentTRANSLATE — A new audio model detects 70+ languages for live speech-to-speech translation while preserving natural intonationSPENDCAP — Project-level spend caps for billing have been added in Google AI Studio to keep costs under controlFLASH35 — Gemini 3.5 Flash is now GA and powers gemini-flash-latest, making everyday generation faster and more affordableAGENTS — Managed Agents launch in public preview in the Gemini API, running in secure, isolated Google-hosted Linux sandboxesMEDIA — Nano Banana 2 Lite and Gemini Omni Flash bring faster image and high-quality video generation across AI Studio and the APITTS — Streaming speech generation is now supported for gemini-3.1-flash-tts-preview via streamGenerateContentTRANSLATE — A new audio model detects 70+ languages for live speech-to-speech translation while preserving natural intonationSPENDCAP — Project-level spend caps for billing have been added in Google AI Studio to keep costs under control
Articles/API / SDK
API / SDK/2026-06-20Advanced

Catching Gemini Model Deprecations in CI Before They Bite

Build a small guard that scans your codebase for hardcoded Gemini model IDs, cross-checks shutdown deadlines, and turns CI red before a model quietly disappears.

Gemini API183model deprecationCI5operations10indie developer12

Premium Article

On June 25, gemini-3.1-flash-image-preview and gemini-3-pro-image-preview shut down. When I read that line on the deprecations page, my first problem was not the migration steps. It was that I could not immediately say which of my repositories still referenced those two model IDs.

Running four technical blogs (Dolice Labs) and a set of mobile apps as an indie developer, I scatter model IDs across an OGP image-generation script, sample code inside articles, and a wallpaper batch job in the app. One stale ID left in a single place starts returning 404 on the shutdown date — and that is the scariest kind of breakage. The error fires, but somewhere I did not expect.

So I built a small guard: it walks the codebase, collects every model ID, and reports the ones near their shutdown date with days remaining, right inside CI. Building the "did I forget to migrate?" detector before doing the migration itself turns out to be the calmer order of operations. Let's build that guard together in working Python.

Why missed deprecations hit indie developers harder

On a large team, these deadlines land somewhere: a dependency dashboard, an SRE runbook, a ticket. Solo, that record tends to live in your own memory — and memory is least reliable three months later, right before a release.

The second reason is that a Gemini model ID is just a string. Unlike a broken pip resolution that fails the build instantly, a soon-to-be-removed model keeps working until the shutdown date. Tests still pass. That is exactly why it pays to convert the shutdown date from "a calendar entry" into "a CI pass/fail." You may forget to check the calendar; CI checks every single time.

When I went through the gemini-2.0-flash wind-down in May 2026, the migration itself was a one-line swap. Hunting down where to swap took far longer, and I still missed one spot. Wishing CI had caught that miss is where this whole idea started.

The shape of the guard — three parts

The guard is three parts. Keeping their roles separate makes each one easy to swap later.

PartRoleIn / Out
ScannerCollect every model-ID reference in the reposource tree → reference list
RegistryHold the planned shutdown date per modelYAML/dict → deadline map
EvaluatorCompute days left, verify existence, decide the exit coderefs + deadlines + models.list → pass/fail

The hard question is where the shutdown date comes from. The honest answer: you cannot reliably get it from the API. models.list returns whether a model exists and its description, but not a machine-readable "this turns off on date X." So keep the shutdown date in your own small registry, and use models.list only to confirm whether an ID is still alive. That division of labor is what keeps the tool from falling over in practice.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Stop a production pipeline from silently breaking on a model shutdown you forgot was coming, starting today
Copy a working pattern that pairs models.list existence checks with a deadline registry you maintain by hand
Drop the same script into GitHub Actions and a daily cron, with warnings and failures keyed to days remaining
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini 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 →

Related Articles

API / SDK2026-07-06
When Context Caching Didn't Lower My Gemini Bill — Field Notes on Measuring the Real Hit Rate
When Context Caching is enabled but the Gemini API bill barely drops, this field note measures the real hit rate from usage_metadata, separates TTL churn from fragmentation, and walks through a staged recovery.
API / SDK2026-06-29
Guarding Gemini API Responses in CI: Snapshot and Semantic Regression Testing
How to defend non-deterministic Gemini API responses with pytest snapshot tests plus embedding-based semantic regression detection — including CI wiring, separating flakiness from real regressions, and snapshot-update governance, all in working code.
API / SDK2026-06-28
Read Video with Timestamps in the Gemini API: Pull Just the Scene You Need
Hunting for 'where was that step?' in a screen recording or app demo is a chore. Here is how to use Gemini API video understanding to pull just the right scene with timestamps, plus a design that keeps tokens down with FPS and resolution.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →