Menu

Shrinking My Photos Did Not Cut My Gemini Bill
📰

Shrinking My Photos Did Not Cut My Gemini Bill

DEV Community: rails·MarcoBlch·10 days ago
#2zjwUvQW
#devtorails#devto#dev#setting#every
Long article (839 words) — no AI summary yet.
Reading 0:00
15s threshold

Every time someone adds a piece of clothing to their wardrobe in OutfitMaker , a background job sends the photo to Gemini on Vertex AI. The model returns a small JSON object: category, colour, a description, a few tags, translated labels, and which way the garment is rotated in the photo. That is the whole job. It runs on every upload, so it runs a lot.

On November 20 I read the Google Cloud bill line by line. The top line was image input for that analysis call, about 15 euros over 30 days. Not a disaster, but it was the biggest one, and it grows with every new user who photographs their closet.

The obvious fix, which does nothing

Phones take large photos. My first idea was the one everybody has: resize the image to something modest before encoding it, send fewer bytes, pay less.

Before writing that code I checked how Gemini counts image tokens. It does not bill by bytes or by pixels in the way I assumed.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.