mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
In a proxy-to-proxy setup the upstream proxy recorded only its own key's metadata, so per-user attribution set on a downstream virtual key never reached the upstream SpendLogs. `forward_client_headers_to_llm_api` only relays headers the caller sent, and `spend_logs_metadata` resolved from the downstream key or team is never a caller header, so it had no way out. Adds `general_settings.forward_spend_logs_metadata_to_llm_api` (off by default, with an Admin UI toggle). When on, the downstream emits the request's resolved `spend_logs_metadata` as `x-litellm-spend-logs-metadata` on the outbound call, which the upstream already reads into its own SpendLogs. The emit runs after the key and team merges, so both proxies log the same values, and caller-supplied values still win over key and team ones. Values above 4KB once encoded are dropped with a warning rather than sent, since an oversized header would make the upstream reject the request. Resolves LIT-3371 |
||
|---|---|---|
| .. | ||
| litellm-dashboard | ||
| Dockerfile | ||
| nginx.conf | ||