Red Hat’s KServe pattern brings native R models onto OpenShift AI
A custom runtime and ModelCar workflow turns R model files into authenticated KServe inference services without rewriting them in Python.
Red Hat has published a complete path for serving native R models on OpenShift AI: build a custom KServe runtime, package the model as an OCI ModelCar, import the runtime and deploy an authenticated inference service. The pattern fills a practical gap for data-science teams whose production models remain in R-native formats.
What the pattern supports
The kserveR runtime accepts .rds objects with a predict() method, plus .qs2, .rda and .RData files. Its supported objects include common linear, tree, neural-network and tidymodels workflows.
The runtime is built on Red Hat UBI 9 with R 4.4.2. It loads the model once at startup, reconstructs factor columns from the training schema, converts KServe V2 tensors to R data frames and exposes Prometheus-format request metrics. It also fails rather than guessing when a model directory contains multiple candidate files.
How deployment works
The model and runtime travel separately. Teams build the server image with Podman, while a ModelCar image puts the model beneath /models in an OCI artifact. OpenShift AI administrators then register a ServingRuntime, either with oc or through the console.
The supplied manifests create an InferenceService and an authentication path using a service account, role, role binding and token secret. Red Hat’s example deploys a random-forest model from the Iris data set, sends a KServe V2 request over an authenticated route and returns predicted classes.
Why it matters
R models often stall between a scientist’s workbench and a standard production serving stack. This pattern avoids translating the model into another framework merely to gain Kubernetes deployment, routing and lifecycle controls.
It is also a reusable example of OpenShift AI’s bring-your-own-runtime boundary. Platform teams can keep the KServe contract and OpenShift operational model while owning the language runtime, package set and model formats behind it.
Teams evaluating the approach should rebuild the images in their own registry, review the baked-in R packages, replace the sample resource limits and validate model schemas before exposing a route. The repository’s prebuilt images make the walkthrough faster, but a production rollout should treat both runtime and ModelCar as governed software-supply-chain artifacts.
sources
- Deploy R models on Red Hat OpenShift AI with KServedevelopers.redhat.com
comments · 0