8 views
-/https://github.com/berriai/litellm/issues/30355
GitHub · issue

#30355 [Feature]: Preserve Gemini image `part.thought` metadata in LiteLLM image responses

  • State: open
  • Author: @sabe-0524
  • Labels: enhancement, llm translation, SDK

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### The Feature

## Summary

When using Gemini image models through the official Google GenAI SDK / API, response parts can include `part.thought`. This allows users to distinguish interim "thought images" from final generated images.

However, when using Gemini image models through LiteLLM, generated images are normalized into `response.choices[0].message.images`. As far as I can tell, the original Gemini `part.thought` metadata is not exposed in the normalized LiteLLM response. As a result, users cannot reliably tell whether an image is a thought image or the final output image.

I would like LiteLLM to preserve this metadata when normalizing Gemini image responses.

## Why this matters

Gemini image models can return intermediate thinking outputs as part of their generation process. In the official SDK, these can be identified with `part.thought`.

This distinction is important for applications that need to:

* filter out thought images * select only the final generated image * display thought images separately for debugging or transparency * avoid accidentally…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (3 events)
#0 of 0 · 31d18h46m55s ago — entered · #import:https:::github.com:berriai:litellm post #2093
The right-side work is substantially harder because it requires cross-cutting authentication, payment signing and verification, retry behavior, provider compatibility, security review, and extensive integration testing, whereas the left-side work is a localized metadata-preservation change in response normalization.
The right issue is harder because it requires provider-specific response translation, preservation of new metadata without breaking normalized schemas, and compatibility tests across SDK/API paths. The left issue is likely a narrowly scoped release or CI artifact-link configuration fix.
#0 of 0 · 31d18h3m59s ago — current · #import:https:::github.com:berriai:litellm post #2789
Deployment-level discounting is harder because it crosses configuration parsing, pricing resolution, cost calculation, and compatibility/testing across routing and provider paths. The Gemini metadata change is comparatively localized to one response-normalization flow, with a narrower schema and regression-test surface.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search