4.3. 为多model服务平台添加经过测试和验证的模型运行时


除了预安装和自定义模型服务运行时外,您还可以使用红帽经过测试和验证的模型运行时,如 NVIDIA Triton Inference Server 来支持您的需要。有关红帽经过测试和验证的运行时的更多信息,请参阅 Red Hat OpenShift AI 测试和验证的运行时

您可以使用 Red Hat OpenShift AI 仪表板来添加和启用 NVIDIA Triton Inference Server 运行时,然后在为多模型服务平台创建新模型服务器时选择运行时。

先决条件

  • 您已以具有 OpenShift AI 管理员特权的用户身份登录到 OpenShift AI。
  • 您熟悉如何在 项目 中添加模型服务器。添加经过测试和验证的模型运行时后,您必须配置新的模型服务器来使用运行时。

流程

  1. 在 OpenShift AI 仪表板中点 Settings Serving runtime

    Serving 运行时 页面将打开,并显示已安装和启用的模型服务运行时。

  2. 要添加经过测试和验证的运行时,请点 Add serving runtime
  3. Select the model service platform this runtime support 列表中,选择 Multi-model serving platform

    注意

    多型号服务平台只支持 REST 协议。因此,您无法更改 此运行时支持的 Select the API 协议中的默认值

  4. Start from scratch
  5. 在嵌入的编辑器中直接输入或粘贴以下 YAML 代码。

    apiVersion: serving.kserve.io/v1alpha1
    kind: ServingRuntime
    metadata:
      annotations:
        enable-route: "true"
      name: modelmesh-triton
      labels:
        opendatahub.io/dashboard: "true"
    spec:
      annotations:
        opendatahub.io/modelServingSupport: '["multi"x`x`]'
        prometheus.kserve.io/path: /metrics
        prometheus.kserve.io/port: "8002"
      builtInAdapter:
        env:
          - name: CONTAINER_MEM_REQ_BYTES
            value: "268435456"
          - name: USE_EMBEDDED_PULLER
            value: "true"
        memBufferBytes: 134217728
        modelLoadingTimeoutMillis: 90000
        runtimeManagementPort: 8001
        serverType: triton
      containers:
        - args:
            - -c
            - 'mkdir -p /models/_triton_models;  chmod 777
              /models/_triton_models;  exec
              tritonserver "--model-repository=/models/_triton_models" "--model-control-mode=explicit" "--strict-model-config=false" "--strict-readiness=false" "--allow-http=true" "--allow-grpc=true"  '
          command:
            - /bin/sh
          image: nvcr.io/nvidia/tritonserver@sha256:xxxxx
          name: triton
          resources:
            limits:
              cpu: "1"
              memory: 2Gi
            requests:
              cpu: "1"
              memory: 2Gi
      grpcDataEndpoint: port:8001
      grpcEndpoint: port:8085
      multiModel: true
      protocolVersions:
        - grpc-v2
        - v2
      supportedModelFormats:
        - autoSelect: true
          name: onnx
          version: "1"
        - autoSelect: true
          name: pytorch
          version: "1"
        - autoSelect: true
          name: tensorflow
          version: "1"
        - autoSelect: true
          name: tensorflow
          version: "2"
        - autoSelect: true
          name: tensorrt
          version: "7"
        - autoSelect: false
          name: xgboost
          version: "1"
        - autoSelect: true
          name: python
          version: "1"
    Copy to Clipboard Toggle word wrap
  6. metadata.name 字段中,确保您添加的运行时值与您已添加的运行时不匹配。
  7. 可选: 要为您添加的运行时使用自定义显示名称,请添加 metadata.annotations.openshift.io/display-name 字段并指定一个值,如下例所示:

    apiVersion: serving.kserve.io/v1alpha1
    kind: ServingRuntime
    metadata:
      name: modelmesh-triton
      annotations:
        openshift.io/display-name: Triton ServingRuntime
    Copy to Clipboard Toggle word wrap
    注意

    如果没有为您的运行时配置自定义显示名称,OpenShift AI 会显示 metadata.name 字段的值。

  8. Create

    Serving 运行时页面将打开,并显示所安装的运行时的更新列表。观察您添加的运行时会自动启用。

  9. 可选: 要编辑运行时,请点击操作菜单(WWN)并选择 Edit

验证

  • 您添加的 model-serving 运行时显示在 Serving 运行时 页面中的 enabled 状态。
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部