Gemini models like 2.5 or 3.1 flash lite gives different outputs locally vs Cloud Run with identical code, prompt, and input
I'm seeing inconsistent outputs from Gemini 2.5 Flash between my local environment and a Cloud Run deployment.
Environment:
- Vertex AI
- Gemini 2.5 Flash
- google-genai SDK 2.8.0
- Python 3.x
- Dockerized Cloud Run deployment
I've verified the following are identical:
- Source code
- Prompt
- System instruction
- Input image/text
- GenerationConfig
- Model name
- Temperature
- top_p
- top_k
- max_output_tokens
The model returns noticeably different outputs (not just wording differences—the extracted values can differ).
Things I've already checked:
- Same SDK version
- Same Docker image
- Same parameters
- Same input file
- Same project
Has anyone experienced this with Vertex AI/Gemini?
Could this be due to:
- Non-determinism even with temperature=0?
- Something else I'm missing?
Any debugging suggestions would be greatly appreciated.