···471471 if creds_path and os.path.exists(creds_path):
472472 env["GOOGLE_APPLICATION_CREDENTIALS"] = creds_path
473473 # else: GOOGLE_APPLICATION_CREDENTIALS may be inherited from env
474474- # Set project/location from config if present
475475- vertex_project = providers_config.get("vertex_project")
476476- if vertex_project:
477477- env["GOOGLE_CLOUD_PROJECT"] = vertex_project
478478- vertex_location = providers_config.get("vertex_location")
479479- if vertex_location:
480480- env["GOOGLE_CLOUD_LOCATION"] = vertex_location
481474 else:
482475 # AI Studio: clear any inherited Vertex env vars so the CLI
483476 # doesn't accidentally run in Vertex mode.
484477 for vkey in (
485478 "GOOGLE_APPLICATION_CREDENTIALS",
486479 "GOOGLE_GENAI_USE_VERTEXAI",
487487- "GOOGLE_CLOUD_PROJECT",
488488- "GOOGLE_CLOUD_LOCATION",
489480 ):
490481 env.pop(vkey, None)
491482 return env