feat: Add Vertex AI provider for Google Cloud Gemini access#28
Merged
feat: Add Vertex AI provider for Google Cloud Gemini access#28
Conversation
Add Nous.Providers.VertexAI for accessing Gemini models through Google Cloud Vertex AI with enterprise features (VPC-SC, CMEK, regional endpoints, IAM-based access control). Authentication supports: - Direct access token via api_key option or VERTEX_AI_ACCESS_TOKEN env - Goth integration (optional dep) for automatic service account token management — reuses existing Goth processes from PubSub etc. - URL auto-construction from GOOGLE_CLOUD_PROJECT/GOOGLE_CLOUD_REGION Reuses all existing Gemini infrastructure: message format conversion, response parsing, and stream normalization.
Interactive test script that reads service account credentials from GOOGLE_CREDENTIALS env var and tests both streaming and non-streaming requests against Vertex AI.
Add after_run/3 callback to the Plugin behaviour, wired into AgentRunner after successful runs. The Memory plugin uses this to automatically reflect on conversations and update memories without agent tool calls, similar to Claude Code's "recalled/wrote memory" behavior. Configurable via memory_config: auto_update_memory, auto_update_every, reflection_model, reflection_max_tokens, reflection_max_messages, and reflection_max_memories.
- Add examples/memory/auto_update.exs demonstrating multi-turn auto-memory with context continuation - Document auto-update config options in Plugins.Memory moduledoc - Update Plugin moduledoc with after_run callback execution order - Add auto_update.exs to examples README - Add v0.13.2 changelog entry
- Add Google Vertex AI Setup section with service account creation steps - Update test example to use gemini-3.1-pro model
- Expand Vertex AI README with all three auth modes (app config, per-model, direct token) - Update changelog with Goth config details - Bump version to 0.13.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
Nous.Providers.VertexAIfor accessing Gemini models through Google CloudVertex AI with enterprise features (VPC-SC, CMEK, regional endpoints, IAM).
Authentication
Three auth modes supported:
config :nous, :vertex_ai, goth: MyApp.Gothdefault_settings: %{goth: MyApp.Goth}api_keyoption orVERTEX_AI_ACCESS_TOKENenv varGoth (
{:goth, "~> 1.4"}) is an optional dependency — reuse existing Gothprocesses from PubSub, Cloud Storage, etc.
What's included
Nous.Providers.VertexAI— provider module with Bearer token auth and SSE streamingNous.Providers.VertexAI.endpoint/2— helper to build endpoint URLsGOOGLE_CLOUD_PROJECT/GOOGLE_CLOUD_REGIONenv vars"vertex_ai:gemini-2.0-flash"Tested
Verified end-to-end with service account on
europe-west1(Belgium) — bothstreaming and non-streaming requests working.