◉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/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.

gemini119thinking-levellatency3cost6mobile6

✦ 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-10-14
Fine on Desktop, Blank on Safari: Four Things to Gather Before You Ask an AI to Diagnose It
After a shuffle, my lazy-loaded images never loaded again, but only in Safari on iPhone. Here is what to collect by hand before asking Gemini or any other model to diagnose a bug that does not reproduce on desktop, plus a request template you can paste.
⬡ Advanced2026-10-10
Keeping Money and Health Questions Out of Your History: Gemini Temporary Chat and the Settings to Check
Before you ask Gemini about household spending or a health worry, here is the order I use to check Temporary Chat and the Activity setting, so you can decide what gets kept and what doesn't.
⬡ Advanced2026-09-19
Some inputs ignore media_resolution entirely. Count the tokens on your own key first
In Gemini 3, media_resolution behaves differently per input type. Here is why audio never moves, where the official docs disagree with each other, and how to recount input tokens on your own API key.