Seldon
Seldon Core / Seldon Enterprise Platform
A Kubernetes-based platform for ML model deployment and serving. Supports the entire MLOps lifecycle, including model deployment, A/B testing, canary deployment, explainability, and drift monitoring.
Seldon Core / Seldon Enterprise Platform
A Kubernetes-based platform for ML model deployment and serving. Supports the entire MLOps lifecycle, including model deployment, A/B testing, canary deployment, explainability, and drift monitoring.
Seldon is an open-source platform for deploying and managing machine learning models in production on Kubernetes. It was developed by Seldon Technologies, a UK company founded in 2018, and is widely used in enterprise environments such as finance, automotive, and insurance. Seldon's core philosophy is to provide "a standardized serving layer that supports every ML framework."
Seldon's product lineup consists of three main parts. MLServer is an open-source inference server under the Apache 2.0 license that serves models through REST/gRPC APIs. Seldon Core is a deployment framework based on Kubernetes CRDs (Custom Resource Definitions), and lets you define complex inference graphs through the SeldonDeployment resource. Seldon Enterprise Platform is a commercial version that includes a GUI-based management tool, advanced monitoring, and technical support.
The core feature of Seldon Core is the Inference Graph. Beyond deploying a single model, you can define complex deployment patterns in a single YAML file, such as connecting multiple models as a pipeline (AβBβC), A/B testing, canary deployments, ensembles, and routers. In addition, Alibi Explain and Alibi Detect provide model explainability (SHAP, Anchors, etc.) and data drift/outlier detection out of the box.
Starting in January 2024, the license of the Seldon Core v1, v2, and Alibi projects changed from Apache 2.0 to BSL 1.1 (Business Source License). This means that a license purchase is required to offer them as a commercial SaaS, but use within your own infrastructure remains free. MLServer continues to remain under Apache 2.0. Seldon Core+ is an enterprise version that provides tested binaries, SLA support, and dedicated technical support.
This is an example of deploying a scikit-learn model to Kubernetes using Seldon Core.
# 1. λͺ¨λΈ νμ΅ λ° μ μ₯ (model.py)
import joblib
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import load_iris
# λͺ¨λΈ νμ΅
iris = load_iris()
model = LogisticRegression(max_iter=200)
model.fit(iris.data, iris.target)
# λͺ¨λΈ μ μ₯
joblib.dump(model, "model.joblib")
# 2. Seldon λνΌ ν΄λμ€ μμ± (MyModel.py)
import joblib
class MyModel:
def __init__(self):
self.model = joblib.load("model.joblib")
def predict(self, X, features_names=None):
"""
X: numpy array ννμ μ
λ ₯ λ°μ΄ν°
returns: μμΈ‘ κ²°κ³Ό
"""
return self.model.predict(X)
def predict_proba(self, X, features_names=None):
"""νλ₯ μμΈ‘ (μ νμ )"""
return self.model.predict_proba(X)
# 3. Dockerfile
"""
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY model.joblib .
COPY MyModel.py .
EXPOSE 9000
CMD ["seldon-core-microservice", "MyModel", "--service-type", "MODEL"]
"""
# 4. requirements.txt
"""
seldon-core
scikit-learn
joblib
"""
SeldonDeployment YAML Definition
# seldon-deployment.yaml
apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
name: iris-model
namespace: seldon
spec:
predictors:
- name: default
replicas: 2
graph:
name: classifier
implementation: SKLEARN_SERVER
modelUri: gs://your-bucket/iris-model
# λλ 컀μ€ν
μ΄λ―Έμ§ μ¬μ©:
# children: []
# implementation: null
# name: classifier
componentSpecs:
- spec:
containers:
- name: classifier
image: your-registry/iris-model:v1
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
traffic: 100
---
# A/B ν
μ€νΈ μμ
apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
name: iris-ab-test
spec:
predictors:
- name: model-a
traffic: 80
graph:
name: classifier-a
implementation: SKLEARN_SERVER
modelUri: gs://bucket/model-v1
- name: model-b
traffic: 20
graph:
name: classifier-b
implementation: SKLEARN_SERVER
modelUri: gs://bucket/model-v2
Deployment and Testing
# Seldon Core μ€μΉ (Helm)
helm repo add seldon https://storage.googleapis.com/seldon-charts
helm repo update
helm install seldon-core seldon-core-operator \
--namespace seldon-system \
--create-namespace \
--set usageMetrics.enabled=true
# λͺ¨λΈ λ°°ν¬
kubectl apply -f seldon-deployment.yaml
# λ°°ν¬ μν νμΈ
kubectl get seldondeployments -n seldon
kubectl get pods -n seldon
# μΆλ‘ μμ² (curl)
curl -X POST http://<INGRESS_IP>/seldon/seldon/iris-model/api/v1.0/predictions \
-H "Content-Type: application/json" \
-d '{"data": {"ndarray": [[5.1, 3.5, 1.4, 0.2]]}}'
# Python ν΄λΌμ΄μΈνΈ
import requests
import json
url = "http://<INGRESS_IP>/seldon/seldon/iris-model/api/v1.0/predictions"
payload = {"data": {"ndarray": [[5.1, 3.5, 1.4, 0.2], [6.2, 3.4, 5.4, 2.3]]}}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2))
Seldon is available in open-source and enterprise editions.
| Product | License | Price | Key features |
|---|---|---|---|
| MLServer | Apache 2.0 | Free | REST/gRPC inference server, multi-model support |
| Seldon Core | BSL 1.1 | Free* | K8s deployment, inference graph, A/B testing |
| Seldon Core+ | Commercial | Custom | Tested binaries, SLA support, technical support |
| Enterprise Platform | Commercial | Custom | GUI dashboard, advanced monitoring, GenAI support |
* Free for use within your own infrastructure; license required to offer as a commercial SaaS
Feature Comparison
| Feature | Core (Open Source) | Core+ | Enterprise Platform |
|---|---|---|---|
| Model Deployment | O | O | O |
| A/B Testing, Canary | O | O | O |
| Alibi Explain/Detect | O (BSL) | O | O |
| Multi-Model Serving | O | O (Optimized) | O (Optimized) |
| GUI Dashboard | X | X | O |
| GenAI/LLM Support | Limited | Add-on | O |
| Technical Support | Community | SLA Included | Dedicated Team |
"When deploying a new model, if you do a canary deployment with Seldon, you can test with just 10% of the traffic first. If there are no problems, you can gradually increase it."
"If you need model explanations, you can attach Alibi Explain to Seldon and provide SHAP values through an API, without building an additional server."
"Just train the model with Seldon." β Seldon is a serving platform, not a training platform. Training is done in a separate environment, and the model is deployed with Seldon.