◉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, 6 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, 6 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/Dev Tools
⟐ Dev Tools/2026-07-16Advanced

I stopped storing every generation log — three retention tiers and a prompt fingerprint that keeps traceability

I was storing every Gemini API request and response body for debugging. Here is how I moved to three retention tiers plus a prompt fingerprint, and kept the ability to diagnose issues without keeping the text.

Gemini API249LoggingData RetentionOperations12Firestore

✦ Premium Article

My nightly pipeline started returning the same category over and over, so I opened the logs to find out why.

I could scroll back three months. Full request bodies. Full response bodies. All of it, exactly as sent. Convenient. Too convenient.

Sitting there were sentences that people had typed into my app, preserved verbatim. Something I had kept for debugging had quietly become data that nobody had ever decided to delete. I stopped scrolling.

This is not a storage bill story. It is a question about whether I had any reason to hold other people's words indefinitely inside a pipeline I run by myself.

As an indie developer I had never written the deletion side of the design. What you do not write, you keep. That is simply what logs are.

What "keep everything" was actually holding

The logging was naive. My Gemini API wrapper serialized the request and response into JSON and wrote it to Firestore. That was the whole design.

Three months of that produced the following, across wallpaper classification, article metadata generation, and review-reply drafting — indie-scale numbers.

MetricMeasured
Records~41,000 (3 months)
Average size per record~11 KB (with bodies)
Total~450 MB
Records a human actually opened62

41,000 stored. 62 opened. That is 0.15%.

And of those 62, only about 20 genuinely required the body text. For the rest, knowing the model, the timestamp, the token counts, and the finish reason was enough.

The bodies were never the star of an investigation. Context was.

How little do you need to trace a cause?

Before deleting anything, I wrote down what would actually hurt to lose — restricted to investigations that had really happened.

  1. Output drifted — when did it start, and did the model or the prompt change around that point?
  2. Cost spiked — which task grew, and in which part of the token breakdown?
  3. A specific input always fails — what is the shape of that input (length, language, attachments) and the finishReason?
  4. Output gets cut off — what were maxOutputTokens versus actual output tokens?

None of the four needed the text itself. What they needed was the ability to say, unambiguously, whether two calls had sent the same thing.

Same input or different input. Once that is settled, you can reproduce the condition locally and take it from there.

That decided the design: drop the body, keep its identity.

✦

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
✦How to build a prompt fingerprint that identifies a request without storing its text, and what belongs in the hash versus what does not
✦A Tier 0/1/2 retention model with Firestore TTL policies. Storage dropped roughly 92% while investigations still landed
✦Stratified sampling at 100% of failures and 3% of successes, plus a real case where the fingerprint alone caught a model swap
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

⟐ Dev Tools2026-09-10
Matching name variants in a print catalog: normalize first, then ask Gemini for candidates
When the same artist appears under three spellings, asking Gemini whether two names are the same person quietly merges different generations. Here is the two-layer alternative — deterministic normalization first, model-generated candidates second — with working code and a cost estimate.
⟐ Dev Tools2026-09-06
Icon-Only Buttons Can Stay Silent for Screen Readers, Even When Every Translation Is in Place
A fully translated app can still read as silence. Here is how I collect icon elements and labels from iOS and Android, settle everything mechanical locally, and send only the wording to Gemini — with the actual output from each stage.
⟐ Dev Tools2026-09-02
An agreement-rate gate approves the model swap, then your category shares move
Swapping the model behind an image classification batch can pass a golden-set agreement gate while category shares quietly shift. I measured the sample sizes each check really needs and rebuilt the gate as a paired comparison.