Skip to main content
Ground Gemini 3.5 Flash responses with Parallel web search on Vertex AI after configuring a Marketplace subscription or Parallel API key.
Google retired the pinned gemini-2.0-flash model on Vertex AI. Replace it with a model that currently supports Parallel grounding, such as gemini-3.5-flash, before running. Parallel access also requires either a Google Cloud Marketplace subscription or PARALLEL_API_KEY. See Grounding with Parallel.
parallel_grounding.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Authenticate with Google Cloud

Sign in with Application Default Credentials:
5

Configure Parallel access

Subscribe to Parallel through Google Cloud Marketplace, or create a Parallel API key and export it as PARALLEL_API_KEY in the shell that runs the example.
6

Use a supported Gemini model

Replace id="gemini-2.0-flash" with id="gemini-3.5-flash" in the saved file.
7

Run the example

Save the code above as parallel_grounding.py, then run:
Full source: cookbook/90_models/google/gemini/parallel_grounding.py