Skip to content

docs: propose merging VertexAI into GoogleAI(enterprise=...) - #7246

Closed
huangjeff5 wants to merge 2 commits into
genkit-ai:mainfrom
huangjeff5:jh/proposal-merge-vertexai-into-googleai
Closed

huangjeff5 wants to merge 2 commits into
genkit-ai:mainfrom
huangjeff5:jh/proposal-merge-vertexai-into-googleai

Conversation

@huangjeff5

Copy link
Copy Markdown
Contributor

Adds a cross-SDK proposal at docs/proposals/merge-vertexai-into-googleai.md: fold the VertexAI plugin into GoogleAI behind an enterprise= switch, so moving from an AI Studio key to a Google Cloud project is one line of setup instead of rewriting every googleai/... ref to vertexai/....

GoogleAI()                                                                # AI Studio key, as today
GoogleAI(enterprise=True, project='bistro-prod', location='us-central1')  # Google Cloud

What it proposes

  • Step 1, additive, any 1.x release: GoogleAI gets enterprise=, project and location. VertexAI keeps working and logs a deprecation warning. Nothing breaks.
  • Step 2, at 2.0: remove VertexAI. Old vertexai/... refs keep resolving through an alias that only resolves when enterprise=True, so a ref never quietly moves to a different billing account. This needs a small core addition (plugins claiming legacy namespaces).
  • Interactions: both transports (genai.Client for generateContent, the plugin's own Interactions client) pick the backend from the same setting. The doc asks that the Cloud Interactions client take the backend as a value, not infer it from the plugin class.

Why now

  • Google's SDKs already moved to this shape. Python google-genai 2.14+ takes Client(enterprise=True) and documents vertexai= as legacy. Go genai v1.57 added BackendEnterprise. Both read GOOGLE_GENAI_USE_ENTERPRISE.
  • The product name has changed three times in seven months. A setting on GoogleAI holds up better than a plugin class named after the product.
  • Neither step blocks Python 1.0.

Decisions requested

  1. The direction: one GoogleAI plugin with a backend switch, and VertexAI deprecated now and removed at 2.0.
  2. The flag name: mirror each SDK (enterprise= / BackendEnterprise), or use a brand-neutral backend= everywhere. Ideally confirmed with the google-genai team.
  3. The env var: whether GoogleAI() honors GOOGLE_GENAI_USE_ENTERPRISE when enterprise= isn't passed.
  4. Alias lifetime after 2.0.

Docs only; no code changes. Related: genkit-python#137 (Model Garden package rename, independent of this proposal).

@github-actions github-actions Bot added the docs Improvements or additions to documentation label Nov 17, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This proposal outlines merging the VertexAI plugin into GoogleAI to allow switching between AI Studio and Google Cloud backends via an enterprise configuration. The review feedback points out several important considerations: a discrepancy in how Go handles GOOGLE_API_KEY for Express Mode, the potential need to support both backends simultaneously in a single application for hybrid use cases, and a correction regarding the SDK's environment variable name (GOOGLE_GENAI_USE_VERTEXAI instead of GOOGLE_GENAI_USE_ENTERPRISE).

- **`enterprise=True`:**
- `project`: the argument, then `GCLOUD_PROJECT` / `GOOGLE_CLOUD_PROJECT`, then `credentials.project_id`, then the ADC project.
- `location`: the argument, then `GOOGLE_CLOUD_LOCATION` / `GCLOUD_LOCATION`, then `us-central1`. Multi-regions keep their dedicated endpoints.
- Express mode only with an explicit `api_key=`. Environment keys stay ignored, as they are today, so an AI Studio `GEMINI_API_KEY` never quietly becomes a Cloud key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In Go, the VertexAI plugin's vertexAPIKeyFromEnv helper currently checks GOOGLE_API_KEY (which is also checked by GoogleAI for AI Studio). This means GOOGLE_API_KEY is not ignored for Express Mode in Go today. If GoogleAI(enterprise=True) is called without an explicit key, it might accidentally pick up GOOGLE_API_KEY from the environment and run in Express Mode on Vertex AI, which contradicts the statement that environment keys stay ignored. We should clarify how GOOGLE_API_KEY will be handled in Go to prevent accidental backend/billing switches.


## What we give up at 2.0

- **Both backends in one app.** Until 2.0, `GoogleAI()` plus `VertexAI()` keeps working. After 2.0, two `GoogleAI` plugins collide on `googleai/`, and the registry raises at startup. We'd make that message name the fix. I expect this is rare, but we have no usage data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Preventing both backends from being registered in the same application after 2.0 might block valid hybrid or transition use cases. For example, a team might want to use AI Studio (GoogleAI with enterprise=False) for low-cost/fast prototyping or non-sensitive tasks, while using Vertex AI (GoogleAI with enterprise=True) for production/sensitive tasks within the same service. We should consider supporting named plugin instances or a per-request backend override to allow both backends to coexist if needed.


1. **Is `enterprise` the long-term name?** The flag follows "Gemini Enterprise Agent Platform", a brand developer marketing has already moved away from. Can we confirm with the `google-genai` team, and is JS `@google/genai` moving too?
2. **Flag name in Genkit:** mirror each SDK (`enterprise=` in Python, a backend enum in Go), or use one brand-neutral `backend=` Literal everywhere?
3. **The environment variable:** should `GoogleAI()` honor `GOOGLE_GENAI_USE_ENTERPRISE` when `enterprise=` isn't passed? Honoring it lets deployment config switch the backend without code changes. Ignoring it avoids a switch caused by a variable set for some other tool. An explicit `enterprise=` wins either way. I lean toward honoring it and logging the chosen backend once.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Please double-check the environment variable name used by the official google-genai SDK. The SDK typically uses GOOGLE_GENAI_USE_VERTEXAI rather than GOOGLE_GENAI_USE_ENTERPRISE to trigger the Vertex AI backend. Genkit should align with the exact environment variable name used by the underlying SDK to avoid confusion and double-configuration.

@huangjeff5

Copy link
Copy Markdown
Contributor Author

moving this to genkit-python: genkit-ai/genkit-python#138

@huangjeff5 huangjeff5 closed this Nov 17, 2026
@huangjeff5
huangjeff5 deleted the jh/proposal-merge-vertexai-into-googleai branch November 17, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant