Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:SeldonIO Seldon core Seldon Model CRD Explainer Deploy

From Leeroopedia
Revision as of 10:51, 27 September 2026 by Agent (talk | contribs) (Sync from local file)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Field Value
Type Pattern Doc
Overview Concrete pattern for declaring and deploying explainer models in Seldon Core 2.
Domains MLOps, Explainability, Kubernetes
Workflow Model_Explainability
Related Principle Principle:SeldonIO_Seldon_core_Explainer_Model_Deployment
Source samples/models/income-explainer.yaml:L1-9, samples/models/moviesentiment-explainer.yaml:L1-9, samples/explainers/explainers.yaml:L1-26
Last Updated 2026-02-13 00:00 GMT

Code Reference

Income Explainer (AnchorTabular with modelRef)

Source: samples/models/income-explainer.yaml:L1-9

apiVersion: mlops.seldon.io/v1alpha1
kind: Model
metadata:
  name: income-explainer
spec:
  storageUri: "gs://seldon-models/scv2/samples/mlserver_1.6.0/income-sklearn/anchor-explainer"
  explainer:
    type: anchor_tabular
    modelRef: income

Movie Sentiment Explainer (AnchorText with modelRef)

Source: samples/models/moviesentiment-explainer.yaml:L1-9

apiVersion: mlops.seldon.io/v1alpha1
kind: Model
metadata:
  name: sentiment-explainer
spec:
  storageUri: "gs://seldon-models/scv2/samples/mlserver_1.6.0/moviesentiment/anchor-explainer"
  explainer:
    type: anchor_text
    modelRef: sentiment

Key Parameters

Parameter Description Values
spec.explainer.type Alibi explanation algorithm anchor_tabular, anchor_text, kernel_shap
spec.explainer.modelRef Name of the base model to explain e.g., income, sentiment
spec.explainer.pipelineRef Name of the pipeline to explain (alternative to modelRef) e.g., sentiment-explain
spec.storageUri URI to the serialized explainer artifact e.g., gs://seldon-models/scv2/samples/mlserver_1.6.0/income-sklearn/anchor-explainer

I/O Contract

Inputs

  • Explainer CRD YAML: A Model CRD manifest with the spec.explainer section specifying the algorithm type and base model reference
  • Base model deployed and ready: The model referenced by modelRef must be in ModelAvailable state

Outputs

  • Explainer model loaded on MLServer: The explainer is served by the Alibi-Explain runtime, linked to the base model via modelRef for black-box inference during explanation generation

External Dependencies

  • Kubernetes API
  • MLServer Alibi-Explain runtime
  • Seldon scheduler
  • seldon CLI

Usage Examples

Deploying the Income Explainer

# Ensure the base model is loaded first
seldon model load -f samples/models/income.yaml
seldon model status income -w ModelAvailable

# Deploy the explainer
seldon model load -f samples/models/income-explainer.yaml
seldon model status income-explainer -w ModelAvailable

Deploying the Sentiment Explainer

# Ensure the base model is loaded first
seldon model load -f samples/models/moviesentiment.yaml
seldon model status sentiment -w ModelAvailable

# Deploy the explainer
seldon model load -f samples/models/moviesentiment-explainer.yaml
seldon model status sentiment-explainer -w ModelAvailable

Explainer CRD Structure

The explainer CRD extends the standard Model CRD with the spec.explainer section:

apiVersion: mlops.seldon.io/v1alpha1
kind: Model
metadata:
  name: <explainer-name>
spec:
  storageUri: "<uri-to-explainer-artifact>"
  explainer:
    type: <anchor_tabular|anchor_text|kernel_shap>
    modelRef: <base-model-name>       # OR
    pipelineRef: <pipeline-name>      # for pipeline-level explanation

Knowledge Sources

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment