Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Wrong input token count for image prompt in gemini-flash-2.0 API

As per this doc, the image in the prompt to gemini API is counted as a fixed 258 tokens. I verified that the same is true for gemini-1.5-flash, gemini-1.5-flash-8b and gemini-2.0-pro-exp-02-05 models. But for gemini 2.0-flash model, I am getting the prompt_token_count as high as 2300 tokens, which is a 9x increase in token count.

I even verified this by sending the image with empty text prompt so that i am sure that text prompt is not taking up any tokens. The exact same code results in prompt_token_count of ~300 for other models.

Anyone else facing this issue ?

 

0 0 31
0 REPLIES 0