From 60bc9672399cd324d8818a87a1f0776f8d9d1d67 Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Tue, 27 Oct 2026 10:40:15 -0700 Subject: [PATCH] fix(huggingface): keep the unreachable async lookup path untouched The async model lookup helper and the call_type="async" transform branch are never reached, since the async embedding path transforms through the sync lookup. Leave them as they were so the change only touches requests that actually run. --- litellm/llms/huggingface/embedding/handler.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/litellm/llms/huggingface/embedding/handler.py b/litellm/llms/huggingface/embedding/handler.py index 11fb74abcf2..5d997babc6e 100644 --- a/litellm/llms/huggingface/embedding/handler.py +++ b/litellm/llms/huggingface/embedding/handler.py @@ -57,9 +57,7 @@ def get_hf_task_embedding_for_model( return pipeline_tag -async def async_get_hf_task_embedding_for_model( - model: str, task_type: str | None, api_base: str, timeout: float | httpx.Timeout | None = None -) -> object: +async def async_get_hf_task_embedding_for_model(model: str, task_type: str | None, api_base: str) -> object: if task_type is not None: if task_type in get_args(hf_tasks_embeddings): return task_type @@ -69,7 +67,7 @@ async def async_get_hf_task_embedding_for_model( llm_provider=litellm.LlmProviders.HUGGINGFACE, ) - model_info: Final = await http_client.get(url=f"{api_base}/api/models/{model}", timeout=timeout) + model_info: Final = await http_client.get(url=f"{api_base}/api/models/{model}") model_info_dict: Final = decoded_json_object(_DECODED_JSON.validate_python(model_info.json())) @@ -111,11 +109,8 @@ class HuggingFaceEmbedding(BaseLLM): embed_url: str, input: list, optional_params: dict, - timeout: float | httpx.Timeout | None = None, ) -> dict: - hf_task = await async_get_hf_task_embedding_for_model( - model=model, task_type=task_type, api_base=HF_HUB_URL, timeout=timeout - ) + hf_task = await async_get_hf_task_embedding_for_model(model=model, task_type=task_type, api_base=HF_HUB_URL) data: Final = self._transform_input_on_pipeline_tag(input=input, pipeline_tag=hf_task) @@ -177,9 +172,7 @@ class HuggingFaceEmbedding(BaseLLM): model=model, task_type=task_type, api_base=HF_HUB_URL, timeout=timeout ) elif call_type == "async": - return self._async_transform_input( - model=model, task_type=task_type, embed_url=embed_url, input=input, timeout=timeout - ) + return self._async_transform_input(model=model, task_type=task_type, embed_url=embed_url, input=input) data = self._transform_input_on_pipeline_tag(input=input, pipeline_tag=hf_task)