Hello Google Cloud Community and Support,
I’m encountering a persistent NotFound error (HTTP Status 404) when attempting to access Generative AI models (Gemini 1.0 Pro, text-bison) via the google-cloud-aiplatform Python SDK. This issue occurs across multiple projects and regions, including newly created projects, and even persists when testing from Google Colaboratory.
Summary of the Problem:
When calling GenerativeModel(“text-bison”).generate_content() (or “gemini-1.0-pro” / “gemini-pro”), I consistently receive a google.api_core.exceptions.NotFound error with the detail:
“Publisher Model projects/{YOUR_PROJECT_ID}/locations/{REGION}/publishers/google/models/{MODEL_NAME} was not found or your project does not have access to it.”
Environment & Setup:
-
Local Python Environment: VS Code, Python 3.x, google-cloud-aiplatform, google-cloud-texttospeech installed in a virtual environment.
-
Authentication: gcloud auth application-default login successfully completed.
-
Colaboratory Environment: Tested in a new Colab notebook with auth.authenticate_user() for authentication.
-
Google Cloud Projects: Tested on my original project and a newly created project.
-
Billing: Active billing account is linked to both projects.
-
APIs Enabled:
-
aiplatform.googleapis.com (Vertex AI API) is enabled (confirmed via gcloud services list --enabled).
-
texttospeech.googleapis.com (Cloud Text-to-Speech API) is also enabled and works perfectly fine from Python SDK.
-
-
Regions Tested: asia-northeast1 (Tokyo) and us-central1 (Iowa).
-
Models Tested: gemini-1.0-pro, gemini-pro, text-bison.
Specific Observations:
-
The NotFound error message explicitly indicates the correct project ID, region, and model name being used in the API call.
-
In the Google Cloud Console, navigating to Vertex AI → Vertex AI Studio → Prompt Gallery:
-
There is no prominent banner or pop-up asking for agreement to terms of service or explicit activation for Generative AI models (like Gemini/PaLM 2).
-
Only “Converse with Gemini” is visible under “Prompt Gallery”, but clicking it doesn’t prompt for any additional activation.
-
-
My Google Account (PII Removed by Staff) has the Owner role on the project.
-
I’ve also explicitly added Vertex AI User, Vertex AI Admin, Vertex AI Developer, and Vertex AI API Service Agent roles to my account and the Compute Engine default service account (where applicable), but the issue persists.
-
I tried to open a support case, but received “You don’t have permission to file technical support cases for projects/manga-youtube-project.” notification.
Code Snippet (test_gemini.py simplified):
Generated python
Code Snippet (test_gemini.py simplified):
import vertexai
from vertexai.generative_models import GenerativeModel
# from google.colab import auth # Uncommented in Colab
# from google.auth import default # Uncommented in Colab
PROJECT_ID = "manga-youtube-project" # Placeholder for actual project ID
LOCATION = "us-central1" # Also tested asia-northeast1
PROMPT = "Generate 3 catchy YouTube manga video ideas."
def initialize_vertexai(project_id, location):
vertexai.init(project=project_id, location=location)
def generate_text(prompt_text):
model = GenerativeModel("text-bison") # Also tested "gemini-1.0-pro" / "gemini-pro"
response = model.generate_content(prompt_text)
return response.text
if __name__ == "__main__":
# In Colab, auth.authenticate_user() is called here
initialize_vertexai(PROJECT_ID, LOCATION)
generated_text = generate_text(PROMPT)
print(generated_text)
content_copydownload
Use code [with caution](https://support.google.com/legal/answer/13505487).Python
**Question:**
Given that Text-to-Speech API works perfectly and I've tried all standard troubleshooting steps (billing, API enablement, IAM roles, different projects/regions/models, Colab), what could be preventing access to Generative AI models for my project/account? Is there a hidden consent form, a specific organization policy, or a known backend issue that might cause this persistent NotFound error for Generative AI models exclusively?
Any insights or suggestions from the community or Google Cloud staff would be greatly appreciated. Thank you in advance for your time and help.