Skip to content

feat: add optional per-agent Vertex AI project and location configuration #1431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

avidela
Copy link

@avidela avidela commented Jun 16, 2025

Summary

Adds optional per agent project and location configuration for Vertex AI models ( Claude and Gemini)

Addresses issues:

  1. Support for specifying GCP Project and Location per Vertex AI Model instance #485
  2. Region needs to be configurable on every model #1120
  3. Allow users to define GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION, GOOGLE_GENAI_USE_VERTEXAI in code #1417

Changes

  • Add optional project_id and location fields to Claude and Gemini classes
  • Enable per-instance client caching based on configuration
  • Maintain backward compatibility with environment variables
  • Add comprehensive test coverage

Testing Plan

Unit Tests

  • Added comprehensive unit tests in tests/unittests/models/test_vertex_per_agent_config.py
  • All existing tests pass
  • New tests cover: custom config, per-instance config, backward compatibility, mixed scenarios

E2E Testing

Creating repository https://github.com/avidela/adkfeat-add-project-location-config-to-vertex-models where I installed the wheel from this branch, and ran a normal multi_tool_agent and then a multi project and location agent, where I tested different projects and different regions in an agent -> sub_agents manner and it works.

multi_project_location_test

regular_agent

Backward Compatibility

✅ Existing code using environment variables continues to work unchanged
✅ No breaking changes to existing APIs

@hangfei hangfei added bot_triaged models Issues about model support labels Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot_triaged models Issues about model support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants