◉GEMINI LABJP
●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 5 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 5 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…
Articles/API / SDK
◈ API / SDK/2026-04-22Advanced

Quietly Catching Wrong Answers in Your Gemini-Powered App — A Production Auto-Eval Loop

Running Gemini in production eventually shows you responses that are 'kind of wrong.' I want to catch them before users do. This is the exact auto-eval loop I run over live traffic, with the prompts I use and the mistakes I had to learn my way through.

Gemini API250Evaluation3QualityLLM as judgeProduction33

✦ Premium Article

With Gemini in production, reaching "mostly correct" responses is actually pretty quick. The harder state to escape is "wrong sometimes, quietly." I operate a service where I built and maintain an auto-eval loop that runs over live traffic to catch exactly that kind of quiet failure.

This article shares the design, the prompts, and the traps I stepped in. It's Gemini-specific in places, but the shape applies to any LLM in production.

As an indie developer I run a handful of my own apps, with Gemini wired into their support replies and description generation. I started building this eval loop the week AdMob revenue dipped a few percent after a feature release, with no obvious explanation. Tracing it, the cause wasn't a server error or a crash — the responses themselves had quietly degraded. Users just close the app; nothing reaches you. That faintly tilted-floor feeling was the starting point for this whole system.

Why Auto-Eval in Production Matters

Pre-deployment evaluation on a fixed test set is important, but production introduces factors you can't capture upfront:

  • Users send inputs you never anticipated
  • The UI changes, so the prompts drift subtly
  • The Gemini model updates under the hood
  • Documents and FAQs change, changing context

All of these bypass your pre-eval coverage. Trying to catch everything pre-deployment leads to bloated test sets that drift out of sync with reality. A lightweight but continuous evaluation over real traffic is the practical answer.

The moment I was most grateful I had this system: a feature's accuracy was drifting slowly downward, no user complained, but the evaluation dashboard showed the trend clearly.

Four Lenses to Evaluate in Production

I automatically score each production response on:

  1. Factuality — do factual claims in the answer contradict the given context?
  2. Instruction following — does the output obey system prompt requirements (format, length, prohibitions)?
  3. Relevance — does the answer actually address the user's question?
  4. Safety — is there any leakage of sensitive info, harmful content, or bias?

Evaluating all four on every request is rarely economical. I route evaluation based on request type and risk.

For example, a FAQ bot leans on 1 and 3. A generative response leans on 2 and 4. Trying to measure all four for every request can push evaluation cost above generation cost.

✦

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
✦A two-judge majority setup using a different model family from the generator, sending only disagreements to humans — tiered sampling that keeps eval cost near 15% of generation cost
✦A concrete calibration procedure on 120 hand-labeled past responses, with a measured table of miss rate, false-positive rate, and human-queue share per threshold
✦Alert design that pings Slack when the inconsistent rate exceeds 1.5x the 7-day average, plus the four failure modes that actually surfaced while running my own indie apps
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-05-04
Judging Gemma 4 and Nemotron 3 Nano Omni on 100 of My Own Images, Not a Benchmark Score
Heron-Bench and JMMMU headline scores are the wrong input for an adoption decision on local Japanese multimodal models. Using a wallpaper classifier as the case, here is how to build a 100-image eval set, weight errors by what they actually cost, and catch regressions when you re-quantize.
◈ API / SDK2026-05-21
Designing Event-Driven AI Workflows with Gemini API and Cloud Pub/Sub — Notes from an Indie Developer
An implementation memo on wiring Gemini API into Cloud Pub/Sub event-driven workflows. Using an app-review analysis pipeline as the running example, the article covers retry policy, dead-lettering, idempotency, and cost guardrails — from the perspective of someone running it solo.
◈ API / SDK2026-04-26
Gemini API × Stripe — Production Usage-Based Billing for Indie AI SaaS
A complete guide to building a usage-based billing system for your Gemini API SaaS using Stripe Metered Billing and webhooks — production patterns included.