404 Errors When Using Inference API with Public Models

I’m trying to use the Inference API for the model meta-llama/Meta-Llama-3-70B-Instruct, and to test my setup, I’ve been making requests to public models like gpt2, bert-base-uncased, and facebook/bart-large-mnli. However, I consistently receive 404 errors.

Here’s what I’ve already tried:

  • Generated new API tokens
  • Switched networks and tested via mobile hotspot
  • Used both curl and Python’s requests library
  • Tried with multiple well-known public models

I desperately need help. I don’t understand why this is happening. My accounts are not flagged does anyone know if there’s a configuration issue preventing me from using the Inference API?

1 Like

Hi @graceMkal This issue sounds similar: 404 to any API i tried - #6 by meganariley.

meta-llama/Meta-Llama-3-70B-Instruct · Hugging Face is available to use with many great inference providers like Together AI, Featherless AI, Hyperbolic, and Novita. Check out our documentation on Inference Providers for more info: Inference Providers.

Another option is using this model with Inference Endpoints instead.

To see which models are available to use with HF Inference, check out our filtered search here.

You can also subscribe to PRO! Perks include: 20x more inference usage, 8x ZeroGPU quota, 10x private storage capacity :rocket: Check out PRO Account - Hugging Face for details.

1 Like

Wrong URL format → use: https://api-inference.huggingface.co/models/{model_id}
Missing or incorrect API token in headers
The model (like LLaMA 3) isn’t available via the public Inference API

Try with gpt2 and make sure your token is set correctly.