The InferenceService Resource
Declare a model deployment in a single manifest.
The InferenceService Resource is a free MLOps Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MLOps Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Meet KServe
KServe turns a trained model into a production endpoint on Kubernetes. You describe what you want, and it handles serving, scaling, and routing for you. KServe is your serving layer. 🚀
One Resource to Rule Them
Instead of writing raw Deployments and Services by hand, you create a single custom resource. The InferenceService is the one object that defines your whole serving setup.
It Is Just YAML
You declare an InferenceService in a small YAML manifest, then apply it with kubectl. KServe reads that manifest and builds everything underneath.
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
name: sklearn-irisThe Predictor Block
The core of the spec is the predictor, which says how to load and run your model. It points KServe at the model and the runtime that should serve it.
spec:
predictor:
model:
modelFormat:
name: sklearn
storageUri: gs://kfserving-examples/models/sklearn/1.0/modelWhere Your Model Lives
The storageUri tells KServe where to pull the model from, like a GCS or S3 bucket. KServe downloads it into the serving container at startup.
Model Format Picks the Runtime
The modelFormat field, such as sklearn or pytorch, lets KServe choose a matching serving runtime automatically. No custom server code needed for common frameworks.
Apply It Like Any Resource
You ship the manifest to the cluster with a normal kubectl command. KServe sees the new object and starts reconciling it into a running service. kubectl apply kicks it off.
kubectl apply -f sklearn-iris.yamlWatch It Become Ready
After applying, you check status until the service reports READY. The READY column flips to True once the model is loaded and accepting traffic.
kubectl get inferenceservice sklearn-irisYou Get a URL
A ready InferenceService exposes a stable URL for predictions. Clients send requests there, and KServe routes them to your model behind the scenes.
Sending a Prediction
You POST your input as JSON to the predict path of that URL. KServe forwards it to the model and returns the prediction in the response body.
curl -X POST $URL/v1/models/sklearn-iris:predict \
-d '{"instances": [[5.1, 3.5, 1.4, 0.2]]}'Transformer and Explainer Too
Beyond predictor, the spec can add a transformer for pre and post processing and an explainer for insight. Each is optional and chains automatically.
Quick Check
You want KServe to serve a model. Which single object do you declare?
Recap
You learned that the InferenceService is KServe's single declarative resource. Set a predictor with a storageUri and format, apply it, and get a ready prediction URL. Nice work! 🎉
Frequently asked questions
Is the “The InferenceService Resource” lesson free?
Yes — the full text of “The InferenceService Resource” is free to read here on the web, and the MLOps Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MLOps Academy course, upgrade to CoddyKit PRO.
What will I learn in “The InferenceService Resource”?
Declare a model deployment in a single manifest. You practise MLOps Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start MLOps Academy?
No prior experience is required. MLOps Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The InferenceService Resource” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this MLOps Academy lesson?
Yes. Every MLOps Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The InferenceService Resource
- Scale to Zero and Back Up
- Write a Custom Predictor
- KServe vs Seldon Core