All writing

Gemini Deprecated temperature and top_p: Audit Every API Call Now

Sampling parameters don't disappear quietly — they disappear in ways that make your agents produce subtly wrong output for days before anyone notices. Google confirmed in the Gemini API changelog this week that temperature, top_p, and top_k are now deprecated across Gemini models. If your production pipeline passes any of these, you have a ticking clock on output quality, not just a lint warning.

This is the class of change that doesn't blow up in CI. It blows up in a customer-facing workflow on a Thursday afternoon when your travel agent starts hallucinating more confidently than usual because the temperature you set to 0.2 is now silently ignored.

Why "Deprecated" Here Means "Already Dangerous"

Deprecation notices usually give you runway. This one doesn't feel that way. The risk isn't a hard error — it's silent parameter ignoring. Depending on how Google phases enforcement, there are three possible outcomes for code that still passes these parameters:

  1. The parameters are silently dropped — the model runs on whatever the default generation config is, which almost certainly differs from your tuned values.
  2. The API returns a warning but still processes the call — outputs drift, your evals don't catch it because the delta is subtle.
  3. Enforcement tightens and calls start returning errors — at least this one you'll notice immediately.

The worst case is option 1. I've seen this pattern with other API versioning rollouts: parameter silently ignored, generation defaults shift, agentic loops that were tuned for low-temperature determinism suddenly start exploring more, retry logic kicks in more often, and your token costs compound in ways that aren't obvious until the bill arrives.

The fix is straightforward. The audit is the hard part.

The Audit: Find Every Affected Call in 20 Minutes

Here's the grep-first approach for a Python codebase:

bash
# Find every file passing deprecated Gemini sampling params
grep -rn --include="*.py" \
  -e "temperature" \
  -e "top_p" \
  -e "top_k" \
  . | grep -i "gemini\|genai\|generativeai"

For Node/TypeScript:

bash
grep -rn --include="*.ts" --include="*.js" \
  -e "temperature" \
  -e "top_p" \
  -e "topP" \
  -e "topK" \
  . | grep -i "gemini\|generative"

You're looking for any GenerationConfig or generateContent call that sets these. Tag every hit. Then cross-reference against your agent graph — which agents are calling Gemini endpoints, what were their temperature settings, and what behavior depends on those settings being honored.

What to do per call type:

ParamIntentMigration path
temperature: 0.0–0.2Deterministic / factual outputCheck if new generation config exposes a response_mode or equivalent; pin to lowest-variance preset
temperature: 0.7–1.0Creative / diverse outputMonitor output distribution post-migration; may need system prompt compensation
top_p / top_kNucleus / top-k sampling controlThese are now likely abstracted — check the updated GenerationConfig schema for replacement fields

Google's new generation config almost certainly exposes higher-level controls (think thinking_budget, response style presets, or structured output constraints) rather than raw sampling knobs. That's actually a reasonable direction — most teams were cargo-culting temperature values anyway without running ablations to justify them. But the migration is on you, not Google.

The Hidden Benefit: Gemini 3.6 Flash GA Changes Your Routing Math

The same changelog that dropped this deprecation also confirmed Gemini 3.6 Flash GA — and this matters separately. Gemini 3.6 Flash arrives with improved token efficiency, better code and agentic planning capabilities, and a lower price point than Gemini 3.5 Flash.

If you're following Gemini releases closely, you've already updated your routing table. If not, here's the short version: any pipeline routing to gemini-1.5-flash or gemini-2.0-flash for cost reasons needs a routing audit. 3.6 Flash likely undercuts those on price-per-useful-token for most agentic tasks — not just raw token price, but effective cost after you account for output verbosity reduction.

Gemini 3.5 Flash-Lite also hit GA this week as a dedicated high-volume, low-latency option. The routing decision table now looks like this:

Use caseModel to evaluate
High-volume subagent calls (classification, routing, extraction)gemini-3.5-flash-lite
Agentic planning, code generation, tool usegemini-3.6-flash
Long context reasoning, complex multi-stepGemini 2.5 Pro (if budget allows)

Don't just update the model slug and call it done. Benchmark latency at your P95 — 3.5 Flash-Lite trades some capability for speed, and that tradeoff only makes sense if your subagent tasks are genuinely simple.

Hard Shutdowns: The Dates You Cannot Miss

Aside from the sampling parameter deprecation, there are two hard shutdown dates in this changelog:

  • August 17, 2026 — Several image generation models are shutting down. If you're calling any Gemini image generation endpoints, check the full changelog now.
  • August 31, 2026gemini-robotics-er-1.6-preview shuts down. Likely a narrow audience, but if you're in that space, this is a hard migration deadline with no grace period.

August 31 is 24 days from now. For image gen, August 17 is 10 days. Those aren't "plan to get to it" timelines — they're "block a sprint" timelines.

The Broader Signal: Providers Are Abstracting Away Raw Sampling

Step back from the immediate fire drill and look at what's actually happening. OpenAI moved toward structured outputs, reasoning budgets, and tool-use primitives. Anthropic added thinking modes. Now Google is deprecating the raw sampling knobs that have been the default way to "tune" LLM behavior since 2020.

The direction is clear: providers are moving up the abstraction stack. Raw temperature and top_p are being replaced by higher-level intent signals — "be deterministic", "be creative", "think harder", "respond faster". This is arguably better for most production use cases. The teams I see getting into trouble with temperature tuning are usually compensating for a bad system prompt or a poorly scoped task — not actually benefiting from the fine-grained control.

The contrarian take: temperature was always a proxy metric for task clarity; if you needed it tuned below 0.3, your prompt was doing too much work.

That said, the migration friction is real. Teams that built eval harnesses around specific temperature settings now need to re-anchor their baselines. If your evals measure output consistency by comparing generations at temperature=0.1, those evals are broken the moment the parameter is ignored.

One More Thing: OpenAI Shipped Content Provenance This Week

Separately, OpenAI's Node SDK v7.3.0 shipped with support for content provenance checks — letting developers verify the authenticity and origin of AI-generated content at the API level. This isn't Gemini-adjacent, but if you're building anything in the content verification or trust-and-safety space, it's worth tracking. I don't have hands-on time with it yet (it literally shipped this week), but the pattern — cryptographic provenance at the generation layer — is the right architectural answer to the authenticity problem as AI content floods every pipeline.

What to Actually Do

  1. Run the grep audit today. Find every file in your codebase that passes temperature, top_p, or top_k to a Gemini endpoint. Don't delegate this to next sprint.

  2. Check the updated GenerationConfig schema in the Gemini API docs and map your deprecated params to whatever replacement controls exist. Document the mapping explicitly — your team will need it for incident postmortems if output quality drifts.

  3. Re-baseline your evals. Any eval harness that was anchored to specific temperature settings needs new baselines generated under the new config. Do this before the parameter is actively ignored, not after.

  4. Update your routing table. Gemini 3.6 Flash and 3.5 Flash-Lite are both GA at new price points. Run a 48-hour shadow traffic test with the new models before cutting over — especially for any agentic planning tasks where output quality matters more than raw cost.

  5. Flag the August 17 and August 31 shutdown dates in your team calendar with owners assigned. Hard shutdowns have no snooze button.

The sampling parameter deprecation is fixable in a day of engineering time. The real risk is the teams that don't find out until their production evals start failing quietly at 2am.

Working on something like this? I take on a few fractional-CTO and AI engagements at a time.

The AI CTO playbook

Get my AI playbooks — straight to your inbox

Practical notes on shipping production AI, scaling teams, and the calls a CTO actually has to make. A few times a month. No spam, no fluff.