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 <sparklab@outlook.com>
This commit is contained in:
RoomWithOutRoof 2026-03-14 12:54:43 +08:00 committed by GitHub
parent 2405e0d400
commit a0a951b34f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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