Vertex AI
Vertex AI lets you generate text using Google’s powerful language models. You can choose the model, set how creative it should be, and even run it on multiple records at once.
How it Works
When you add the Vertex AI component to your workflow, it connects to Google Cloud’s Vertex AI service.
- Credentials – If you provide a JSON credentials file, the component uses it to authenticate. If you leave it empty, it will look for credentials in your environment variables.
- Project & Location – These tell Vertex AI which Google Cloud project and region to use.
- Model Name – Pick the specific Vertex AI model (e.g.,
gemini-2.0-flash
). - Prompt (Input) – The text you want the model to respond to.
- Parameters – Settings such as temperature, top‑k, top‑p, and max output tokens control the style and length of the response.
- Streaming – If enabled, the model streams its answer back to you in real time (works only in chat mode).
The component then sends the prompt and parameters to Vertex AI, receives the generated text, and makes it available as the Text output. It also exposes the underlying model instance as Model for advanced use.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
- Credentials: JSON credentials file. Leave empty to fallback to environment variables.
- Input: The text prompt you want the model to respond to.
- Location: The Vertex AI region (e.g.,
us-central1
). - Mapping Mode: Enable mapping mode to process multiple data records in batch.
- Max Output Tokens: Maximum number of tokens the model can return.
- Max Retries: Number of times to retry if the request fails.
- Model Name: The name of the Vertex AI model to use (e.g.,
gemini-2.0-flash
). - Project: The Google Cloud project ID.
- Stream: Stream the response from the model. Streaming works only in Chat.
- System Message: System message to pass to the model.
- Temperature: Controls randomness of the output.
- Top K: Controls diversity of the output.
- Top P: Controls nucleus sampling.
- Verbose: Enable verbose logging.
Outputs
- Text: The generated text from the model (Message type:
text_response
). - Model: The language model instance (LanguageModel type:
build_model
). This can be used for advanced configurations or debugging.
Usage Example
- Goal: Create a product description for a new gadget.
- Drag the Vertex AI component onto the canvas.
- Set Model Name to
gemini-2.0-flash
. - Set Temperature to
0.7
for a slightly creative tone. - Connect a Text Input component (or a List component if you have many products) to the Input field.
- Connect the Text output to a Display Text component to show the generated description.
- (Optional) Enable Mapping Mode if you want to process a list of product names in one run.
Related Components
- OpenAI Model – Use OpenAI’s GPT models instead of Vertex AI.
- ChatGPT – A specialized wrapper for OpenAI’s chat models.
- LLM Callback Handler – Capture logs and events from language model calls.
- Text Input – Provide static or dynamic text prompts.
- Display Text – Show the generated text in the dashboard.
Tips and Best Practices
- Use a lower Temperature (e.g., 0.2) for factual or precise responses.
- Set Max Output Tokens to limit the length of the answer and control costs.
- Enable Mapping Mode when you need to process many records at once.
- Store your credentials file in a secure location and restrict access.
- Prefer environment variables for credentials when possible to avoid hard‑coding secrets.
- Turn on Verbose only when troubleshooting; it can produce a lot of log data.
Security Considerations
- The Credentials file contains sensitive Google Cloud keys. Store it in a protected location and never expose it publicly.
- If you leave Credentials empty, the component will use the credentials set in your environment. Ensure those are also secure.
- Use role‑based access control in Google Cloud to limit who can invoke Vertex AI models.
- Monitor usage and set quotas to prevent accidental over‑use or abuse.