404 Existing Hugging Face Inference Model Not Found

System Info

So I am using the hugging face inference API and the model wont work on the inference API but works in the hugging face model playground: huggingface_hub.errors.HfHubHTTPError: 404 Client Error: Not Found for url: https://router.huggingface.co/hf-inference/models/HuggingFaceTB/SmolLM3-3B What should I do?

Who can help?

A more experience hugging face hub user.

Information

My own modified scripts

Reproduction

To reproduce use the hugging face API on: HuggingFaceTB/SmolLM3-3B

Expected behavior

The expected behavior is to get a response to the request. When you get a parameter wrong when sending a request it gives a correct error message for that param but when you get everything correct it sends 404

1 Like

Hmm… Weird… It works with Python even without token…

import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    provider="hf-inference",
    #api_key=os.getenv("HF_TOKEN", None),
)

completion = client.chat.completions.create(
    model="HuggingFaceTB/SmolLM3-3B",
    messages=[
        {
            "role": "user",
            "content": "What is the capital of France?"
        }
    ],
)

print(completion.choices[0].message)
#ChatCompletionOutputMessage(role='assistant', content="<think>\nOkay, the user is asking for the capital of France. Let me make sure I remember correctly. I think it's Paris. Wait, is there any chance they might be confusing it with another city? Maybe they heard something different before?\n\nLet me double-check. France's capital is definitely Paris. It's the largest city in the country and a major cultural and political center. I don't think there's any other city that's considered the capital. Sometimes people might confuse it with Lyon or Marseille, but those are major cities too, not the capital.\n\nWait, what about the administrative capital? Oh right, even though Paris is the capital, some might refer to the administrative center as Paris as well. There's the Élysée Palace, which is the official residence of the President of France, and the seat of government. So yes, Paris is the capital.\n\nI should also consider if there's any historical context where another city might have been the capital. For example, during the French Revolution, Paris was the revolutionary capital, but it's still the capital now. There's no other city that's taken over as the capital in recent times.\n\nSo, the answer is Paris. I can confidently say that without any doubt. The user probably just needs a straightforward answer, but maybe they want a bit more context. I can mention that Paris is not only the capital but also a major cultural and economic hub in Europe. That adds value to the answer.\n</think>\n\nThe capital of France is **Paris**. It is the largest city in the country and a prominent cultural, economic, and political center. Paris is known for iconic landmarks like the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral.", tool_call_id=None, tool_calls=[], reasoning_content=None)

How about like this?

curl -H "Authorization: Bearer $HF_TOKEN" \
     https://router.huggingface.co/hf-inference/models/HuggingFaceTB/SmolLM3-3B

Similar issues:

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.