Chapter 2. Deploying models


The model serving platform is based on the KServe component and deploys each model from its own dedicated model server. This architecture is ideal for deploying, monitoring, scaling, and maintaining large models that require more resources, such as large language models (LLMs).

2.1. Automatic selection of serving runtimes

When you deploy a model, OpenShift AI can automatically select the best serving runtime for your deployment. This feature allows you to efficiently deploy applications without needing to manually research runtime compatibility. The system determines the optimal runtime by analyzing the model type, model format, and selected hardware profile.

2.1.1. Hardware profile matching

The system suggests a runtime by matching the accelerator defined in your selected hardware profile with available runtimes. For example, if you select a hardware profile that uses an NVIDIA GPU accelerator, the system filters for compatible runtimes, such as vLLM NVIDIA GPU ServingRuntime for KServe.

Note

Automatic selection is available only if a hardware profile exists for the specific accelerator that you want to use.

2.1.2. Predictive model selection

For predictive models, you must select a Model format before the system can determine the appropriate serving runtime.

2.1.3. Selection limitations

The Auto-select option is displayed only when the system can identify a single, distinct match. If multiple serving runtime templates are defined for the same accelerator, the system cannot determine the best option automatically, and the auto-select option is not displayed for that hardware profile. In such cases, you must manually select a runtime.

2.1.4. Manual serving runtime selection

You can manually select a specific runtime from the Serving runtime list if the automatically selected option does not meet your needs. This option is useful when you require a specific version of a runtime or want to use a custom runtime that you have added to the platform. The Serving runtime list displays all global and project-scoped serving runtime templates available to you.

2.1.5. Administrator overrides

Cluster administrator settings can override standard hardware profile matching. If the Use distributed inference with llm-d by default when deploying generative models option is enabled in the administrator settings, the system defaults to the Distributed inference with llm-d runtime, regardless of other potential matches. This option is available in Settings > Cluster settings > General settings.

To optimize resource usage and manage downtime during model rollouts, you can configure the deployment strategy for your inference services. Choosing the appropriate strategy depends on your cluster’s available quotas, especially hardware accelerators such as GPUs, and your tolerance for service interruptions.

There are two primary deployment strategies available for model serving:

Rolling update

This strategy ensures zero downtime and continuous availability of the model. New inference service pods start while the existing pods are running. Traffic is switched to the new pods only after they are fully ready, and then the old pods are terminated.

However, rolling updates require increased resources like CPU, memory, and GPUs during the update process. Plan for approximately 200% of the pod requests as headroom during the transition because parallel instances exist briefly.

Recreate

This strategy prioritizes resource conservation over availability. All existing inference service pods are terminated before the new pods attempt to launch.

However, this method requires a period of downtime. The model endpoint is unavailable and returns errors between the termination of the old pod and the readiness of the new pod.

2.2.1. Choosing a deployment strategy

Choose the deployment strategy that best fits your availability requirements and resource quotas. The following table compares the rolling update and recreate strategies.

Expand
StrategyDescriptionResource impactRecommended scenarios

Rolling update

Replaces pods gradually to ensure zero downtime. Traffic switches to new pods only after they are fully ready.

High: Requires approximately 200% of the request resources to host parallel instances during the transition.

  • Production workloads: Environments where the model must remain accessible without interruption.
  • High-quota clusters: Namespaces with sufficient headroom to accommodate parallel instances.

Recreate

Terminates the old pod before starting the new one. Service is unavailable during the transition.

Low: Consumption does not exceed 100%. Prevents Insufficient Resources errors.

  • Resource-constrained environments: Projects using scarce hardware, such as high-end GPUs, where double allocation is not possible.
  • Development and staging: Environments where downtime does not impact business operations.
  • Batch processing: Workflows where immediate availability is not critical.
  • Maintenance windows: Periods where service unavailability is expected.
Important

