GEMINI LABJP
NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20
TAG

Cost Optimization

21 articles
Back to all tags
Related:
Gemini API16Indie Development5Context Caching4Python3Image Classification2gemini-embedding-22Batch Processing2operations2Gemini 3.5 Flash2Production2Indie Developer2production2
Gemini Advanced/2026-07-15Advanced

A near-miss label won't fix itself on retry — a normalization layer for closed-vocabulary classification

When responseSchema enum returns an out-of-set label, retrying tends to return the same near-miss. From a wallpaper app's 30-category batch, here is the distribution of how labels miss, plus a normalization layer built on an alias table and gemini-embedding-2 nearest-neighbor, with measured results.

Gemini API/2026-07-11Intermediate

When Gemini's Context Cache Quietly Expires Mid-Run: A TTL Guard for Pipelines That Pause

When a nightly batch or a retry backoff pauses your pipeline, Gemini's explicit context cache can expire on the wall clock while nothing errors out, sending later calls back to full-token billing. Here is a small lease guard that decides whether to re-arm or run uncached based on cost.

Gemini Advanced/2026-07-10Advanced

The Day We Went From 30 Categories to 34 — Reclassifying 1,180 Assets Instead of 8,142

Adding categories to a taxonomy does not require reclassifying everything. Here is how embeddings and confidence margins narrowed a backfill from 8,142 assets to 1,180, with the numbers.

Gemini API/2026-07-06Advanced

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.

Gemini Advanced/2026-07-03Advanced

Your Tool Results Are Quietly Eating the Conversation — Handle Passing to Keep Gemini Function Calling Contexts Lean

Tool results linger in Function Calling history and compound your input tokens every turn. Two implementations — a token-budgeted compactor and handle passing — cut my measured input by roughly 8x, with the pitfalls I hit along the way.

Gemini API/2026-06-26Advanced

Is Gemini 3.5 Flash Actually Cheaper? Measuring Retry Amplification to Find the Flash vs Pro Break-Even

Now that 3.5 Flash is generally available, it is tempting to route everything to it. But once you measure effective cost per success instead of per-call price, the decision changes. Here is a small harness to measure retry amplification and find the break-even.

Gemini Dev/2026-06-20Intermediate

Routing Gemini by Pipeline Stage: Draft on Flash, Finish on the Top Tier

A record of reworking which Gemini model handles which stage of an automation pipeline, prompted by the general availability of Gemini 3.5 Flash and the rollout of 3.1 Flash-Lite. Includes a small router that splits work into draft, classify, and finalize stages, how the cost picture changes, and the guardrails I settled on.

Gemini API/2026-06-14Intermediate

Generate With Flash, Escalate to Deep Think Only When Unsure: A Two-Stage Pipeline

With Deep Think opening up on the API, the move is not to route every request through the heavy model but to have Deep Think verify only when Flash's output looks shaky. Here is the cost reasoning and working code.

Gemini API/2026-06-03Advanced

Reconciling Orphaned Gemini Files API Uploads Across a Fleet of Apps

Files API uploads quietly expire after 48 hours. Here's how I keep orphaned files and quota under control across six apps, using reconciliation against my own database and a scheduled cleanup job — written up as production notes from running wallpaper apps.

Gemini Advanced/2026-06-01Advanced

Trimming Gemini Embeddings from 3072 to 768 Dimensions: A Matryoshka Approach to Cutting Vector DB Cost and Latency

gemini-embedding-001 returns 3072-dimensional vectors, but thanks to Matryoshka representation you can keep only the leading dimensions with almost no quality loss. This is a design for trimming to 768 to cut vector DB storage and latency, including the re-normalization pitfall and coarse-to-fine search code.

Gemini API/2026-05-26Intermediate

Running Gemini 3 Pro and Flash in Parallel on AdMob Monthly Reports — Notes from Ten Mornings

Implementation notes from sending the same AdMob monthly report to Gemini 3 Pro and Gemini 3 Flash in parallel for ten days. Cost, latency, and summary quality compared from an indie developer's perspective.

Gemini API/2026-05-26Advanced

Coalescing Gemini API Requests with SSE Fan-out: Collapsing 100 Simultaneous Hits into a Single Call

How I rebuilt the post-push-notification thundering herd on a 50M-download wallpaper app into a Cloudflare Durable Objects coalescer with SSE fan-out, cutting Gemini API costs by 92% with 14 days of production telemetry.