BerriAI/litellm · error · HuggingFaceError

{error}

Error message

{error}

What it means

Error "{error}" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/huggingface/embedding/handler.py:278

        if client is None:
            client = get_async_httpx_client(
                llm_provider=litellm.LlmProviders.HUGGINGFACE,
            )

        response: Final = await client.post(api_base, headers=headers, data=json.dumps(data))

        ## LOGGING
        logging_obj.post_call(
            input=input,
            api_key=api_key,
            additional_args={"complete_input_dict": data},
            original_response=response,
        )

        embeddings: Final = response.json()

        if "error" in embeddings:
            raise HuggingFaceError(status_code=500, message=embeddings["error"])

        ## PROCESS RESPONSE ##
        return self._process_embedding_response(
            embeddings=embeddings,
            model_response=model_response,
            model=model,
            input=input,
            encoding=encoding,
        )

    def embedding(
        self,
        model: str,
        input: list,
        model_response: EmbeddingResponse,
        optional_params: dict,
        litellm_params: dict,
        logging_obj: LiteLLMLoggingObj,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Read the error content from the HuggingFace response included in the exception.
  2. Verify HF_API_KEY, the model/endpoint, and that the model is loaded (cold starts return errors until warm).

When it happens

Trigger: Thrown at litellm/llms/huggingface/embedding/handler.py:278 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/4270a7a50f3e9036. Report an issue: GitHub.