Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Error when connecting to llama3.1

While I try to connect to llama3.1 with langchain (VertexModelGardenLlama), I am getting this error 


"error": { "code": 400, "message": "Project `XXXXXXXX` is not allowed to use Publisher Model `projects/643892325147/locations/us-central1/publishers/meta/models/llama3-70b-instruct-maas`",
"status": "FAILED_PRECONDITION" }

The model that I am trying to connect to is  `
meta/llama3-70b-instruct-maas`

I notice that when I curl the command it works. It seems like it may be the langchain issue. If so, what is another way to connect to vertex ai llama using langchain?

 





1 2 478
2 REPLIES 2

Hi @wonhs91,

Welcome to Google Cloud Community!

It seems that you are encountering an error when connecting to the Llama 3.1 model using LangChain (VertexModelGardenLlama). Permission issues may be the cause of this error.

You might find the following helpful information in addressing your concerns: 

  • Verify Project Permissions: Ensure that your project has the necessary permissions to use the model and update IAM (Identity and Access Management) policies to grant the necessary access. This may help connect to Vertex AI using LangChain.
  • Check Model Access: Ensure that the model is properly set up and accessible within your project. Verify the model ID and path for accuracy, as this may help establish a connection to the Vertex AI model through LangChain.
  • Utilize the correct API: Since you mentioned that curl works, ensure that you're using the proper API endpoint and credentials. You should check your IAM permissions to verify that your project has the necessary permissions for the endpoint, as this may help you properly configure LangChain to connect to Vertex AI Llama 3.1.

I hope the above information is helpful.

I gave the correct IAM permissions, to my project but still obtain the same error. 
I want to ask again the OP question: It seems like it may be the langchain issue. If so, what is another way to connect to vertex ai llama using langchain?