Hey Fyahdii! That 402 error with the “Invalid username or password” message is odd, especially with a Pro account. I’ve hit similar issues with Hugging Face’s API when the token wasn’t set up right. Check that your HUGGINGFACEHUB_API_TOKEN is correctly loaded in your environment (e.g., via os.environ or .env) and matches the token from your Hugging Face account settings—copy-paste can sometimes add hidden characters. Also, verify the repo_id for Qwen/Qwen2.5-14B-Instruct-1M is correct, as a mismatch can cause errors. Could you share a snippet of how you’re initializing HuggingFaceEndpoint? Has anyone else seen 402 errors with Qwen models on LangChain?
Here is my code snippet: llm = HuggingFaceEndpoint(
repo_id=“Qwen/Qwen2.5-14B-Instruct-1M”,
task=“text-generation”,
max_new_tokens=20,
do_sample=False,
repetition_penalty=1.03,
temperature=0.00
)
Thanks for your help. Based on the linked post, the token I am using appears to have the correct permissions, and there is a payment method with an active subscription on the account, so I suspect it’s most likely something else. Do you know how I might check the permission settings?