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.
This commit is contained in:
Jah-yee 2026-03-13 18:12:48 +08:00
parent 56557bfae1
commit 1df71606a3

View file

@ -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):