---
title: "Deploy R models on Red Hat OpenShift AI with KServe"
description: "R models can be deployed as production microservices on Red Hat OpenShift AI using KServe and a custom R serving runtime. The runtime supports classical model file formats such as .rds, .qs2, .rda, and .RData, provided the object has a predict() method. A ModelCar container packages the model under the /models directory, separating the artifact from the runtime environment. The custom runtime is imported into OpenShift AI via CLI or web console, then the model is deployed through an InferenceService or the dashboard. OpenShift handles load balancing, autoscaling, self-healing, and security policies, while the UBI base image allows standard CVE scanning."
---

# Deploy R models on Red Hat OpenShift AI with KServe

[Red Hat](https://yomu.fyi/company/red-hat) · Anneli Sara Banderby · Nov 19, 2026

**Type:** Tutorial

## Summary

R models can be deployed as production microservices on Red Hat OpenShift AI using KServe and a custom R serving runtime. The runtime supports classical model file formats such as .rds, .qs2, .rda, and .RData, provided the object has a predict() method. A ModelCar container packages the model under the /models directory, separating the artifact from the runtime environment. The custom runtime is imported into OpenShift AI via CLI or web console, then the model is deployed through an InferenceService or the dashboard. OpenShift handles load balancing, autoscaling, self-healing, and security policies, while the UBI base image allows standard CVE scanning.

## Context

R programmers who want to deploy classical R model objects (e.g., lm, glm, randomForest, ranger) as production microservices on Red Hat OpenShift AI using KServe, without manually configuring the serving environment each time.

## Approach / What changed

Build a custom R serving runtime image with KServe, package the model as a ModelCar OCI container, import the runtime into OpenShift AI via CLI or web console, and deploy the model using an InferenceService YAML or the OpenShift AI dashboard.

## Takeaways

- The custom R serving runtime supports .rds, .qs2, .rda, and .RData model files whose objects have a predict() method, including lm, glm, randomForest, ranger, glmnet, rpart, nnet, e1071, MASS, caret train, and tidymodels.
- A ModelCar is an OCI-compliant container image that packages only the model file under /models, allowing KServe to deploy the model without reconfiguring the environment each time.
- The runtime image is built on Red Hat Universal Base Image 9 (UBI 9) with R 4.4.2, and the container runs as a non-root user on port 8080 for security.

## FAQ

### Which R model file formats does the custom runtime support?

The runtime supports .rds files whose object has a predict() method (e.g., lm, glm, randomForest, ranger, glmnet, rpart, nnet, e1071, MASS, caret train, tidymodels), plus .qs2, .rda, and .RData files.

### What is a ModelCar and why use it?

A ModelCar is an OCI-compliant container image that packages only the model file under the /models directory. It lets KServe deploy the model without configuring the environment from scratch each time, separating the model artifact from the serving runtime.

### What permissions are needed to import the custom runtime?

You need OpenShift AI administrator permissions in your cluster. If you lack them, contact your admin to apply the servingruntime-template.yaml manifest or use the web console's Settings → Serving runtimes → Add serving runtime.

**Tags:** [Containers](https://yomu.fyi/topic/containers), [KServe](https://yomu.fyi/topic/kserve), [Model Serving](https://yomu.fyi/topic/model-serving), [Red Hat OpenShift AI](https://yomu.fyi/topic/red-hat-openshift-ai)

- Source: [Red Hat](https://developers.redhat.com/articles/2026/11/19/deploy-r-models-red-hat-openshift-ai-kserve)
- Source URL: https://developers.redhat.com/articles/2026/11/19/deploy-r-models-red-hat-openshift-ai-kserve
- Ingested by Yomu: 2026-11-19T15:00:12.783Z

[Read original post](https://developers.redhat.com/articles/2026/11/19/deploy-r-models-red-hat-openshift-ai-kserve)
