◉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, which is tomorrow. 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, which is tomorrow. 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/API / SDK
◈ API / SDK/2026-10-22Intermediate

Before You Swap in gemini-4-argon, Search Your Own Code for What to Remove

Four habits can break or silently change when you move to gemini-4-argon: explicit caches, sampling parameters, small max_output_tokens and short timeouts. A stdlib-only script finds them in your repository, with what to check after the swap and when to stay on Flash.

gemini-api288gemini-4-argonmigration11thinking-level3implicit-caching3python111

I opened the October 13 entry in the Gemini API changelog and learned that gemini-4-argon is generally available. Changing the model ID takes a minute. But I use Gemini for review-reply drafts and a few operations scripts in my indie app work, and the thing that unsettles me most is a morning after a swap when something has quietly shifted. So before replacing the string, I wanted to list what I'd have to take out.

What I'd like to say first: moving to Argon is mostly about removing things, not adding them. The official migration checklist names four habits to drop or review. I haven't run Argon in a production call myself, so this post is a tool for taking inventory of your own code before the swap, plus notes on how to read its output.

The four items the docs say will behave differently

The "What's new in Gemini 4 Argon" page lists these as the places to touch when migrating.

What your code doesOn ArgonWhat to do
Explicit caching via cachedContents / caches.createNot supported; implicit caching onlyRemove the create and reference calls
temperature / top_p / top_kAccepted but ignoredDelete them, or mark them clearly as inert
max_output_tokens below 32,768Thinking shares the budget, so answers can be cut shortRaise to at least 32,768; more for hard tasks
Short HTTP client timeoutsHard prompts can take minutes15 minutes or more, or use background execution

Implicit caching is on by default for prompts of at least 4,096 tokens, and cached input tokens get a 95% discount on a hit. If you built around explicit caches, the whole way you think about storage cost changes.

The two that fail without an error

An explicit cache call will probably fail loudly on Argon. temperature and max_output_tokens are the troublesome ones.

temperature is simply ignored, with no error. Code that pinned it at 0.2 to keep reply tone steady will keep running as if it were pinned. If the output starts to wander, "the setting isn't taking effect" is a hard thing to suspect.

max_output_tokens is similar. A job that fit in 8,192 tokens on a Flash model now shares that budget between thinking and the answer, so replies can end short or stop midway. The docs recommend at least 32,768 for apps that currently set a lower limit.

The changes that never raise an error are the ones to hunt for by hand, before the swap. I try to keep that rule every time a model changes.

A script that finds the four in your own code

This walks a repository and lists lines matching the four items above. It uses only the standard library and exits with status 1 if it finds anything. I checked on a few lines of sample code that it catches all four kinds.

#!/usr/bin/env python3
"""gemini-4-argon へ model を替える前に、自分のコードから引っかかる書き方を探す。"""
import pathlib
import re
import sys
 
EXTS = {".py", ".js", ".ts", ".tsx", ".mjs", ".sh", ".json", ".yaml", ".yml"}
SKIP = {"node_modules", ".git", ".next", "dist", "__pycache__", ".venv"}
 
CHECKS = [
    ("明示キャッシュ", r"cachedContents|caches\.create|cached_content|cachedContent",
     "Argon は明示キャッシュ非対応。呼び出しを外し、暗黙キャッシュに任せる"),
    ("サンプリング指定", r"\b(temperature|top_p|top_k|topP|topK)\b[\"']?\s*[:=]",
     "Argon では指定しても無視される。残すなら『効いていない』と分かる印を付ける"),
    ("出力上限が小さい", r"(max_output_tokens|maxOutputTokens)\"?\s*[:=]\s*(\d+)",
     "32,768 未満は思考で使い切るおそれ。数字を見て判断する"),
    ("短いタイムアウト", r"(timeout|timeout_ms|timeoutMs)\"?\s*[:=]\s*(\d+)",
     "難しい入力は数分かかる。15 分未満なら background 実行を検討する"),
]
 
 
def scan(root: pathlib.Path):
    hits = []
    for path in root.rglob("*"):
        if path.suffix not in EXTS or any(p in SKIP for p in path.parts):
            continue
        try:
            lines = path.read_text(encoding="utf-8").splitlines()
        except (UnicodeDecodeError, OSError):
            continue
        for no, line in enumerate(lines, 1):
            for name, pattern, hint in CHECKS:
                m = re.search(pattern, line)
                if not m:
                    continue
                if name == "出力上限が小さい" and int(m.group(2)) >= 32768:
                    continue
                hits.append((name, f"{path}:{no}", line.strip()[:90], hint))
    return hits
 
 
