16 views
-/https://github.com/berriai/litellm/issues/26320
GitHub · issue

#26320 fix(bedrock/messages): convert top-level `cache_control` to per-block caching when routing /v1/messages to Bedrock

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

## Description When using the native `/v1/messages` endpoint with a LiteLLM proxy that routes to **AWS Bedrock**, sending a top-level `cache_control` field (Anthropic's [automatic prompt caching](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching#automatic-caching)) causes a `400` error. The same request sent directly to Anthropic's API succeeds. This affects any client that uses Anthropic's automatic caching API — including pydantic-ai's `AnthropicModelSettings(anthropic_cache="1h")`, which adds a top-level `cache_control` when it detects a non-Bedrock client.

---

## Error

status_code: 400 body: {'error': {'message': '{"message":"cache_control: Extra inputs …

GitHub resolver

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

Refresh page
vote history (7 events)
#0 of 0 · 31d19h6m55s ago — entered · #import:https:::github.com:berriai:litellm post #1750
The left issue requires cross-provider request normalization, nested content-block transformation, compatibility handling for multiple message shapes, and regression coverage across Anthropic and Bedrock paths. The right issue is comparatively localized to multipart parameter mapping and adapter-level tests.
#34766 requires cross-cutting routing design, session-key semantics, state handling, and compatibility testing across affinity and adaptive behavior; #26320 is a comparatively localized provider-translation fix with narrower regression scope.
The left issue is harder because it involves a broad regression in multimodal message translation, reasoning content, tool flows, and compatibility across proxy/provider schemas, requiring wider investigation and regression coverage. The right issue is a narrowly scoped Bedrock request normalization with a clearer transformation boundary.
#34367 requires cross-model spend aggregation, budget enforcement, persistence, configuration, and edge-case handling across proxy request flows. #26320 is a narrower provider-specific request translation fix with a smaller testing surface.
The right issue is harder because it requires provider-specific request translation, nested message restructuring, preservation of existing caching semantics, and broader compatibility testing. The left issue is comparatively localized to final streaming-event construction and validation across affected response paths.
The right issue is harder because it requires provider-specific request translation, careful preservation of message semantics, and comprehensive compatibility testing across routing paths. The left issue is comparatively contained to container image packaging, repository configuration, and build validation.
#0 of 0 · 31d18h3m14s ago — current · #import:https:::github.com:berriai:litellm post #2788
The first issue is harder because it spans managed-resource identity, persistence, asynchronous batch completion, authorization, routing, and compatibility testing. The second is comparatively localized to request normalization in one provider adapter with focused regression coverage.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search