The Recreate strategy severs the connection to the old pod immediately. Ensure that your traffic routing gateway and client applications can handle a temporary gap in service before applying this strategy.

Note

The Recreate deployment strategy is available for all runtimes except Distributed inference with llm-d. If you select the Distributed inference with llm-d runtime, the deployment strategy options are not displayed and the system defaults to the Recreate strategy.

You can deploy generative AI (gen AI) or predictive AI models on the model serving platform by using the Deploy a model wizard. The wizard allows you to configure your model, including specifying its location and type, selecting a serving runtime, assigning a hardware profile, and setting advanced configurations like external routes and token authentication.

To successfully deploy a model, you must meet the following prerequisites.

General prerequisites

  • You have logged in to Red Hat OpenShift AI.
  • You have installed KServe and enabled the model serving platform.
  • You have enabled a preinstalled or custom model-serving runtime.
  • You have created a project.
  • You have access to S3-compatible object storage, a URI-based repository, an OCI-compliant registry or a persistent volume claim (PVC) and have added a connection to your project. For more information about adding a connection, see Adding a connection to your project.
  • If you want to use graphics processing units (GPUs) with your model server, you have enabled GPU support in OpenShift AI. If you use NVIDIA GPUs, see Enabling NVIDIA GPUs. If you use AMD GPUs, see AMD GPU integration.

Runtime-specific prerequisites

Meet the requirements for the specific runtime you intend to use.

Important

Support for IBM Spyre AI Accelerators on x86 is currently available in Red Hat OpenShift AI 3.4 as a Technology Preview feature. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

Important

Support for IBM Spyre AI Accelerators on ppc64le is currently available in Red Hat OpenShift AI 3.4 as a General Availability (GA) feature.

Procedure

  1. In the left menu, click Projects.
  2. Click the name of the project that you want to deploy a model in.

    A project details page opens.

  3. Click the Deployments tab.
  4. Click Deploy model.

    The Deploy a model wizard opens.

  5. In the Model details section, provide information about the model:

    1. From the Model location list, specify where your model is stored and complete the connection detail fields.

      Note
      • The OCI-compliant registry, S3 compatible object storage, and URI options are preinstalled connection types. Additional options might be available if your OpenShift AI administrator added them.
      • If you have uploaded model files to a persistent volume claim (PVC) and the PVC is attached to your workbench, the Cluster storage option becomes available in the Model location list. Use this option to select the PVC and specify the path to the model file.
    2. From the Model type list, select the type of model that you are deploying, Predictive or Generative AI model.
    3. Click Next.
  6. In the Model deployment section, configure the deployment:

    1. In the Model deployment name field, enter a unique name for your model deployment.
    2. In the Description field, enter a description of your deployment.
    3. From the Hardware profile list, select a hardware profile.
    4. Optional: To modify the default resource allocation, click Customize resource requests and limits and enter new values for the CPU and Memory requests and limits.
    5. In the Serving runtime field, select one of the following options:

      • Auto-select the best runtime for your model based on model type, model format, and hardware profile

        The system analyzes the selected model framework and your available hardware profiles to recommend a serving runtime.

      • Select from a list of serving runtimes, including custom ones

        Select this option to manually choose a runtime from the list of global and project-scoped serving runtime templates.

        For more information about how the system determines the best runtime and administrator overrides, see Automatic selection of serving runtimes.

    6. Optional: If you selected a Predictive model type, select a framework from the Model framework (name - version) list. This field is hidden for Generative AI models.
    7. In the Number of model server replicas to deploy field, specify a value.
    8. Click Next.
  7. In the Advanced settings section, configure advanced options:

    1. Optional: (Generative AI models only) Select the Add as AI asset endpoint checkbox if you want to add your model’s endpoint to the Gen AI studio AI asset endpoints page.

      1. In the Use case field, enter the types of tasks that your model performs, such as chat, multimodal, or natural language processing.

        Note

        You must add your model as an AI asset endpoint to test your model on the Gen AI studio playground page.

        If you enabled the endpoint, enter the types of tasks that your model performs in the Use case field.

    2. Optional: Select the Model access checkbox to make your model deployment available through an external route.
    3. Optional: To require token authentication for inference requests to the deployed model, select Require token authentication.
    4. In the Service account name field, enter the service account name that the token will be generated for.
    5. To add an additional service account, click Add a service account and enter another service account name.
    6. Optional: Select Add custom runtime arguments or Add custom runtime environment variables to add configuration parameters to your deployment.
    7. In the Deployment strategy section, select Rolling update or Recreate. For more information about deployment strategies, see Deployment strategies for resource optimization.

      Note

      The Recreate deployment strategy is available for all runtimes except Distributed inference with llm-d. If you select the Distributed inference with llm-d runtime, the deployment strategy options are not displayed and the system defaults to the Recreate strategy.

  8. Click Deploy.