if __name__ == "__main__":
    target = pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else ".")
    found = scan(target)
    seen = set()
    for name, where, text, hint in found:
        print(f"[{name}] {where}\n    {text}")
        seen.add((name, hint))
    print(f"\n{len(found)} 件 / {len({n for n, _ in seen})} 種類")
    for name, hint in sorted(seen):
        print(f"- {name}: {hint}")
    sys.exit(1 if found else 0)

Run it as python3 argon_preflight.py ./my-app. Output looks like this:

[サンプリング指定] app/reply.py:12
    cfg = {"temperature": 0.2, "max_output_tokens": 8192}
[出力上限が小さい] app/reply.py:12
    cfg = {"temperature": 0.2, "max_output_tokens": 8192}

(The category labels are in Japanese because I wrote the script for my own use; they read as "sampling parameter" and "output limit too small".) One line showing up twice is intended: a single line can hold two problems, and it happens most to people who keep settings together in one dict.

Things to keep in mind when reading it

  • Timeout units are mixed. 60000 could be 60 seconds or 60,000 seconds depending on the library, so check the call site
  • It is regex-based, so it also matches comments and test data. The goal is to read every hit, not to reach zero
  • Lines where max_output_tokens is a variable have no readable number and won't be reported; look for those separately

What to check after switching

After the scan, I'd move one workload first rather than everything. Three things to watch:

  1. Whether responses are cut off (finishReason and character count)
  2. How many times larger the output tokens, thinking included, have become
  3. Compare low, medium and high thinking, and pick the lowest level that meets your quality bar

The docs give the same advice: evaluate at all three levels and take the smallest that works. The default is medium.

Check the price before you start, too. gemini-4-argon is at an introductory $2 per 1M input tokens and $10 per 1M output tokens (thinking included) through November 30, 2026, then $4 and $20 from December 1. gemini-3.8-flash is $0.75 and $3.75 through December 31, 2026. On list price alone Argon is several times higher, and it may spend more tokens on thinking. I covered the Flash side of the price change in a two-column estimate around the end of the introductory price.

You don't have to move everything

Having written this, my conclusion is that work with a high migration cost doesn't have to move. A short, fixed-format job like a first draft of a store-review reply is fine on Flash. The strengths the Argon page lists are complex coding, agents, math and science. I'd move only the work that falls there and leave the rest alone. That's where I've landed for now.

For telling whether the serving model changed underneath you, I wrote up logging the requested ID next to the served ID. I plan to keep that log running after the first workload moves to Argon.

Today, run argon_preflight.py once against your own repository and count what it prints. Once you have that number, half of the decision is already made.

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 →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◈ API / SDK2026-10-19
When 404 and 429 Show Up in the Same Gemini API Log, Check the Model Name Before the Quota
A triage order for Gemini API logs that mix 404 NOT_FOUND and 429 RESOURCE_EXHAUSTED, plus a small Python script that separates a bad model name from a real quota limit without generating anything.
◈ API / SDK2026-10-16
The Day /models Returns 200 but generateContent Returns 403 — Decide Your Triage Order Before It Happens
A triage order for the case where listing models succeeds with 200 but generation fails with 403 permission_denied. Includes a small diagnostic script that checks key, project, and billing in turn, why you should not retry a 403, and how to assemble what support needs.
◈ API / SDK2026-09-04
Screen Loop Seam Clicks With Numbers Before You Hand the Audio to Gemini
An ambient loop that clicks only at the wrap point. Here is the numeric prescreen I run before sending anything to audio understanding, why an absolute threshold fails, and how AAC encoding quietly rebuilt the seam I had just repaired.