All Articles
Production-Grade PII Redaction for the Gemini API — Detection, Masking, and Audit Logging That Actually Pass a Privacy Review
Are you piping raw user text straight into the Gemini API? This guide walks through detection, masking, and audit-log design so you can keep PII out of model traffic and pass GDPR, SOC 2, and customer privacy reviews — with code you can ship today.
Migrating to @google/genai: Seven Errors That Will Eat Your Afternoon
A field-tested guide to the seven errors you are most likely to hit when migrating from @google/generative-ai to @google/genai, with copy-paste fixes for Node.js and TypeScript codebases.
Building an LLM-as-Judge Evaluation Pipeline with Gemini — Production-Grade Design and Implementation
A practical guide to building an LLM-as-Judge evaluation pipeline using Gemini 2.5 Pro / 3 Pro as the judge. Covers Pointwise / Pairwise judging, bias mitigation, human-correlation measurement, and cost optimization, with working Python code for production use.
Why Gemini Says It Cannot See Your Image — A Practical Diagnosis Guide
If Gemini API replies 'I don't see an image' despite an attached file, the cause is almost always client-side. This guide walks through the four checks — mime_type, payload size, SDK version, and model selection — with copy-pasteable fixes.
Precise Output Control in Gemini API: A Practical Guide to maxOutputTokens and stopSequences
Combine maxOutputTokens and stopSequences in the Gemini API to shape response length exactly the way you need. Stop responses from being cut off, going over budget, or breaking JSON parsing — with production-tested patterns.
Production Streaming UI with Gemini API + TanStack Query — Cancellation, Retries, and Cache Coherence
TanStack Query is optimized for one-shot REST/JSON requests, so streaming responses don't fit naturally. This guide walks through the gotchas of using Gemini API SSE with TanStack Query and the production-grade design patterns that hold up in real apps.
Stop Gemini From Phoning In the Last Few Paragraphs — Prompt Patterns That Hold Density to the End
When Gemini writes long pieces, the final paragraphs often go thin. A solo creator's three-layer routine — pre-declared footer, staged generation, verifier agent — to keep density consistent from start to finish.
Testing Gemini API with Vitest — Mock Patterns and Function Calling Verification for TypeScript Projects
Practical patterns for testing TypeScript code that calls the Gemini API, using Vitest. Covers SDK mocking, Function Calling verification, and streaming response tests, drawn from a setup I run in personal projects.
Gemini API × Inngest: Building Fault-Tolerant AI Workflows for Production
A practical guide to building durable, fault-tolerant Gemini API workflows with Inngest — covering retries, fan-out/fan-in, human approval, throttling, and dead-letter patterns.
When Gemini API URL Context Returns Nothing: A Diagnostic Walkthrough
If Gemini's URL Context tool stays silent or returns generic answers, the cause is almost always one of three things: tool configuration, URL formatting, or site-side restrictions. Here's how to isolate which.
Fixing 'Thoughts must be present in conversation history' in Gemini API: A Practical Guide to Thought Signatures in Multi-Turn Tool Calls
If you're hitting 'Thoughts must be present in conversation history when using thinking signature' in Gemini 2.5/3.x with multi-turn function calling, this guide walks through what's actually happening and how to fix it in five minutes — Python SDK, REST, and streaming all covered.
Building a Production-Grade Gemini API Backend with NestJS — DI, Filters, and Guards
A practical pattern for wrapping the Gemini API in a NestJS backend. Covers DI-based service design, SSE streaming, exception filters for 429/safety errors, and guards for API-key auth and rate limiting.