You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Drop the .env, it's cleaner (ADK should pick up project and location from GCP metadata server) #2685
GOOGLE_GENAI_USE_VERTEXAI should be assumed to be TRUE unless an API key is provided.
GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION should be retrieved from the instance metadata server.
A note on instance metadata server:
Every GCP runtime exposes the same instance metadata server which allows retrieving project and location. See reference for Cloud Run. It's trivial for ADK to query it (see example Go code)
Doesn't this assume that your agent running on Google Cloud is going to call Gemini in the same region which may not be the case
You might be running multiple agent backends loadbalanced, so you may hit different CR regions based on where you are, but still call 1 vertex endpoint for Gemini
I do agree we could have these as good standard defaults when running on Google cloud as long as we allow for override.
@steren Thank you for reporting this. I understand the request is currently under review. Please keep me posted if anything else is needed. Thanks for your patience.
I'll add opt-in GCP metadata-server defaults for project/location (and Vertex usage) so Agent Engine / Cloud deploys don't require a .env for those values, while keeping explicit env/CLI overrides. Opening a PR shortly.
@xuanyang15 please assign me (@a2105z) if that helps with routing — I don't have self-assign permissions on this repo.
This has been resolved by PR #6703 and merged into the main branch in commit 8d8bbd2.
We are closing this issue as resolved. If you find that the issue persists on the latest ADK release or if this was closed in error, please feel free to reopen it or leave a comment! Thank you again for your contribution.
Activity
justingrayston commentedon Aug 22, 2025
I do agree we could have these as good standard defaults when running on Google cloud as long as we allow for override.
steren commentedon Aug 22, 2025
yes to be clear, I am only suggesting using this as a default behavior, the developer should still be able to customize project / location using .env
klateefa commentedon Nov 25, 2025
@steren Thank you for reporting this. I understand the request is currently under review. Please keep me posted if anything else is needed. Thanks for your patience.
a2105z commentedon Aug 13, 2026
Hi — I'd like to take this one on.
I'll add opt-in GCP metadata-server defaults for project/location (and Vertex usage) so Agent Engine / Cloud deploys don't require a
.envfor those values, while keeping explicit env/CLI overrides. Opening a PR shortly.@xuanyang15 please assign me (
@a2105z) if that helps with routing — I don't have self-assign permissions on this repo.a2105z commentedon Aug 13, 2026
PR ready for review: #6703
Implements metadata-server defaults for unset
GOOGLE_CLOUD_PROJECT/GOOGLE_CLOUD_LOCATION/ enterprise-Vertex mode on GCP (explicit.env/shell still wins).@xuanyang15 @steren @klateefa — would appreciate a look when you have bandwidth.
a2105z commentedon Aug 13, 2026
@xuanyang15 — PR is up for your review: #6703
DeanChensj commentedon Oct 14, 2026
Hi @steren, thank you for reporting this issue!
This has been resolved by PR #6703 and merged into the main branch in commit 8d8bbd2.
We are closing this issue as resolved. If you find that the issue persists on the latest ADK release or if this was closed in error, please feel free to reopen it or leave a comment! Thank you again for your contribution.
github-actions commentedon Oct 14, 2026
Are you satisfied with the resolution of your issue?
Yes
No