{"record":{"id":"4270a7a50f3e9036","repo":"BerriAI/litellm","slug":"error","errorCode":null,"errorMessage":"{error}","messagePattern":"\\{error\\}","errorType":"exception","errorClass":"HuggingFaceError","httpStatus":500,"severity":"error","filePath":"litellm/llms/huggingface/embedding/handler.py","lineNumber":278,"sourceCode":"        if client is None:\n            client = get_async_httpx_client(\n                llm_provider=litellm.LlmProviders.HUGGINGFACE,\n            )\n\n        response: Final = await client.post(api_base, headers=headers, data=json.dumps(data))\n\n        ## LOGGING\n        logging_obj.post_call(\n            input=input,\n            api_key=api_key,\n            additional_args={\"complete_input_dict\": data},\n            original_response=response,\n        )\n\n        embeddings: Final = response.json()\n\n        if \"error\" in embeddings:\n            raise HuggingFaceError(status_code=500, message=embeddings[\"error\"])\n\n        ## PROCESS RESPONSE ##\n        return self._process_embedding_response(\n            embeddings=embeddings,\n            model_response=model_response,\n            model=model,\n            input=input,\n            encoding=encoding,\n        )\n\n    def embedding(\n        self,\n        model: str,\n        input: list,\n        model_response: EmbeddingResponse,\n        optional_params: dict,\n        litellm_params: dict,\n        logging_obj: LiteLLMLoggingObj,","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/huggingface/embedding/handler.py#L260-L296","documentation":"Error \"{error}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/huggingface/embedding/handler.py:278 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the error content from the HuggingFace response included in the exception.","Verify HF_API_KEY, the model/endpoint, and that the model is loaded (cold starts return errors until warm)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}