diff --git a/__pycache__/patch_expose_cost_headers.cpython-314.pyc b/__pycache__/patch_expose_cost_headers.cpython-314.pyc index 4558d99..7fac41f 100644 Binary files a/__pycache__/patch_expose_cost_headers.cpython-314.pyc and b/__pycache__/patch_expose_cost_headers.cpython-314.pyc differ diff --git a/patch_expose_cost_headers.py b/patch_expose_cost_headers.py index be6e078..72f9bc1 100644 --- a/patch_expose_cost_headers.py +++ b/patch_expose_cost_headers.py @@ -29,7 +29,7 @@ import sys # The header names the proxy can set, taken from the running image rather than # guessed: grep -rhoE 'x-litellm-[a-z0-9-]*cost[a-z0-9-]*' over the litellm package. -COST_HEADERS = [ +EXPOSED_HEADERS = [ "x-litellm-response-cost", "x-litellm-response-cost-input", "x-litellm-response-cost-output", @@ -42,13 +42,23 @@ COST_HEADERS = [ "x-litellm-response-cost-reasoning", "x-litellm-response-cost-tool-usage", "x-litellm-classifier-cost", + # Telemetry names, requested in co-op/support#39 (2026-10-31): model identity, + # call id, the caller's own key spend, timings and retry/fallback counts. + "x-litellm-model-name", + "x-litellm-call-id", + "x-litellm-key-spend", + "x-litellm-response-duration-ms", + "x-litellm-overhead-duration-ms", + "x-litellm-callback-duration-ms", + "x-litellm-attempted-retries", + "x-litellm-attempted-fallbacks", ] OLD = " expose_headers=LITELLM_UI_ALLOW_HEADERS,\n" NEW = ( " expose_headers=LITELLM_UI_ALLOW_HEADERS\n" " + [\n" - + "".join(f' "{h}",\n' for h in COST_HEADERS) + + "".join(f' "{h}",\n' for h in EXPOSED_HEADERS) + " ],\n" ) @@ -72,7 +82,7 @@ def main() -> int: return 0 target.write_text(src.replace(OLD, NEW)) - print(f"expose-cost-headers: appended {len(COST_HEADERS)} cost header names to expose_headers in {target}") + print(f"expose-cost-headers: appended {len(EXPOSED_HEADERS)} cost header names to expose_headers in {target}") return 0