Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

@avidela
Copy link

@avidela avidela commented Jun 16, 2025
edited
Loading

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 [Component] Issues related to model support labels Jun 16, 2025
Copy link

kanlanc commented Jun 22, 2025

I needed just this, this merge would be awesome

Copy link

kanlanc commented Jun 22, 2025

@avidela Purely for curiosity, what was the workaround that you were doing before this pull request? Make your own base class or make your own anthropic_llm class?

Copy link
Author

avidela commented Jun 22, 2025

@kanlanc Yeah, I have my own anthropic_llm class

Copy link

kanlanc commented Jun 22, 2025

Could you help me understand how this would flow,

You have your base LLM class that would call this anthropic class or?

Copy link

I need this too.
I want to use Gemini 2.5 Flash-Lite (only available global location) on Vertex AI Agent Engine (there is no global location now)

@ryanaiagent ryanaiagent self-assigned this Oct 3, 2025
Copy link
Collaborator

Hi @avidela and thanks to everyone who participated in this thread.

We're currently doing some housekeeping on our pull request queue. Given the rapid pace of development and the number of updates since this was last active, there's a good chance this pull request needs to be caught up to the latest version. To help us keep our backlog focused on current pull requests, we are closing this as stale.

If you're still interested in contributing to this change, could you please update to the very latest version of the library and create a new pull request? Our team will be glad to help with the refreshed PRs and answer any questions!

Thanks for your contribution and understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Labels

models [Component] Issues related to model support

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /