Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

stop hardcoding us-central1 as vertex ai default location (#8313)

Harikrishna KP45846edf1c67
diff --git a/marimo/_server/ai/providers.py b/marimo/_server/ai/providers.py
index 6d3791d148..437093feb5 100644
--- a/marimo/_server/ai/providers.py
+++ b/marimo/_server/ai/providers.py
@@ -261,7 +261,14 @@ class GoogleProvider(PydanticProvider["PydanticGoogle"]):
)
if use_vertex:
project = os.getenv("GOOGLE_CLOUD_PROJECT")
- location = os.getenv("GOOGLE_CLOUD_LOCATION", "us-central1")
+ # Upstream (pydantic-ai) defaults to us-central1 if not set
+ location = os.getenv("GOOGLE_CLOUD_LOCATION") or None
+ if location is None:
+ LOGGER.info(
+ "GOOGLE_CLOUD_LOCATION is not set. "
+ "The upstream provider will default to 'us-central1'. "
+ "Set this env var if your project has region restrictions."
+ )
# The type stubs don't have an overload that combines vertexai
# with project/location, but the runtime supports it
provider: PydanticGoogle = PydanticGoogle( # type: ignore[call-overload]