Before you can use Gemini in Colab Enterprise, your team needs to activate Gemini in Colab Enterprise in a Google Cloud project, as described in this document. An administrator typically performs this step.
Activate Gemini in Colab Enterprise in a Google Cloud project
To activate Gemini in Colab Enterprise in a Google Cloud project, an administrator needs to enable the Gemini for Google Cloud API and grant the Gemini for Google Cloud User roles to users.
To enable the Gemini for Google Cloud API, in the Google Cloud console, go to the Gemini for Google Cloud page.
In the project selector, select a project.
Click Enable.
The page updates and shows a status of Enabled. Gemini is now available in the selected Google Cloud project to all users who have the required IAM roles.
To grant the IAM roles that are required to use Gemini, go to the IAM & Admin page.
In the Principal column, find a principal for which you want to give access to Gemini in Colab Enterprise, and then click Edit principal in that row.
In the Edit access pane, click
Add another role.In Select a role, select Gemini for Google Cloud User.
Click Save.
All of the users who have been granted these roles can access Gemini for Google Cloud features in the Google Cloud console within the specified project. For more information, see Use Gemini for AI assistance and development.
Advanced setup tasks
Instead of using the Google Cloud console or the gcloud CLI to grant predefined IAM roles, you can do any of the following:
Use IAM REST APIs or IAM client libraries to grant roles.
If you use these interfaces, use the fully qualified role name,
roles/cloudaicompanion.user
.For more information about granting roles, see Manage access to projects, folders, and organizations.
Create and grant custom roles.
Any custom roles that you create need the following permissions to access Gemini:
cloudaicompanion.instances.generateCode
cloudaicompanion.instances.completeCode
cloudaicompanion.entitlements.get
What's next
- Learn how to write code with Gemini assistance.
- Learn more about the types of generative AI assistance available in Gemini for Google Cloud.
- Learn how Gemini for Google Cloud uses your data.
- Learn how to access and manage Gemini admin controls.