Create prompts for Gemini in Vertex AI Studio


Use Vertex AI Studio to design, test, and customize your prompts sent to Google's Gemini and PaLM 2 large language models (LLM). You can view the Gemini API in Vertex AI and Vertex AI API code used to generate the responses.

From Vertex AI Studio, you can complete the following:

  • Test models using provided prompt samples
  • Design and manage your prompts
  • Compare prompt output by model
  • Evaluate your prompts against select quality metrics
  • Tune models to get tailored responses
  • Ground model output to Vertex AI Search or Google Search
  • Get the Vertex AI API code to implement your work

Create a Google Cloud account to get started

In order to try this quickstart, you'll need to create a Google Cloud account. With this account, you'll get $300 in free credit, plus free usage of over 20 products— not charged against your $300 credit.

Get started for free

For more information on getting set up on Google Cloud after your account is created, see Get set up on Google Cloud.

  1. Go to the Vertex AI Studio page from the Vertex AI section in the Google Cloud console.
    Vertex AI Studio
  2. Click Open on the Language model option.
  3. From the Language studio, navigate to the Summarization section of the Prompt Gallery, and select Open on the Transcript Summary prompt example. The prompt, model, and parameters are prefilled with the values from the sample prompt.
  4. Click Submit to get a response from the default Gemini model. Scroll to see all of the results.
  5. To see different results, change the Model in the model drop-down, and adjust the parameters.
  6. Click Get Code to view the Vertex AI API code needed to generate a transcript summary.

Design and test your prompt

You can create and test your prompts (inputs) for tasks that are relevant to your business use case, and generate responses. By adding inputs and outputs, the LLM is capable of learning in-context from the examples of responses.

You can create a prompt, which gives a precise instruction, and asks the LLM to complete a sentence for you or to answer one-time questions.

  1. Go to the Vertex AI Studio page from the Vertex AI section in the Google Cloud console.
    Vertex AI Studio
  2. Click Open on the Language model option.
  3. Click Text Prompt on the Generate text option. An untitled prompt opens.
  4. In the prompt box, add a clear and concise description of the task that you want the model to do.
  5. As an example, ask the Gemini model to Suggest a name for a flower shop that sells bouquets of dried flowers.
  6. Click Submit.
  7. Responses appear in response box. If you want to view different results, adjust the prompt, model, or parameters, and click Submit.
  8. Click Get Code to view the Vertex AI API code needed to generate a similar response.

Vertex AI Studio prompt categories

From the Vertex AI Studio you can test and customize prompts for different generative AI models.

Prompt samples are available in the Multimodal and Language sections of Vertex AI Studio, and contain a variety of sample prompts that are predesigned to help demonstrate model capabilities. The sample prompts are categorized by the task type, such as summarization, classification, and extraction. Each prompt is preconfigured with specified model and parameter values so you can open the sample prompt and click Submit to get the model to generate a response.

Design and manage your prompts

Prompt design is the process of manually creating prompts that elicit the intended response from a language model. By carefully crafting prompts, you can nudge the model to generate a good result for your use case. Prompt design can be an efficient way to experiment with model output.

Vertex AI Studio enables your team to create, save, and collaboratively refine prompts. When designing a new prompt, you can input the prompt text, choose the ideal model, adjust parameters, and test it for immediate feedback. When a prompt is finalized, you can save it within your shared project in Vertex AI Studio.

To get started with prompt design, see Introduction to prompting.

Compare prompt output by model

In Vertex AI Studio, you can compare prompt results to see what model and settings pairing works best for your use case.

From the Language tab, view your prompts, and select Compare next to the prompts that you want to compare. You can compare up to three prompts side-by-side.

Prompt lifecycle management

If you have many prompts, it's necessary to have a central place to manage them. From the Multimodal and Language pages, you can view all of your prompts by type under the My prompts tab. From these pages, you can version your prompts, restore previous versions, delete, export, and manage prompt naming. You can also add notes to prompts for record keeping and as a way to centrally collaborate with your prompting team.

Ground your prompts from the Vertex AI Studio

In generative AI, grounding is the ability to connect language model output to verifiable sources of information. From the Multimodal and Language pages in the Vertex AI Studio, you can choose to ground model output to Vertex AI Search or Google Search. To learn more about grounding, see the Grounding overview. To learn more about grounding model output to Google Search, see Grounding with Google Search.

Explore generative AI models in Model Garden

Model Garden is a platform that helps you discover, test, customize, and deploy Google proprietary and select OSS models and assets. To explore the generative AI models and APIs that are available on Vertex AI, go to Model Garden in the Google Cloud console.

Go to Model Garden

To learn more about Model Garden, including available models and capabilities, see Explore AI models in Model Garden.

Tune a foundation model

While prompt design is great for quick experimentation, if training data is available, higher quality can be achieved by tuning the model itself. Tuning a model lets you customize the model's response based on examples of the task that you want the model to perform.

To learn how to tune a foundation model, see Tune foundation models.

Use Vertex AI Studio to design, test, and customize your prompts sent to Google's Gemini and PaLM 2 large language models (LLM). After an LLM processes your prompt, it sends you its response. To learn more about the Vertex AI Studio, see Experiment with models in Vertex AI Studio.

What's next