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

Persistent 404 Error: Vertex AI Gemini 1.0 Pro Not Found on NEW Project

Hello Google Cloud Community,

I'm facing a persistent 404 Publisher Model ... was not found or your project does not have access to it error when trying to use gemini-1.0-pro with ChatVertexAI from LangChain on a brand new Google Cloud project (let's call its ID my-new-genai-project). I've been troubleshooting this for days and have gone through extensive steps, including creating this new project, but the issue remains. I'm hoping someone here can shed some light on what might be going wrong, as my account has Basic Support, and I'm unable to open a direct technical support case.

My Setup & What I've Tried:

  1. New Project Created:
    • Project ID: my-new-genai-project (This is a new project, actual ID redacted for privacy but can be provided if needed by a Googler/Support)
    • Created specifically to get a fresh start.
  2. Billing Account:
    • A valid Billing Account (ID ending in ...XXXXXX - redacted) is Active and correctly linked to the new project my-new-genai-project.
  3. APIs Enabled for my-new-genai-project:
  4. Authentication (Application Default Credentials - ADC):
    • Successfully authenticated using gcloud auth application-default login with my account (let's say my-email@example.com).
    • gcloud config set project my-new-genai-project was successful.
    • gcloud auth application-default set-quota-project my-new-genai-project was successful.
    • The ADC file (in my local AppData\Roaming\gcloud) exists and has been updated.
  5. IAM Permissions for my-email@example.com on project my-new-genai-project:
    • Vertex AI User role granted.
    • Editor role granted.
  6. LangChain Code (llm_model.py):
    Python
     
    from langchain_google_vertexai import ChatVertexAI
    # Assuming other necessary imports like os, load_dotenv, config.settings are correct
    # from config.settings import LLM_TEMPERATURE, LLM_MAX_TOKENS 
    
    class LLMClient:
        def __init__(self):
            self.llm = ChatVertexAI(
                model_name="gemini-1.0-pro", 
                project="my-new-genai-project", # Using the placeholder ID
                location="asia-southeast1",
                # temperature=LLM_TEMPERATURE, 
                # max_output_tokens=LLM_MAX_TOKENS 
            )
        def get_llm(self):
            return self.llm
     
     
  7. Environment Variables (.env file):
    • I have ensured that there are NO GOOGLE_API_KEY or GOOGLE_APPLICATION_CREDENTIALS variables defined in my .env file.

The Persistent Error:

Despite all the above configurations, when I run my script (python -m scripts.run_lucy), I consistently get the following error:

google.api_core.exceptions.NotFound: 404 Publisher Model `projects/my-new-genai-project/locations/asia-southeast1/publishers/google/models/gemini-1.0-pro` was not found or your project does not have access to it. Please ensure you are using a valid model version. For more information, see: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versions

This issue was also experienced on a previous project (ID redacted) with various models, which led to creating this new project.

Any help or insights would be greatly appreciated, as this is blocking my project development.

Thanks, Surachet K.

0 0 281
0 REPLIES 0