#26939 Title: Vertex AI Gemini streaming silently drops per-request timeout, falling back to litellm.request_timeout (6000s)
Summary When calling litellm.completion(..., stream=True) against a Vertex AI / Google AI Studio Gemini model, the per-request timeout argument is silently discarded. Streams that stall before the first token hang for the full litellm.request_timeout (default 6000s = 100 minutes) instead of failing at the configured timeout. The non-streaming branch of the same handler propagates timeout correctly — only the streaming branch is broken.
Version litellm == 1.83.0 (also reproduces on main as of filing) Python 3.10 Provider: vertex_ai and gemini (both routes through the same handler) Repro import litellm import time
# Set a small request_timeout so the bug doesn't take 100 minutes to surface. # In practice, the bug means the per-call `timeout` is ignored regardless. litellm.request_timeout = 30
start = time.monotonic() try: response = litellm.completion( model="vertex_ai/gemini-2.5-flash", messages=[{"role": "user", "content": "hello"}], stream=True, timeout=2, # expect to fail in ~2s on a stalled stream ) for chunk in response: pass except Exception as e: print(f"failed after {time.monotonic() - start:.1f}s wi…