Pass router tags in request headers - x-litellm-tags (#8609)

* feat(litellm_pre_call_utils.py): support `x-litellm-tags` request header

allow tag based routing + spend tracking via request headers

* docs(request_headers.md): document new `x-litellm-tags` for tag based routing and spend tracking

* docs(tag_routing.md): add to docs

* fix(utils.py): only pass str values for openai metadata param

* fix(utils.py): drop non-str values for metadata param to openai

preview-feature, otel span was being sent in
This commit is contained in:
Krish Dholakia 2025-02-18 08:26:22 -08:00 committed by GitHub
parent 7bfd816d3b
commit 2340f1b31f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 122 additions and 22 deletions

View file

@ -634,7 +634,6 @@ class Router:
"""
if fallback_param is None:
return
for fallback_dict in fallback_param:
if not isinstance(fallback_dict, dict):
raise ValueError(f"Item '{fallback_dict}' is not a dictionary.")