liveBook · Manning

InferenceService

As explained in Distributed Machine Learning Patterns

An InferenceService is a KServe resource specification describing a deployed machine learning inference service and its model source and serving configuration.

An InferenceService is a KServe resource that describes a deployed machine-learning inference service. Its specification identifies the model format and the location or image used to serve the trained model. section 9.3.1

A typical definition uses the serving.kserve.io/v1beta1 API, names the service, and configures a predictor with a TensorFlow model. A storage URI can point to a model directory on a persistent volume, while a serving image can provide the model server. section 9.3.1 section 9.4.1

The resource participates in an operational serving workflow:

  • Create the service after training and model selection have produced the persisted model. section 9.4.1
  • Check readiness with kubectl get isvc before sending requests. section 9.3.1
  • Expose the ingress locally with port-forwarding, then call the /v1/models/<name>:predict endpoint using Python or curl. section 9.3.1
  • Inspect the serving Pod logs to verify which model version TensorFlow Serving loaded. section 9.3.1

Flower-sample service

A service named flower-sample declares TensorFlow as its model format and reads saved_model_versions from the strategy-volume persistent volume. After creation, a prediction request returns class probabilities, while the logs confirm that TensorFlow Serving loaded version 4. section 9.3.1

Listing 9.21 Inference service definition
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
 name: flower-sample
spec:
 predictor:
   model:
     modelFormat:
       name: tensorflow
     storageUri: "pvc://strategy-volume/saved_model_versions"

Inspect the compact YAML resource definition for a TensorFlow-backed InferenceService. section 9.3.1

How Distributed Machine Learning Patterns covers it

How deep it goes
Explains YAML fields, readiness checks, request paths, local access, and logs, but does not develop KServe internals.
Examples
Uses the flower-sample service, TensorFlow SavedModel storage, Python and curl requests, readiness output, and serving logs.
What it assumes
Assumes a trained, persisted TensorFlow model and Kubernetes access; teaches the serving resource and request workflow.
What you can do after
Operate/configure a TensorFlow inference endpoint, verify readiness, submit predictions, and inspect the loaded model version.
How it connects
Connects KServe with Kubernetes, TensorFlow Serving, persistent volumes, TensorFlow models, and Argo Workflows.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.