Skip to content

Support Service Account Authentication for Vertex AI Without gcloud CLI #392

Closed

Description

@bakeryproducts

Currently, it appears that using Vertex AI requires the gcloud CLI. url
What is the recommended way to use the ADK with Vertex AI models programmatically, without relying on the CLI tool?
for example, from a remote machine running in Docker outside of GCP?

My current approach (outside of ADK) is to create a Google service account and use the following Python code:

credentials = Credentials.from_service_account_file(GOOGLE_APPLICATION_CREDENTIALS)
vertexai.init(project=project, location=location, credentials=credentials)

Is it possible to support authentication with a Google service account for Vertex AI, so that the CLI is not required?

Activity

  1. boyangsvl commented on Apr 25, 2025

    @boyangsvl
    Collaborator

    You may use the GOOGLE_APPLICATION_CREDENTIALS environment variable. See https://cloud.google.com/docs/authentication/application-default-credentials. Moving this to discussions.

  2. locked and limited conversation to collaborators on Apr 25, 2025
  3. converted this issue into a discussion #396 on Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions