Vertex AI - The token is not valid or not have permission

n00b question - I’ve been trying to deploy Llama 3 from Hugging Face on Google’s Vertex AI (from the Model Garden) but I can’t do it as I keep getting an error with my access token. Google keeps telling me that ‘The token is not valid or not have permission’.

I’ve tried read only tokens, write tokens, fine-grained tokens with all permissions enabled and just can’t get it to work.

Anyone have any pointers?



I’ve deployed LLaMa myself on Vertex AI and it worked.

Do note that if you set a token at Hugging Face – The AI community building the future. you need to safely store it and use it, cause everytime you refresh the token the previous one no longer works. A read-only token should work fine.

Thanks I’m aware of this and have made sure that I’m trying the new token every time I refresh it.

This issue was resolved for me when creating a new HF token after gaining access to the Llama 3 model. Refreshing old tokens did not work. Hope this works for you, I have been having the same issue when deploying from HF to Google Vertex.

Verifying Vertex AI permissions can be tricky. Have you double-checked the service account you’re using has the Vertex AI Service Agent role? That might be the culprit. Also, ensure that any related resources, like Burlington handles, are correctly configured and accessible.

Thanks - I tried this but unfortunately it still doesn’t work

Thanks - I added that role to my service account, but still have the same issue

I have been able to create a specific token for Vertex AI, and added the permission to access the repo of the model I am trying to use with Model Garden (codestral). It is accepted by GCP/Vertex and the download+deployment process starts.
But several minutes later, I have a download error from GCP…

Hi @seanbetts check for few tips:

  • Check Permissions: Ensure your token has the necessary read and write permissions.
  • Validate Token: Make sure your token is valid and not expired. Try generating a new one.
  • Correct Placement: Ensure the token is correctly placed in the configuration field.
  • Verify Endpoint: Confirm you’re using the correct Hugging Face API endpoint and headers.
  • Check Configuration: Double-check your Vertex AI settings and ensure it’s properly linked to your Hugging Face account.
  • Network Restrictions: Ensure no network restrictions or firewalls are blocking communication.

I hope this helps :slight_smile: