High severity beginner · Fix: 2-5 min

ValueError

vllm.LLMError: Model not found on Huggingface Hub

What this error means
vLLM raises a model not found error when the specified Huggingface model ID is incorrect or missing from the Huggingface Hub.

Stack trace

traceback
ValueError: Model 'nonexistent-model-id' not found on Huggingface Hub.
  File "app.py", line 12, in <module>
    llm = LLM(model='nonexistent-model-id')  # triggers error
  File "vllm/llm.py", line 45, in __init__
    raise ValueError(f"Model '{model}' not found on Huggingface Hub.")
QUICK FIX
Double-check and correct the model ID string passed to LLM(model=...) to match an existing Huggingface Hub model.

Why it happens

This error occurs because vLLM tries to load a model from the Huggingface Hub using the provided model ID, but the ID does not exist or is misspelled. The Huggingface Hub cannot find the model repository, causing vLLM to raise a ValueError.

Detection

Check for ValueError exceptions during LLM initialization and verify the model ID string before runtime to catch typos or missing models early.

Causes & fixes

1

Incorrect or misspelled Huggingface model ID passed to vLLM

✓ Fix

Verify the exact model ID on the Huggingface Hub website and update your code to use the correct model identifier.

2

Model repository is private or deleted on Huggingface Hub

✓ Fix

Ensure you have access permissions or choose a public model. If private, authenticate with Huggingface CLI or provide a token.

3

No internet connection or network issues preventing access to Huggingface Hub

✓ Fix

Check your network connectivity and proxy settings to allow access to the Huggingface Hub.

Code: broken vs fixed

Broken - triggers the error
python
from vllm import LLM

llm = LLM(model='nonexistent-model-id')  # triggers ValueError: model not found
print(llm.generate('Hello'))
Fixed - works correctly
python
import os
from vllm import LLM

# Use environment variable for model ID and set a valid Huggingface model
model_id = os.environ.get('VLLM_MODEL_ID', 'facebook/opt-1.3b')
llm = LLM(model=model_id)  # fixed: valid model ID
print(llm.generate('Hello'))
Replaced the invalid model ID with a valid Huggingface model ID loaded from an environment variable to avoid hardcoding and ensure the model exists.

Workaround

Catch the ValueError during LLM initialization, log the invalid model ID, and fallback to a default known-good model ID programmatically.

Prevention

Always validate model IDs against the Huggingface Hub before deployment and use environment variables to manage model configuration securely.

Python 3.9+ · vllm >=0.1.0 · tested on 0.3.0
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.