In this article
Test declared size, streamed size and stalled upload separately; optional log enrichment must preserve the original refusal and bounded resource use.
The November 13 LiteLLM v1.111.0-dev.2 prerelease restores failure-log context for cached keys refused before request-body processing. Small declared JSON bodies may supply model and trace metadata, while oversized bodies remain unread. The implementation caps actual streamed bytes and waits as well as declared length. This makes observability compatible with the earlier memory-protection boundary rather than requiring a full upload before rejecting an already blocked key.
Use small JSON as a positive control
Send a refused synthetic key with a small valid JSON body containing a recognizable model and safe trace tags. Confirm the existing refusal status, caller call ID, route classification and configured logging destination. The implementation reads only selected logging fields from the body. A successful failure trace should not imply that normal request validation or provider dispatch ran; verify the owned provider fixture received no inference request.
Declared length is only the first boundary
The PR permits declared JSON bodies up to 64 KiB and also enforces the cap on bytes actually streamed. Use controlled fixtures for an oversized declaration and a dishonest smaller declaration followed by excess bytes. Observe read activity and memory use without uploading harmful content. Both paths should retain bounded behavior. A Content-Length check alone cannot establish the latter case, particularly when an upstream test client does not send what it declared.
A stalled upload must not hold the rejection
Start a declared small body and pause delivery at an owned test barrier. The enrichment read gives up after one second according to the implementation. Check the original 401 or 429 outcome and absence of provider access rather than waiting for the client to finish uploading. Record the tested timeout conditions; this is a bound on an optional read, not a universal promise that every network observer receives the response within exactly one second.
Best-effort metadata must remain best effort
Omit the body model, send a non-JSON content type and supply harmless malformed JSON in separate refused requests. Missing enrichment should not replace the original key rejection with a new 400. A useful adoption report pairs refusal identity and destination coverage with measured read boundaries, then distinguishes missing optional model metadata from a failed rejection. This preserves both explainable logs and the purpose of refusing expensive request processing before admission.
Sources
Related reading
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.