6 views
-/https://github.com/berriai/litellm/issues/28001
GitHub · issue

#28001 [Bug]: Error transforming OpenRouter image generation response: 2 validation errors for ImageUsage

  • State: open
  • Author: @zieddhf
  • Labels: bug, proxy

### Check for existing issues

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

### What happened?

Image generation using OpenRouter image models (via dockerized LiteLLM) randomly fails when triggered through OpenWebUI.

### Steps to Reproduce

1. Configure LiteLLM to use OpenRouter image models 2. Generate an image via OpenWebUI

### Relevant log output

```shell endpoints.py:181 - litellm.proxy.proxy_server.image_generation(): Exception occured - litellm.APIError: APIError: OpenrouterException - Error transforming OpenRouter image generation response: 2 validation errors for ImageUsage output_tokens Input should be a valid integer, got a number with a fractional part [type=int_from_float, input_value=14417.92, input_type=float] For further information visit https://errors.pydantic.dev/2.12/v/int_from_float total_tokens Input should be a valid integer, got a number with a fractional part [type=int_from_float, input_value=14474.92, input_type=float] ```

### What part of LiteLLM is this about?

Proxy

### What LiteLLM version are you on ?

v1.84.0

GitHub resolver

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

Refresh page
vote history (4 events)
#0 of 0 · 31d18h55m20s ago — entered · #import:https:::github.com:berriai:litellm post #2051
The right issue requires cross-provider streaming lifecycle changes, fallback accounting, and careful billing and regression-test coverage, while the left issue is comparatively localized schema handling in one integration.
34420 requires coordinated request-construction changes across Bedrock capability and tool-handling paths, preserving existing tool-enabled behavior and adding regression coverage for multiple parameter combinations. 28001 is comparatively localized response normalization and validation handling in the OpenRouter image-generation adapter, with narrower compatibility risk.
The left task requires a public SDK API change, propagation across initialization and request paths, backward-compatible fallback behavior, and integration testing. The right task is more localized to response parsing and numeric validation, with narrower regression risk.
#0 of 0 · 31d18h29m38s ago — current · #import:https:::github.com:berriai:litellm post #2459
30314 requires tracing and correcting provider-specific embedding request construction and shared proxy transformations, with compatibility and regression risks; 28001 is a narrower response-model normalization fix for non-integer usage values.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search