From a0a951b34fd023ad4a8d8136f501055175a86997 Mon Sep 17 00:00:00 2001 From: RoomWithOutRoof <166608075+Jah-yee@users.noreply.github.com> Date: Sat, 14 Mar 2026 12:54:43 +0800 Subject: [PATCH] fix: forward extra_headers to HuggingFace embedding calls (#23525) Fixes #23502 The huggingface_embed.embedding() call was not receiving the headers parameter, causing extra_headers (e.g., X-HF-Bill-To) to be silently dropped. Other providers (openrouter, vercel_ai_gateway, bedrock) already pass headers correctly. This fix adds headers=headers to match the behavior of other providers. Co-authored-by: Jah-yee --- litellm/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/main.py b/litellm/main.py index 722b4a7aaec..5a1b7f0fe16 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -5122,6 +5122,7 @@ def embedding( # noqa: PLR0915 client=client, aembedding=aembedding, litellm_params=litellm_params_dict, + headers=headers, ) elif custom_llm_provider == "bedrock": if isinstance(input, str):