7 views
-/https://github.com/berriai/litellm/issues/35068
GitHub · issue

#35068 [Bug]: Failed proxy requests can lose call_type and router metadata in spend logs

  • State: open
  • Author: @silencedoctor
  • Labels: proxy

## Check for existing issues

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

## What happened?

When a proxied LLM request fails, the failure spend log can be created from a request payload that does not preserve the route's actual call type and does not merge LiteLLM's internal metadata bucket into the spend-tracking metadata.

Observed impact:

- A failed Responses API request can be logged with a stale/default call_type such as acompletion instead of aresponses. - Router metadata stored in litellm_metadata, such as model_group and model_info.id, can be missing from the final SpendLogsPayload for the failed request. - Retry metadata and request tags can be split across metadata/litellm_metadata buckets and fail to reach the failure spend log.

Expected behavior:

- Failed requests should be attributed to the actual proxy route call_type. - Failure spend logs should preserve internal router metadata needed for model-group and deployment-level attribution. - Caller-supplied user_api_key* metadata should not be trusted for spend-log identity attribution.

## Steps to Reproduce

1. Use a proxy route that stores internal metadata in litellm_me…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d19h8m48s ago — entered · #import:https:::github.com:berriai:litellm post #1731
The left issue is harder because it involves cross-cutting proxy failure-path data propagation, attribution invariants, and regression coverage across multiple request and logging flows. The right is comparatively localized to a provider-specific parameter translation.
Streaming lifecycle recovery spans provider-specific behavior, partial-response accounting, exception paths, concurrency, and broad regression testing; the metadata attribution fix is more localized to request transformation and failure-log construction.
#0 of 0 · 31d18h47m51s ago — current · #import:https:::github.com:berriai:litellm post #2075
#35068 is harder because it spans proxy error handling, route classification, metadata precedence, retry behavior, and spend-log attribution, requiring cross-cutting investigation and regression coverage. #33184 is comparatively localized to parameter propagation through the OpenAI translation path with focused adapter and proxy tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search