Model Garden 提供了多种选项,可供您快速查看和测试模型功能。对于受支持的模型,您可以试用演示 Playground,也可以启动名为“Model Garden Spaces”的演示应用,并与他人分享,以展示模型的功能。
Playground 由预部署的 Vertex AI 在线预测端点提供支持,不会产生费用。打开支持的模型对应的模型卡片后,您可以使用试用面板,通过发送文本提示快速测试模型的功能。您还可以设置一些最常见的参数,例如温度和输出 token 数。Playground 仅限文本输入和输出。
启动 Spaces 后,您将获得一个可正常运行的 Web 应用,与部署模型并构建应用以使用模型端点相比,所需的人工工作量要少得多。Model Garden 会在 Vertex AI 中部署您选择的模型,并在使用已部署模型端点的 Cloud Run 实例上部署示例应用。应用还可以使用现有端点或 MaaS 端点。
如需启动模型,请打开支持的模型对应的模型卡片,然后在试用 Spaces 面板中,点击某个 Space 以启动它。您需要为部署所用的机器以及托管应用的 Cloud Run 实例付费。
准备工作
本教程需要您设置 Google Cloud 项目并启用 Vertex AI API。
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"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Try it: Test model capabilities using demo playgrounds in Model Garden\n\nModel Garden hosts public demo playgrounds for\n[supported models](#supported_models). The playgrounds are powered by predeployed\nVertex AI [online prediction endpoints](/vertex-ai/docs/predictions/overview).\n\nWhen you open the model card for a supported model, a **Try out** panel is\nembedded in the card. You can quickly test the model's capabilities by sending a\ntext prompt in the **Try out** panel. The **Try out** panel also lets you set\nsome of the most common parameters such as temperature and number of output\ntokens.\n\nSupported models\n----------------\n\nThe following models have demo playgrounds available.\n\nBefore you begin\n----------------\n\nThis tutorial requires you to set up a Google Cloud project and enable the\nVertex AI API.\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 API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.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 API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.com)\n\n\u003cbr /\u003e\n\nTry out Gemma 2\n---------------\n\nIn this quickstart, you try out the `Gemma-2b-it` model. Note that\n`-it` stands for [instruction-tuned](/vertex-ai/generative-ai/docs/open-models/use-gemma#gem-model-sizes).\n\n1. In the Google Cloud console, go to the **Gemma 2** model card.\n\n [Go to Gemma 2](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/gemma2)\n2. In the **Try out** panel:\n\n 1. For **Region**, accept the default or choose your region.\n 2. For **Endpoint** , select **Demo playground (Free)2b-it**.\n 3. In the **Prompt** box, enter `Why is the sky blue?`.\n 4. Expand the **Advanced options** section and view the default parameters.\n\n3. Click **Submit**. The output appears below the Submit button.\n\nClean up\n--------\n\nTo avoid incurring charges to your Google Cloud account for the resources used\non this page, follow these steps.\n\n### Delete the project\n\n\nThe easiest way to eliminate billing is to delete the project that you\ncreated for the tutorial.\n\nTo delete the project:\n\n| **Caution** : Deleting a project has the following effects:\n|\n| - **Everything in the project is deleted.** If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.\n| - **Custom project IDs are lost.** When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.\n|\n|\n| If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects\n| can help you avoid exceeding project quota limits.\n1. In the Google Cloud console, go to the **Manage resources** page.\n\n [Go to Manage resources](https://console.cloud.google.com/iam-admin/projects)\n2. In the project list, select the project that you want to delete, and then click **Delete**.\n3. In the dialog, type the project ID, and then click **Shut down** to delete the project.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\nSee an [overview of Model Garden](/vertex-ai/generative-ai/docs/model-garden/explore-models)."]]