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

#30139 [Bug]: LiteLLM Bedrock passthrough fails with Claude Code after several requests: missing model attribute on httpx.Response and h11 Content-Length error

  • State: open
  • Author: @AleKitsune98
  • Labels: bug, llm translation, claude code

### Check for existing issues

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

### What happened?

Hello everyone, I am using Claude Code through a LiteLLM proxy that routes Claude requests to Anthropic Claude models on AWS Bedrock.

After several successful or partially successful requests, LiteLLM starts failing repeatedly with the following error pattern:

1. LiteLLM logs:

"cannot override response model; missing `model` attribute. response_type=<class 'httpx.Response'>

2. Immediately after that, Uvicorn/h11 raises:

"h11._util.LocalProtocolError: Too much data for declared Content-Length"

This happens in repeated bursts, not as a single isolated failure. It happens especially when Claude Code needs to write new files.

The issue seems to happen when LiteLLM receives a raw httpx.Response from the Bedrock passthrough path and then tries to treat it as a modeled LiteLLM/OpenAI/Anthropic response with a model attribute. When this fails, the ASGI response handling also breaks due to a Content-Length mismatch.

How can I solve this issue? Thank you in advance.

### Steps to Reproduce

1. Configure Claude Code to use LiteLLM as an Anthropic-…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h47m18s ago — entered · #import:https:::github.com:berriai:litellm post #2285
#30139 is harder because it crosses passthrough response normalization, streaming/error handling, and ASGI protocol behavior, with intermittent state-dependent failures requiring broader integration testing. #24158 is comparatively localized to Bedrock request-parameter handling with a narrower compatibility 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