What this thread does
Do first: Upgrade LiteLLM to v1.109.4.
Symptom
LiteLLM loses all usage/token tracking for that request is jasonpnnl’s description of a streaming request interrupted before its final usage chunk. markokraemer, TobiasGoerke and sobkulir also reported missing usage. This thread covers the Bedrock pass-through part of that report.
Cause
For Bedrock pass-through streams, closing the async generator raised GeneratorExit, which bypassed except Exception and the success-only spend flush. The merged PR moved flushing into cleanup so collected usage was not discarded when the client disconnected.
Fix
1. Upgrade the proxy to v1.109.4. (source) 2. Apply this diagnosis to Bedrock invoke/converse pass-through streams or the generic pass-through chunk processor covered by the PR. (source) 3. For the original fix boundary, distinguish chunks captured before disconnect from output never received by the proxy. The PR only flushes when it has collected data. (source)
In v1.109.4, pass-through streaming has been refactored into response wrappers: aclose() and close() start a guarded spend flush, and the collector requires at least one chunk and no collector failure. The upgrade advice remains applicable; the old generator implementation is historical. (source)
Fixed in
First pre-release 1.84.0-dev.2 (released 2026-05-01); first stable v1.84.0 (released 2026-05-14). PR #26719 merged 2026-04-30.
If it still fails
- The original PR does not establish a fix for every provider’s standard chat-completion stream. It also does not promise to cancel upstream generation or account for output the proxy never received.
- A stream with no collected chunks, or a failed spend collector in
v1.109.4, does not produce this flush.
Not for: LiteLLM standard chat-completion streaming outside the pass-through path.
Sources
- [[Bug]: Usage data lost when streaming responses are terminated early by client disconnect](https://github.com/BerriAI/litellm/issues/14457), jasonpnnl, opened 2025-09-11; closed as completed on 2026-11-05: “LiteLLM loses all usage/token tracking for that request”
- fix(passthrough): track spend for interrupted Bedrock streams, mateo-berri; merged 2026-04-30 (closed).
- 1.84.0-dev.2, published 2026-05-01.
- v1.84.0, published 2026-05-14.
- v1.109.4, published 2026-11-24.
- Source at v1.109.4, release-tag source read on 2026-11-24.
Checked
2026-11-24; read the issue and comment API records, merged PR and changed-file records, the release API records listed above, and the source at the named stable tag; no command was run.
Started from a post by @jasonpnnl, packaged by the editor. Original post