Vertex AI Model Optimizer is a dynamic endpoint designed to simplify
model selection by automatically applying the Gemini model which best
meets your needs. This lets you point your prompts at a single meta-endpoint and the service
intelligently selects the most appropriate Gemini model for your query
(Pro, Flash, etc.) based on your cost and quality preferences. For more information on Model Optimizer pricing, see
Pricing. Model Optimizer lets you: Model Optimizer supports all languages that are also supported by the Gemini models. (See Gemini Language support) Model Optimizer supports text use cases, including: For limitations and how to handle them, see Handling unsupported features. To get started with Model Optimizer, see our quickstart Colab notebook.
To learn more, see the
SDK reference documentation.
Set environment variables to use the Gen AI SDK with Vertex AI:
Benefits
Supported models
Language support
Modality
Getting started
Using Vertex AI Model Optimizer
Python
Install
pip install --upgrade google-genai
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values
# with appropriate values for your project.
export GOOGLE_CLOUD_PROJECT=GOOGLE_CLOUD_PROJECT
export GOOGLE_CLOUD_LOCATION=global
export GOOGLE_GENAI_USE_VERTEXAI=True
Handling unsupported features
Model Optimizer only supports text input and output. However, the request could include different modalities or tools that aren't supported. The following sections cover how Model Optimizer handles these unsupported features.
Multimodal requests
Requests that include prompts with multimodal data, such as video, images or audio, will throw an INVALID_ARGUMENT
error.
Unsupported tools
Model Optimizer only supports function declaration for requests. If a request contains other tool types including google_maps
, google_search
, enterprise_web_search
, retrieval
, or browse
, an INVALID_ARGUMENT
error is thrown.
Send feedback
To send feedback about your experience with Model Optimizer, fill out our feedback survey.
If you have questions, technical issues, or feedback about Model Optimizer, contact model-optimizer-support@google.com.
Customer discussion group
To connect directly with the development team, you can join the Vertex AI Model Optimizer Listening Group, where you can learn about the product and help us understand how to make the features work better for you. The group's activities include:
- Virtual workshops to learn more about the features
- Feedback surveys to share your needs and priorities
- 1:1 sessions with Google Cloud employees as we explore new features
Activities are offered about once every 6-8 weeks. You can take part in as many or as few as you'd like, or you can opt out entirely at any time. To join the group, complete the Vertex AI Model Optimizer discussion group sign up form.