litellm/ui
Yucheng He 9b6742b6d8 feat(proxy): forward spend logs metadata to an upstream LiteLLM proxy
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
2026-09-03 11:36:28 -07:00
..
litellm-dashboard feat(proxy): forward spend logs metadata to an upstream LiteLLM proxy 2026-09-03 11:36:28 -07:00
Dockerfile build(ui): bump nginx to 1.31-alpine 2026-08-27 17:09:17 +00:00
nginx.conf fix(ui): boot the UI image as an arbitrary uid by anchoring nginx writes under /tmp (#37982) 2026-08-24 11:57:36 -07:00