Verification

  • Confirm that the deployed model is shown on the Deployments tab for the project, and on the Deployments page of the dashboard with a checkmark in the Status column.

Deploy models with the MLServer ServingRuntime for KServe option by selecting your model framework in the Deploy a model wizard. KServe automatically configures the runtime based on your model framework selection. If your model file uses a well-known filename and is located directly under /mnt/models, KServe automatically detects and loads it without additional configuration.

Prerequisites

  • You have logged in to Red Hat OpenShift AI.
  • You have installed KServe and enabled the model serving platform.
  • The MLServer ServingRuntime for KServe is enabled in your cluster. For more information, see Enabling the model serving platform.
  • You have created a project.
  • Your model is stored in a location accessible to the model server and you have added a connection to your project:

    • OCI registry
    • S3-compatible object storage
    • URI
    • Persistent Volume Claim
  • You are deploying a model that uses one of the supported MLServer implementations:

    • LightGBM
    • ONNX
    • Scikit-learn
    • XGBoost
  • Your model file uses a well-known filename and is stored directly under /mnt/models after download. If your model uses a different filename or is stored in a subdirectory, you must manually configure the MLSERVER_MODEL_URI environment variable. Well-known filenames:

    • LightGBM: model.bst
    • ONNX: model.onnx
    • Scikit-learn: model.joblib, model.pickle, model.pkl
    • XGBoost: model.bst, model.json, model.ubj
Note

KServe automatically configures the MLServer runtime environment variables based on your model framework selection. The model name is set to your model deployment name, the model implementation is set based on your selected framework, and the model URI is set to /mnt/models.

Important

You can also use MLServer’s model-settings.json file for model configuration. If a model-settings.json file is present alongside your model file, the MLServer runtime loads configuration values from that file and overrides the automatic configuration. The model name in the file must match your model deployment name.

Configuration beyond model name, model URI, and model implementation is tested and verified, but not officially supported.

Procedure

  1. In the OpenShift AI dashboard, navigate to Projects and select or create a project.
  2. Deploy the model using the Deploy a model wizard.

    For complete deployment instructions, see Deploying models on the model serving platform.

  3. In the Model details section of the wizard:

    1. Select your model location from an existing data connection or cluster storage.
    2. For Model type, select Predictive.
  4. In the Model deployment section:

    1. Enter a model deployment name and optional description.
    2. Select your model framework from the Model framework list:

      • LightGBM
      • ONNX
      • Scikit-learn
      • XGBoost

        The Deployment resource field automatically selects MLServer ServingRuntime for KServe based on your framework selection.

    3. Configure the number of model server replicas to deploy.
  5. If your model file does not use a well-known filename or is not located directly under /mnt/models, configure the MLSERVER_MODEL_URI environment variable in the Advanced settings section:

    1. Select the Add custom runtime environment variables checkbox.
    2. Click Add variable.
    3. Add the MLSERVER_MODEL_URI variable with the full path to your model file, for example, /mnt/models/my-custom-model.pkl or /mnt/models/subfolder/model.pkl.
  6. Click Deploy to deploy your model.

