From 1df71606a320749aae7428d66ce8a238182090f4 Mon Sep 17 00:00:00 2001 From: Jah-yee Date: Fri, 13 Mar 2026 18:12:48 +0800 Subject: [PATCH] fix: forward extra_headers to HuggingFace embedding calls 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. --- litellm/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/main.py b/litellm/main.py index 4e4ce976ac4..bf19f993514 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -5098,6 +5098,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):