Request to Serverless Inference API failed with 400 status code

LinYouyIFAD
Tue, 04 Mar 2025 08:29:45 +0000

I’m consistently encountering issues with the HuggingFace Serverless API, specifically with the hf-inference provider. When running the sample code on the HuggingFace serverless deployment page, I receive the following error:

openai.BadRequestError: Error code: 400 - {'error': 'Not allowed to request v1/chat/completions for provider hf-inference'}

I tried following models, all with the same status code:

meta-llama/Llama-3.3-70B-Instruct

deepseek-ai/DeepSeek-R1-Distill-Qwen-32B

deepseek-ai/DeepSeek-R1-Distill-Llama-70B

Does anyone have any ideas or suggestions on how to resolve this issue?