Verification

  • Confirm that the deployed model is shown on the Deployments tab for the project.

    The deployment status displays as Pending during the deployment process. When the deployment completes successfully, the status changes to Started.

  • Test the model by making an inference request:

    1. On the Deployments tab, click the deployment name to view details.
    2. Click Internal and external endpoint to display the inference endpoints.
    3. Copy the external endpoint URL and query the model:

      $ curl -X POST <inference_endpoint_url>/v2/models/<model_name>/infer \
        -H "Content-Type: application/json" \
        -d '{"inputs":[{"name":"<input_name>","shape":[<shape>],"datatype":"<datatype>","data":[<data>]}]}'

      where:

      <inference_endpoint_url>
      Specifies the external endpoint URL for your deployed model.
      <model_name>
      Specifies the name of your deployed model.
      <input_name>
      Specifies the input name expected by your model.
      <shape>
      Specifies the shape of your input data.
      <datatype>
      Specifies the data type, for example, FP32.
      <data>

      Specifies your input data values.

      The model returns an inference response with the prediction results.

You can deploy a model that is stored in an OCI image from the command line interface.

The following procedure uses the example of deploying a MobileNet v2-7 model in ONNX format, stored in an OCI image on an OpenVINO model server.

Note

By default in KServe, models are exposed outside the cluster and not protected with authentication.

Prerequisites

  • You have stored a model in an OCI image as described in Storing a model in an OCI image.
  • If you want to deploy a model that is stored in a private OCI repository, you must configure an image pull secret. For more information about creating an image pull secret, see Using image pull secrets.
  • You are logged in to your OpenShift cluster.

Procedure

  1. Create a project to deploy the model:

    oc new-project oci-model-example
  2. Use the OpenShift AI Applications project kserve-ovms template to create a ServingRuntime resource and configure the OpenVINO model server in the new project:

    oc process -n redhat-ods-applications -o yaml kserve-ovms | oc apply -f -
  3. Verify that the ServingRuntime named kserve-ovms is created:

    oc get servingruntimes

    The command should return output similar to the following:

    NAME          DISABLED   MODELTYPE     CONTAINERS         AGE
    kserve-ovms              openvino_ir   kserve-container   1m
  4. Create an InferenceService YAML resource, depending on whether the model is stored from a private or a public OCI repository:

    • For a model stored in a public OCI repository, create an InferenceService YAML file with the following values, replacing <user_name>, <repository_name>, and <tag_name> with values specific to your environment:

      apiVersion: serving.kserve.io/v1beta1
      kind: InferenceService
      metadata:
        name: sample-isvc-using-oci
      spec:
        predictor:
          model:
            runtime: kserve-ovms # Ensure this matches the name of the ServingRuntime resource
            modelFormat:
              name: onnx
            storageUri: oci://quay.io/<user_name>/<repository_name>:<tag_name>
            resources:
              requests:
                memory: 500Mi
                cpu: 100m
                # nvidia.com/gpu: "1" # Only required if you have GPUs available and the model and runtime will use it
              limits:
                memory: 4Gi
                cpu: 500m
                # nvidia.com/gpu: "1" # Only required if you have GPUs available and the model and runtime will use it
    • For a model stored in a private OCI repository, create an InferenceService YAML file that specifies your pull secret in the spec.predictor.imagePullSecrets field, as shown in the following example:

      apiVersion: serving.kserve.io/v1beta1
      kind: InferenceService
      metadata:
        name: sample-isvc-using-private-oci
      spec:
        predictor:
          model:
            runtime: kserve-ovms # Ensure this matches the name of the ServingRuntime resource
            modelFormat:
              name: onnx
            storageUri: oci://quay.io/<user_name>/<repository_name>:<tag_name>
            resources:
              requests:
                memory: 500Mi
                cpu: 100m
                # nvidia.com/gpu: "1" # Only required if you have GPUs available and the model and runtime will use it
              limits:
                memory: 4Gi
                cpu: 500m
                # nvidia.com/gpu: "1" # Only required if you have GPUs available and the model and runtime will use it
          imagePullSecrets: # Specify image pull secrets to use for fetching container images, including OCI model images
          - name: <pull-secret-name>

      After you create the InferenceService resource, KServe deploys the model stored in the OCI image referred to by the storageUri field.

