If you are new to Gemini, using the quickstarts is the fastest way to get started.
However, as your generative AI solutions mature, you may need a platform for building and deploying generative AI applications and solutions end to end. Google Cloud provides a comprehensive ecosystem of tools to enable developers to harness the power of generative AI, from the initial stages of app development to app deployment, app hosting, and managing complex data at scale.
Google Cloud's Vertex AI platform offers a suite of MLOps tools that streamline usage, deployment, and monitoring of AI models for efficiency and reliability. Additionally, integrations with databases, DevOps tools, logging, monitoring, and IAM provide a holistic approach to managing the entire generative AI lifecycle.
The following table summarizes the main differences between Google AI and Vertex AI to help you decide which option is right for your use case:
Features | Google AI Gemini API | Google Cloud Vertex AI Gemini API |
---|---|---|
Latest Gemini models | Gemini Pro and Gemini Ultra | Gemini Pro and Gemini Ultra |
Sign up | Google account | Google Cloud account (with terms agreement and billing) |
Authentication | API key | Google Cloud service account |
User interface playground | Google AI Studio | Vertex AI Studio |
API & SDK | Python, Node.js, Android (Kotlin/Java), Swift, Go | SDK supports Python, Node.js, Java, Go |
Free tier | Yes | $300 Google Cloud credit for new users |
Quota (Request per minute) | 60 (can request increase) | Increase upon request (default: 60) |
Enterprise support | No |
Customer encryption key Virtual private cloud Data residency Access transparency Scalable infrastructure for application hosting Databases and data storage |
MLOps | No | Full MLOps on Vertex AI (Examples: model evaluation, Model Monitoring, Model Registry) |
To learn which products, frameworks, and tools are the best match for building your generative AI application on Google Cloud, see Build a generative AI application on Google Cloud.
Migrate from Gemini on Google AI to Vertex AI
If your application uses Google AI Gemini APIs, you'll need to migrate to Google Cloud's Vertex AI Gemini APIs.
When you migrate:
You can use your existing Google Cloud project (the same one you used to generate your API key) or you can create a new Google Cloud project.
Supported regions may differ between Google AI Studio and Vertex AI. See the list of supported regions for generative AI on Google Cloud.
Any models you created in Google AI Studio need to be retrained in Vertex AI.
Python: Migrate from Google AI Gemini API to the Vertex AI Gemini API
The following sections show code snippets to help you migrate your Python code to use the Vertex AI Gemini API.
Vertex AI Python SDK Setup
On Vertex AI, you don't need an API key. Instead, Gemini on Vertex AI is managed using IAM access, which controls permission for a user, a group, or a service account to call the Gemini API through the Vertex AI SDK.
While there are many ways to authenticate, the easiest method for authenticating in a development environment is to install the Google Cloud CLI then use your user credentials to sign in to the CLI.
To make inference calls to Vertex AI, you must also make sure that your user or service account has the Vertex AI User role.
Code example to install the client
Google AI | Vertex AI |
---|---|
|
|
Code example to generate text from text prompt
Google AI | Vertex AI |
---|---|
|
|
Code example to generate text from text and image
Google AI | Vertex AI |
---|---|
|
|
Code example to generate multi-turn chat
Google AI | Vertex AI |
---|---|
|
|
Delete unused API Keys
If you no longer need to use your Google AI Gemini API key, follow security best practices and delete it.
Next steps
- See the Vertex AI overview to learn more about generative AI solutions on Vertex AI.
- Dive deeper into the Vertex AI Gemini API.