GEMINI LABJP
OMNI — Gemini Omni Flash, a natively multimodal model, enters API public preview for building custom video workflowsNANO — Nano Banana 2 Lite arrives as the fastest and most cost-efficient Gemini image model yetFLASH — Gemini 3.5 Flash reaches general availability with sustained frontier performance on agentic and coding tasksAGENTS — Managed Agents enter public preview in the Gemini API, running autonomous, stateful agents in isolated Google-hosted Linux sandboxesMEMORY — The Memory Bank IngestEvents API is GA, decoupling event ingestion from memory generation for continuous streamingTHROUGHPUT — Provisioned throughput now accepts up to seven pending model orders for the same model and regionOMNI — Gemini Omni Flash, a natively multimodal model, enters API public preview for building custom video workflowsNANO — Nano Banana 2 Lite arrives as the fastest and most cost-efficient Gemini image model yetFLASH — Gemini 3.5 Flash reaches general availability with sustained frontier performance on agentic and coding tasksAGENTS — Managed Agents enter public preview in the Gemini API, running autonomous, stateful agents in isolated Google-hosted Linux sandboxesMEMORY — The Memory Bank IngestEvents API is GA, decoupling event ingestion from memory generation for continuous streamingTHROUGHPUT — Provisioned throughput now accepts up to seven pending model orders for the same model and region
Articles/Advanced
Advanced/2026-07-12Advanced

Spend Deep Reasoning Only Where It's Needed: Per-Request thinking_level Routing in Gemini

Running every request at high thinking_level bloats latency and cost; forcing low drops accuracy on hard questions. This walks through a router that picks Gemini 3.x thinking_level per request from an inexpensive difficulty estimate, keeping p95 latency inside a mobile budget while reserving deep reasoning for the questions that need it — with measured numbers and working code.

gemini100thinking-levellatency3cost5mobile5

Premium Article

The first feedback on a small advice feature I added to an app wasn't about accuracy. It was: "sometimes it takes forever to come back." The logs showed the response times split into two clusters. Most requests returned in one to two seconds, while a handful took eight or nine.

The odd part was that the slow requests weren't always the hard ones. A light query like "any wallpapers in a similar color?" would have the model deliberating just as long as a genuinely multi-step question. Because I had pinned every request to a single deep setting, easy questions were paying the same reasoning tax as hard ones.

Gemini 3.x lets you set thinking_level per request. Instead of using one fixed value, you vary it with the difficulty of the request: shallow and fast for simple questions, deep only for the ones that earn it. That single change held the median wait time steady while cutting the total amount of deliberation sharply. Below is how I built the router, with the numbers I measured along the way.

Why "all high" and "all low" both break

A fixed thinking_level hurts in either direction. Pin it to high and simple questions over-deliberate, stretching latency and inflating output tokens (which include thinking tokens) so the bill climbs. Pin it to low and you get fast and cheap, but answers to multi-step questions turn shallow and sometimes wrong.

Here are the numbers I measured. I ran a representative 100 requests for one feature through the same prompt and input, varying only thinking_level, and recorded the median completion time (not first token) and the median billed output tokens. The model was gemini-flash-latest (the 3.5 Flash line).

thinking_levellatency p50latency p95median output tokenseasy-question accuracyhard-question accuracy
low~1.3s~2.1s~21098%71%
medium~3.4s~5.2s~54098%86%
high~6.8s~9.1s~1,18099%92%

What the table says is that on easy questions, low and high land at almost the same accuracy while latency spreads about 5x and output tokens about 5.6x. Processing an easy question at high throws away both the wait time and the money. Run a hard question at low, though, and accuracy falls to 71% — missing close to three in ten. That is not a feature you want to put in front of paying members.

The answer is not to pin either extreme. Tell the difficulty apart, route simple ones to low and only hard ones to high, and take the middle at medium. As long as the routing is accurate enough, the median wait time stays at low while hard-question accuracy climbs toward high.

Telling requests apart by difficulty

The heart of routing is the part that, the moment a request arrives, cheaply estimates how much thinking it needs. Putting an expensive judgment here would defeat the purpose, so I made it two-stage: a zero-cost heuristic sorts the bulk, and only the ambiguous ones get a model in the loop.

The heuristic reads difficulty off the shape of the input. As an indie developer, the observations I lean on collapse into three:

  1. Input length and structure. Short single-fact lookups skew low. Requests with several conditions, or phrasing like "compare" or "and explain why," skew high.
  2. The shape of the expected answer. A one-word or one-value answer is low. Anything asking for steps, reasoning, or trade-offs needs deeper thinking.
  3. The cost of being wrong. Anything touching the purchase flow or steering a user's action gets bumped to medium or above, even if slower. Here, not missing beats being fast.

These are not perfect. A short-but-hard question ("which is the better deal, A or B?" is multi-step in ten characters) slips through. That is exactly why only the gray zone the heuristic can't call gets handed to the next stage.

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-stage difficulty estimate that maps each request to low / medium / high thinking_level and keeps p95 latency inside a fixed budget
Measured response time and output tokens per thinking_level, plus how to back the ceiling out from a mobile wait-time budget
How mis-routing a hard question to low fails silently, and the cheap signals plus a Flash pre-pass that catch it
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

Advanced2026-07-11
A Risk-Tiered Approval Gate for Gemini Function Calling
Handing full autonomy to an agent is unnerving. This walks through a Gemini function-calling loop that routes tool calls into auto-run and hold-for-approval by risk tier, then feeds the result back to the model after a human signs off.
Advanced2026-06-27
Your Gemini Completion Event Will Arrive Twice — An Idempotent Sink That Makes Webhook + Reconciliation Effectively Once-Only
Once you receive Gemini long-running operations over a Webhook and back it up with a reconciliation poller, the same completion arrives twice and publishing or billing runs twice. Build an idempotent sink with a normalized key and a claim-run-commit pattern that keeps side effects effectively once-only.
Advanced2026-06-21
When Gemini's Maps Grounding Quietly Fails in Production — Field Notes on Attribution, Billing Boundaries, and Fallbacks
An operations-focused look at the pitfalls that surface after you ship Grounding with Google Maps on Gemini: detecting silent grounding misses, meeting the attribution requirement, knowing which responses are billed, and building fallbacks for latency and staleness.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →