OpenAI 模型

Vertex AI 上的 OpenAI 模型以 API 形式提供全代管式无服务器模型。如需使用 Vertex AI 上的 OpenAI 模型,请直接向 Vertex AI API 端点发送请求。由于 OpenAI 模型使用托管式 API,因此无需预配或管理基础设施。

您可以流式传输回答,以降低最终用户对延迟时间的感知度。流式回答使用服务器发送的事件 (SSE) 来逐步流式传输回答。

可用的 OpenAI 模型

OpenAI 提供了以下模型,可在 Vertex AI 中使用。如需访问 OpenAI 模型,请前往其 Model Garden 模型卡片。

gpt-oss 120B

OpenAI gpt-oss 120B 是一款 120B 开放权重语言模型,根据 Apache 2.0 许可发布。非常适合推理和函数调用应用场景。该模型针对部署在消费类硬件上进行了优化。

120B 模型在核心推理基准方面与 OpenAI o4-mini 几乎相当,同时在单个 80GB GPU 上运行。

前往 gpt-oss 120B 模型卡片

gpt-oss 20B

OpenAI gpt-oss 20B 是一款根据 Apache 2.0 许可发布的 200 亿参数开放权重语言模型。非常适合推理和函数调用应用场景。该模型针对部署在消费类硬件上进行了优化。

20B 模型在常见基准测试中可提供与 OpenAI o3-mini 类似的结果,并且可以在内存为 16GB 的边缘设备上运行,非常适合设备端使用情形、本地推理或快速迭代,而无需昂贵的基础设施。

前往 gpt-oss 20B 模型卡片

准备工作

如需将 OpenAI 模型与 Vertex AI 搭配使用,您必须执行以下步骤。必须启用 Vertex AI API (aiplatform.googleapis.com) 才能使用 Vertex AI。如果您已有启用了 Vertex AI API 的项目,则可以使用该项目,而无需创建新项目。

  1. 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.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Vertex AI API.

    Enable the API

  8. 前往以下 Model Garden 模型卡片之一,然后点击启用