TECHNOLOGY

LiteLLM preserves caller correlation metadata when authentication or budget checks reject a request

In this article
THE QUICK TAKE

Verify failure-row correlation and unchanged rejection semantics, while keeping caller markers separate from authenticated identity and checking cleanup between requests.

LiteLLM v1.111.0-dev.4 preserves caller-provided spend-log metadata on authentication failures, including rejected keys and exceeded budgets. The November 15 prerelease leaves the rejection response itself unchanged. This helps correlate failed attempts, but metadata supplied by a rejected caller remains a claim, so observability should not confuse a useful request marker with authenticated identity.

Give each rejected attempt a safe marker

Send synthetic requests with an invalid key, an exhausted test budget and a valid control key. Use distinctive harmless metadata for each and inspect final spend rows and callbacks. A rejection can occur before ordinary logging setup, so checking successful requests alone misses the changed path. Preserve the external request identity as well, allowing the caller to locate its failed attempt without embedding prompt content or live credentials in the marker.

Untrusted metadata should not become identity

Include a marker that resembles a team or user field and verify the application still displays authenticated scope from its authoritative source. The feature preserves diagnostic context; it does not validate every supplied value. Keep provenance visible in downstream analytics. Otherwise a rejected caller can make its log row appear to belong to another team simply because a dashboard groups by free-form metadata without distinguishing that field from verified authentication attributes.

Header precedence and malformed input need controls

Exercise the supported metadata header alongside any body metadata the application sends. Record the intended precedence, then submit missing and malformed header values. The rejection outcome should stay meaningful and the logger should not turn bad metadata into an unrelated server error. Use small synthetic values so the fixture tests merging and parsing rather than an accidental payload-size limit outside the release fix.

Cleanup prevents cross-request attribution

Immediately follow a marked failure with an unmarked request on the same worker and inspect its record. No previous marker should leak through retained logging context. Repeat under bounded concurrency with distinct identities. The useful adoption result is correlated failures without changed authorization, response codes or successful-request behavior. It does not imply failed requests consumed model tokens, nor that every diagnostic field is safe to trust as a billing owner.

Sources

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.

Explore GPU hosting
← All articles