9 views
-/https://github.com/berriai/litellm/issues/30707
GitHub · issue

#30707 generate_content adapter path raises ValueError: httpx_response is None in logging

  • State: open
  • Author: @fktpp2022
  • Labels: llm translation

## Summary

When `litellm.google_genai.generate_content()` routes through the adapter path (i.e., `generate_content_provider_config is None`), the success logging handler crashes with:

``` ValueError: Google GenAI Generate Content: httpx_response is None ```

The actual LLM call succeeds (HTTP 200 is returned to the caller), but the background logging worker fails because the logging handler assumes a raw `httpx.Response` is always available, which is not true for the adapter path.

## Reproduction

### Setup

Define an OpenAI-compatible provider with a Gemini alias in your proxy config:

```yaml model_list: - model_name: "sensenova-6.7-flash-lite" litellm_params: model: openai/sensenova-6.7-flash-lite api_base: https://token.sensenova.cn/v1

router_settings: model_group_alias: gemini-3.5-flash-lite: sensenova-6.7-flash-lite gemini-2.5-flash-lite: sensenova-6.7-flash-lite gemini-3.1-flash-lite: sensenova-6.7-flash-lite flash-lite: sensenova-6.7-flash-lite

general_settings: master_key: sk-1234

litellm_settings: drop_params: True ```

### Call

```bash curl -X POST http://localhost:4000/v1beta/models/gemini-3.1-flash-lite%3AgenerateContent \…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h50m44s ago — entered · #import:https:::github.com:berriai:litellm post #2016
The right issue is harder because it likely requires tracing provider-specific request state across streaming, retries, and multi-turn proxy flows, then validating billing semantics without regressions. The left issue appears more localized to defensive logging and adapter response handling.
28811 requires cross-layer routing semantics, configuration/design decisions, and compatibility testing across gateway-aware and existing backend-selection paths. 30707 is comparatively localized: harden one logging path for an absent response and add focused regression coverage.
#0 of 0 · 31d18h38m5s ago — current · #import:https:::github.com:berriai:litellm post #2226
The right-side task is harder because it involves control-flow and observability behavior across multiple adapter and logging paths, with greater regression risk and a need for integration-focused validation. The left-side task is comparatively bounded registry maintenance with straightforward coverage checks.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search