Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eThis guide details how to use the Colab Enterprise side panel to interact with Vertex AI for model tuning, allowing users to customize large models to specific tasks.\u003c/p\u003e\n"],["\u003cp\u003eModel tuning in Vertex AI enhances model quality, robustness, and efficiency by reducing inference latency and cost.\u003c/p\u003e\n"],["\u003cp\u003eUsers can tune a Gemini model by opening a Colab Enterprise notebook, navigating to the "Tuning" tab in the side panel, and updating parameters like \u003ccode\u003ePROJECT_ID\u003c/code\u003e, \u003ccode\u003eREGION\u003c/code\u003e, \u003ccode\u003eTUNED_MODEL_DISPLAY_NAME\u003c/code\u003e, and model tuning parameters in the added code cells.\u003c/p\u003e\n"],["\u003cp\u003eThe side panel provides various insights into the tuning process, such as monitoring metrics, dataset summaries, and details about the tuning job.\u003c/p\u003e\n"],["\u003cp\u003eUsers can also use the side panel to view the details of existing tuning jobs, regardless of whether the user created the job, by providing the \u003ccode\u003eTUNING_JOB_ID\u003c/code\u003e along with the \u003ccode\u003ePROJECT_ID\u003c/code\u003e, and \u003ccode\u003eREGION\u003c/code\u003e within the added code cells.\u003c/p\u003e\n"]]],[],null,["# Tune a model\n============\n\nThis page shows you how to interact with Vertex AI to tune a\nmodel by using the side panel in Colab Enterprise.\n\nTo access Google Cloud services and APIs by running code in\nyour Colab Enterprise notebook, you can use the\ncredentials associated with your Google Account. To learn more, see\n[Access Google Cloud services and APIs](/colab/docs/run-code-adc).\n\nThe side panel is an additional way to interact with Vertex AI\nto tune models without leaving the Colab Enterprise interface.\n\nThe side panel appears to the right of an open notebook.\n\nModel tuning in Vertex AI\n-------------------------\n\n*Model tuning* is an effective way to customize large models to your tasks.\nIt's a key step to improving the model's quality and efficiency. Model tuning\nprovides the following benefits:\n\n- Higher quality for your specific tasks\n- Increased model robustness\n- Lower inference latency and cost due to shorter prompts\n\nFor an overview of Vertex AI model tuning for\nGemini, see [Introduction to\ntuning](/vertex-ai/generative-ai/docs/models/tune-models).\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Vertex AI, Dataform, and Compute Engine APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.com, dataform.googleapis.com, compute.googleapis.com&redirect=https://console.cloud.google.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Vertex AI, Dataform, and Compute Engine APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.com, dataform.googleapis.com, compute.googleapis.com&redirect=https://console.cloud.google.com)\n\n### Required roles\n\n\nTo get the permissions that\nyou need to use the side panel in a Colab Enterprise notebook,\n\nask your administrator to grant you the\nfollowing IAM roles on the project:\n\n- [Colab Enterprise User](/iam/docs/roles-permissions/aiplatform#aiplatform.colabEnterpriseUser) (`roles/aiplatform.colabEnterpriseUser`)\n- [Vertex AI User](/iam/docs/roles-permissions/aiplatform#aiplatform.user) (`roles/aiplatform.user`)\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n| One or more of the required roles includes the `dataform.repositories.list` permission. Users who are granted the `dataform.repositories.list` permission or the [Code Creator\n| (`roles/dataform.codeCreator`)](/iam/docs/understanding-roles#dataform.codeCreator) role in a project can list the names of code assets in that project by using the Dataform API or the Dataform command-line interface (CLI). Non-administrators using BigQuery Studio can only see code assets that they created or that were shared with them.\n\nTune a model\n------------\n\nYou can tune a model in Vertex AI by using the\nside panel in Colab Enterprise.\n\n1. In the Google Cloud console, go to\n the Colab Enterprise **My notebooks** page.\n\n [Go to My notebooks](https://console.cloud.google.com/vertex-ai/colab/notebooks)\n2. In the **Region** menu, select the region that contains your notebook.\n\n3. Click the notebook that you want to open. If you haven't created a notebook yet,\n [create a notebook](/colab/docs/create-console-quickstart#create).\n\n4.\n To the right of your notebook, in the side panel, click the\n **Tuning**\n button.\n\n The side panel expands the **Tuning** tab.\n5. Click the **Tune a Gemini model** button.\n\n\n Colab Enterprise adds code cells to your notebook for\n tuning a Gemini model.\n6.\n In your notebook, find the code cell that stores parameter values.\n You'll use these parameters to interact with Vertex AI.\n\n7. Update the values for the following parameters:\n\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project that your notebook is in.\n - \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: The region that your notebook is in.\n - \u003cvar translate=\"no\"\u003eTUNED_MODEL_DISPLAY_NAME\u003c/var\u003e: The name of your tuned model.\n8. In the next code cell, update the model tuning parameters:\n\n - `source_model`: The Gemini model that you want to use, for example, `gemini-2.0-flash-001`.\n - `train_dataset`: The URL of your training dataset.\n - `validation_dataset`: The URL of your validation dataset.\n - Adjust the remaining parameters as needed.\n9. Run the code cells that the side panel added to your notebook.\n\n10.\n After the last code cell runs, click the\n **View\n tuning job** button that appears.\n\n11. The side panel shows information about your model tuning job.\n\n - The **Monitor** tab shows tuning metrics when the metrics are ready.\n - The **Dataset** tab shows a summary and metrics about your dataset after the dataset has been processed.\n - The **Details** tab shows information about your tuning job, such as the tuning method and the base model (source model) that you used.\n12.\n After the tuning job has completed, you can go directly from\n the **Tuning details** tab to a page where you can test your model.\n Click **Test**.\n\n\n The Google Cloud console opens to the Vertex AI\n **Text chat** page, where you can test your model.\n\nView details of a tuning job\n----------------------------\n\nYou can view the details of a tuning job, even if you didn't create and run\nthe tuning job in Colab Enterprise. You can view a tuning job's details\nby using the side panel in Colab Enterprise.\n\n1. In the Google Cloud console, go to\n the Colab Enterprise **My notebooks** page.\n\n [Go to My notebooks](https://console.cloud.google.com/vertex-ai/colab/notebooks)\n2. In the **Region** menu, select the region that contains your notebook.\n\n3. Click the notebook that you want to open. If you haven't created a notebook yet,\n [create a notebook](/colab/docs/create-console-quickstart#create).\n\n4.\n To the right of your notebook, in the side panel, click the\n **Tuning** button.\n\n The side panel expands the **Tuning** tab.\n5. Click the **View tuning job details** button.\n\n\n Colab Enterprise adds code cells to your notebook for\n getting the details of a tuning job.\n6.\n In your notebook, find the code cell that stores parameter values.\n You'll use these parameters to interact with Vertex AI.\n\n7. Update the values for the following parameters:\n\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project that your notebook is in.\n - \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: The region that your notebook is in.\n - \u003cvar translate=\"no\"\u003eTUNING_JOB_ID\u003c/var\u003e: The ID of your Vertex AI tuning job.\n8. Run the code cells that the side panel added to your notebook.\n\n9.\n After the last code cell runs, click the\n **View\n tuning job** button that appears.\n\n10. The side panel shows information about your model tuning job.\n\n - The **Monitor** tab shows tuning metrics when the metrics are ready.\n - The **Dataset** tab shows a summary and metrics about your dataset after the dataset has been processed.\n - The **Details** tab shows information about your tuning job, such as the tuning method and the base model (source model) that you used.\n\nWhat's next\n-----------\n\n- Learn more about [model tuning in\n Vertex AI](/vertex-ai/generative-ai/docs/models/tune-models).\n\n- To learn more about model tuning parameters, see\n [Tune\n Gemini models by using supervised fine-tuning](/vertex-ai/generative-ai/docs/models/gemini-use-supervised-tuning).\n\n- To find a notebook that can help you get your project started quickly,\n see the [notebook gallery](https://console.cloud.google.com/vertex-ai/colab/notebook-gallery)."]]