private String inferProjectId() {
    final String projectNotFoundErrorMessage =
        ("Unable to infer your project. Please provide a project Id by one of the following:"
            + "\n- Passing a constructor argument by using new VertexAI(String projectId, String"
            + " location)"
            + "\n- Setting project using 'gcloud config set project my-project'");
    final Optional<String> projectIdOptional =
        getEnvironmentVariable(Constants.GOOGLE_CLOUD_PROJECT);
    if (projectIdOptional.isPresent()) {
      return projectIdOptional.get();
    }
    try {
      return Optional.ofNullable((GoogleCredentials) this.credentialsProvider.getCredentials())
          .map((credentials) -> credentials.getQuotaProjectId())
          .orElseThrow(() -> new IllegalArgumentException(projectNotFoundErrorMessage));
    } catch (IOException e) {
      throw new IllegalArgumentException(projectNotFoundErrorMessage, e);
    }
  }
Returns the {@link LlmUtilityServiceClient} with GRPC or REST, based on the Transport type. The
client will be instantiated when the first API call is made.

@return {@link LlmUtilityServiceClient} that makes calls to the backing service through method
    calls that map to the API methods.
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/VertexAI.java