Local examples
SKLearn Model
We use a simple sklearn iris classification model
cat ./models/sklearn-iris-gs.yamlapiVersion: mlops.seldon.io/v1alpha1
kind: Model
metadata:
name: iris
spec:
storageUri: "gs://seldon-models/scv2/samples/mlserver_1.3.5/iris-sklearn"
requirements:
- sklearn
memory: 100Ki
Load the model
kubectl apply -f ./models/sklearn-iris-gs.yaml -n ${NAMESPACE}model.mlops.seldon.io/iris createdseldon model load -f ./models/sklearn-iris-gs.yaml{}Wait for the model to be ready
kubectl wait --for condition=ready --timeout=300s model iris -n ${NAMESPACE}model.mlops.seldon.io/iris condition metseldon model status iris -w ModelAvailable | jq -M .{}Do a REST inference call
Do a gRPC inference call
Unload the model
Tensorflow Model
We run a simple tensorflow model. Note the requirements section specifying tensorflow.
Load the model.
Wait for the model to be ready.
Get model metadata
Do a REST inference call.
Do a gRPC inference call
Unload the model
Experiment
We will use two SKlearn Iris classification models to illustrate an experiment.
Load both models.
Wait for both models to be ready.
Create an experiment that modifies the iris model to add a second model splitting traffic 50/50 between the two.
Start the experiment.
Wait for the experiment to be ready.
Run a set of calls and record which route the traffic took. There should be roughly a 50/50 split.
Run one more request
Use sticky session key passed by last infer request to ensure same route is taken each time. We will test REST and gRPC.
gPRC
Stop the experiment
Show the requests all go to original model now.
Unload both models.
Last updated
Was this helpful?

