Skip to content

fix: add VertexAI support for Gemini LLM provider (#3990)#7

Open
themavik wants to merge 1 commit intomainfrom
fix/3990-gemini-vertexai-support
Open

fix: add VertexAI support for Gemini LLM provider (#3990)#7
themavik wants to merge 1 commit intomainfrom
fix/3990-gemini-vertexai-support

Conversation

@themavik
Copy link
Owner

@themavik themavik commented Feb 9, 2026

Fixes mem0ai#3990.

Root cause: GeminiLLM only supported GOOGLE_API_KEY, with no way to use VertexAI.

Fix: Check GOOGLE_GENAI_USE_VERTEXAI env var. When true, initialize genai.Client(vertexai=True) for ADC-based auth.

Root cause: The GeminiLLM class only supported authentication via
GOOGLE_API_KEY, with no way to use VertexAI which authenticates
via Application Default Credentials (ADC).

Fix: Check the GOOGLE_GENAI_USE_VERTEXAI environment variable
(consistent with Google's own libraries). When set to true,
initialize the genai.Client with vertexai=True, which uses ADC
instead of an API key. Users can configure their project and region
via GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION env vars.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Gemini in VertexAI as LLM Provider

1 participant