Internal Server Error (500) with gemini-2.0-flash-thinking-exp-1219 model

I’m experiencing consistent 500 Internal Server errors when trying to use the gemini-2.0-flash-thinking-exp-1219 model for image analysis. Here are the details:

Issue:

  • Error message: 500 INTERNAL {“error”: {“code”: 500, “message”: “An internal error has occurred”, “status”: “INTERNAL”}}
  • Model: gemini-2.0-flash-thinking-exp-1219
  • Request type: Image analysis
  • File format: JPEG
  • API version: google-generativeai latest

Steps to reproduce:

  1. Initialize the Gemini client with valid API key
  2. Load a JPEG image file
  3. Send a generate_content request to the thinking model
  4. Receive 500 Internal Server Error

Additional information:

  • The same code works correctly with gemini-2.0-flash-exp model
  • The error is consistent and occurs on multiple attempts
  • Image file is valid and works with other models
  • No issues with API key or authentication

Code sample:

response = client.models.generate_content(
    model='gemini-2.0-flash-thinking-exp-1219',
    contents=[
        'What do you see in the image?',
        types.Part.from_bytes(
            data=image_bytes,
            mime_type='image/jpeg'
        )
    ]
)
1 Like