{"record":{"id":"c950ed1f7af4f4cf","repo":"BerriAI/litellm","slug":"huggingfaceexception-original-exception-message","errorCode":null,"errorMessage":"HuggingfaceException - {original_exception.message}","messagePattern":"HuggingfaceException - (.+?)","errorType":"exception","errorClass":"AuthenticationError","httpStatus":401,"severity":"error","filePath":"litellm/litellm_core_utils/exception_mapping_utils.py","lineNumber":1450,"sourceCode":"            response=getattr(original_exception, \"response\", None),\n        )\n    elif \"A valid user token is required\" in error_str:\n        raise BadRequestError(\n            message=error_str,\n            llm_provider=\"huggingface\",\n            model=model,\n            response=getattr(original_exception, \"response\", None),\n        )\n    elif \"Rate limit reached\" in error_str:\n        raise RateLimitError(\n            message=error_str,\n            llm_provider=\"huggingface\",\n            model=model,\n            response=getattr(original_exception, \"response\", None),\n        )\n    if hasattr(original_exception, \"status_code\"):\n        if original_exception.status_code == 401:\n            raise AuthenticationError(\n                message=f\"HuggingfaceException - {original_exception.message}\",\n                llm_provider=\"huggingface\",\n                model=model,\n                response=getattr(original_exception, \"response\", None),\n            )\n        elif original_exception.status_code == 400:\n            raise BadRequestError(\n                message=f\"HuggingfaceException - {original_exception.message}\",\n                model=model,\n                llm_provider=\"huggingface\",\n                response=getattr(original_exception, \"response\", None),\n            )\n        elif original_exception.status_code == 408:\n            raise Timeout(\n                message=f\"HuggingfaceException - {original_exception.message}\",\n                model=model,\n                llm_provider=\"huggingface\",\n            )","sourceCodeStart":1432,"sourceCodeEnd":1468,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/exception_mapping_utils.py#L1432-L1468","documentation":"Error \"HuggingfaceException - {original_exception.message}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/exception_mapping_utils.py:1450 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the HuggingFace error message; check model id, task, and inputs."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}