Verification

Check the status of the deployment:

oc get inferenceservice

The command should return output that includes information, such as the URL of the deployed model and its readiness state.

2.6. Monitoring models

You can monitor models that are deployed on the model serving platform to view performance and resource usage metrics.

You can monitor the following metrics for a specific model that is deployed on the model serving platform:

  • Number of requests - The number of requests that have failed or succeeded for a specific model.
  • Average response time (ms) - The average time it takes a specific model to respond to requests.
  • CPU utilization (%) - The percentage of the CPU limit per model replica that is currently utilized by a specific model.
  • Memory utilization (%) - The percentage of the memory limit per model replica that is utilized by a specific model.

You can specify a time range and a refresh interval for these metrics to help you determine, for example, when the peak usage hours are and how the model is performing at a specified time.

Prerequisites

  • You have installed Red Hat OpenShift AI.
  • A cluster admin has enabled user workload monitoring (UWM) for user-defined projects on your OpenShift cluster. For more information, see Enabling monitoring for user-defined projects and Configuring monitoring for the model serving platform.
  • You have logged in to Red Hat OpenShift AI.
  • The following dashboard configuration options are set to the default values as shown:

    disablePerformanceMetrics:false
    disableKServeMetrics:false

    For more information about setting dashboard configuration options, see Customizing the dashboard.

  • You have deployed a model on the model serving platform by using a preinstalled runtime.

    Note

    Metrics are only supported for models deployed by using a preinstalled model-serving runtime or a custom runtime that is duplicated from a preinstalled runtime.

Procedure

  1. From the OpenShift AI dashboard navigation menu, click Projects.

    The Projects page opens.

  2. Click the name of the project that contains the data science models that you want to monitor.
  3. In the project details page, click the Deployments tab.
  4. Select the model that you are interested in.
  5. On the Endpoint performance tab, set the following options:

    • Time range - Specifies how long to track the metrics. You can select one of these values: 1 hour, 24 hours, 7 days, and 30 days.
    • Refresh interval - Specifies how frequently the graphs on the metrics page are refreshed (to show the latest data). You can select one of these values: 15 seconds, 30 seconds, 1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, and 1 day.
  6. Scroll down to view data graphs for number of requests, average response time, CPU utilization, and memory utilization.

Verification

The Endpoint performance tab shows graphs of metrics for the model.

When a cluster administrator has configured monitoring for the model serving platform, non-admin users can use the OpenShift web console to view model-serving runtime metrics for the KServe component.

Prerequisites

Procedure

  1. Log in to the OpenShift web console.
  2. Switch to the Developer perspective.
  3. In the left menu, click Observe.
  4. As described in Monitoring your project metrics, use the web console to run queries for model-serving runtime metrics. You can also run queries for metrics that are related to OpenShift Service Mesh. Some examples are shown.

    1. The following query displays the number of successful inference requests over a period of time for a model deployed with the vLLM runtime:

      sum(increase(vllm:request_success_total{namespace=${namespace},model_name=${model_name}}[${rate_interval}]))
      Note

      Certain vLLM metrics are available only after an inference request is processed by a deployed model. To generate and view these metrics, you must first make an inference request to the model.

    2. The following query displays the number of successful inference requests over a period of time for a model deployed with the OpenVINO Model Server runtime:

      sum(increase(ovms_requests_success{namespace=${namespace},name=${model_name}}[${rate_interval}]))
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top