Integrate Google Cloud Vertex AI with Langflow
Langflow integrates with the Google Vertex AI API for authenticating the Vertex AI embeddings model and Vertex AI components.
Learn how to create a service account JSON in Google Cloud to authenticate Langflow’s Vertex AI components.
Create a service account with Vertex AI access​
- Select and enable your Google Cloud project. For more information, see Create a Google Cloud project.
- Create a service account in your Google Cloud project. For more information, see Create a service account.
- Assign the Vertex AI Service Agent role to your new account. This role allows Langflow to access Vertex AI resources. For more information, see Vertex AI access control with IAM.
- To generate a new JSON key for the service account, navigate to your service account.
- Click Add Key, and then click Create new key.
- Under Key type, select JSON, and then click Create. A JSON private key file is downloaded. Now that you have a service account and a JSON private key, you need to configure the credentials in Langflow components.
Configure credentials in Langflow components​
With your service account configured and your credentials JSON file created, follow these steps to authenticate the Langflow application.
- Create a new project in Langflow.
- From the components sidebar, drag and drop either the Vertex AI or Vertex AI Embeddings component to your workspace.
- In the Vertex AI component's Credentials field, add the service account JSON file.
- Confirm the component can access the Vertex AI resources. Connect a Chat input and Chat output component to the Vertex AI component. A successful chat confirms the component has access to the Vertex AI resources.