Following the official smolagents tutorial, repeated 401 Unauthorized errors suggested the Hugging Face credentials were invalid. Yet authentication and inference worked fine through huggingface_hub directly, and the exact same smolagents code then started working without any changes. The error messages consistently pointed at an authentication problem even though authentication was successful.