Skip to content

Gemini API latency has recently increased significantly, especially with store=true #3059

Open

Description

@GTing31

We have noticed a significant increase in the time before Gemini responses start, particularly when conversation storage is enabled (store=true).

For Gemini 3.5 Flash-Lite, the median time to first text increased from approximately 1.2 seconds to 4.0 seconds. This means approximately 2.8 seconds of additional waiting before any text appears. We also found this storage-related delay in other Gemini models.

Historical latency comparison

All values below are medians in seconds.

Model Earlier measurement October 6, 2026 Increase
gemini-3.5-flash-lite: time to first text 1.196 (September 7) 4.010 +2.814
gemini-3.5-flash-lite: answer ready 1.440 (September 7) 4.246 +2.806
gemini-3.7-flash: time to first text 1.255 (September 3) 5.135 +3.880

The Flash-Lite figures cover 10 requests per measurement; the 3.7 Flash figures cover 5. All of these requests used store=true.

Storage-related delay across models

On October 6, we observed the following median times to full API completion:

Model store=true store=false Additional time with storage
gemini-3.5-flash-lite 3.822 1.010 +2.812
gemini-3.5-flash 4.852 1.854 +2.998
gemini-3.7-flash 7.258 2.289 +4.969
gemini-3.8-flash 4.822 1.735 +3.087

Each entry covers 5 requests, with all 40 requests succeeding. These are full completion times, whereas the historical table above measures time to first text and answer readiness. The storage-related delay appears across all four models; the historical increase differs by model.

Even a minimal hello prompt shows the delay

Using Gemini 3.5 Flash-Lite with only the prompt 只說hello (say hello only):

Metric store=true store=false Difference
Median time to first text 3.340 0.625 +2.715
Median time to full API completion 4.993 0.683 +4.310

All 20 requests succeeded, with 10 requests per setting. Even this very short prompt showed approximately 2.7 seconds of additional waiting before the first text appeared.

We observed no rate-limit errors, application retries, or fallback models in these batches. Direct curl requests also reproduced the storage-related delay.

The main concern is the increased waiting before the response starts, which noticeably affects interactive use. We cannot determine the internal cause from client-side measurements.

Has there been a recent change or a known latency issue with the Interactions API when store=true? Is the additional delay expected, and is there a way to reduce it while keeping conversation storage enabled?

Activity

  1. added
    type: questionRequest for information or clarification. Not an issue.
    priority: p3Desirable enhancement or fix. May not be included in next release.
    on Oct 6, 2026
  2. Venkaiahbabuneelam commented on Oct 6, 2026

    @Venkaiahbabuneelam

    Hi @GTing31, thanks for all the details! Could you share the exact code snippet of your receive loop? We'd love to try reproducing this on our end using the exact logic you have set up.
    Thanks

  3. GTing31 commented on Oct 7, 2026

    @GTing31
    Author

    Hi, thanks for looking into this!

    Below is a minimal example preserving the receive-loop logic from our hello test. We use LiteLLM's Interactions interface; the current environment has LiteLLM 1.96.2.

    Timing starts before the API call. We record time to first text when the first non-empty delta.text arrives, and continue consuming the stream through interaction.completed and stream exhaustion. There is no early exit or application-level retry in this example.

    Set GEMINI_API_KEY in the environment before running:

    import asyncio
    import os
    import time
    
    import litellm
    
    
    async def measure(store):
        started = time.perf_counter()
        first_text = None
        completion = None
        pieces = []
    
        stream = await litellm.interactions.acreate(
            model="gemini/gemini-3.5-flash-lite",
            input="只說hello",
            generation_config={
                "thinking_level": "minimal",
                "temperature": 0.0,
                "max_output_tokens": 32,
            },
            store=store,
            stream=True,
            api_key=os.environ["GEMINI_API_KEY"],
            timeout=60,
        )
    
        async for event in stream:
            data = event.model_dump()
            elapsed = time.perf_counter() - started
            event_type = data.get("event_type")
            part = (data.get("delta") or {}).get("text")
    
            if isinstance(part, str) and part:
                first_text = elapsed if first_text is None else first_text
                pieces.append(part)
    
            if event_type == "interaction.completed":
                completion = elapsed
    
        return {
            "store": store,
            "first_text_s": first_text,
            "completed_s": completion,
            "total_s": time.perf_counter() - started,
            "answer": "".join(pieces),
        }
    
    
    async def main():
        for store in (True, False):
            print(await measure(store))
            await asyncio.sleep(1)
    
    
    asyncio.run(main())

    Our October 6 hello test had 10 requests per setting:

    Median latency store=true store=false
    Time to first text 3.340 s 0.625 s
    Full stream duration 4.993 s 0.683 s

    All 20 requests succeeded. This example runs one request per setting; the reported medians are from the earlier 20-request batch.

    Separately, direct REST/curl requests also showed the storage-related delay. Those calls bypassed LiteLLM and the Python SDK.
    To reiterate, our main concern is the significant increase in latency recently. With store=true, Gemini 3.5 Flash-Lite’s median time to first text increased from approximately 1.2 seconds on September 7 to 4.0 seconds on October 6 — about 2.8 seconds of additional waiting before any text appears.

    We also observed an increase with Gemini 3.7 Flash, from approximately 1.3 seconds to 5.1 seconds. Could your team investigate whether any recent backend changes might explain this?

    thanks for your help!

  4. Venkaiahbabuneelam commented on Oct 12, 2026

    @Venkaiahbabuneelam

    Hi @GTing31, Thank you for sharing the reproduction snippet! We were able to reproduce the latency difference between store=True and store=False on our end using the native google-genai SDK. we will file a bug internally.
    Thanks

  5. GTing31 commented on Oct 30, 2026

    @GTing31
    Author

    Hi @Venkaiahbabuneelam,

    I'm following up on your October 12 update, where you confirmed reproducing the latency difference between store=True and store=False using the native google-genai SDK and mentioned filing an internal bug.

    Could you please share any updates on the investigation? Has the internal bug been filed, and has the team identified the cause of the increased latency?

    As described in the original report, the main concern is the additional delay before the first text appears, which significantly affects interactive use when conversation storage is enabled.

    If a fix is planned, is there an estimated timeline? In the meantime, are there any recommended workarounds to reduce this delay while keeping store=True?

    Please let me know if additional measurements or reproduction details would help.

    Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions