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.

Principle:SeldonIO Seldon core Model Artifact Preparation

From Leeroopedia
Property Value
Principle Name Model_Artifact_Preparation
Overview The process of training an ML model and serializing it with metadata for serving.
Workflow Model_Deployment
Domains MLOps, Model_Serialization
Related Implementation SeldonIO_Seldon_core_Sklearn_Pipeline_Train_And_Serialize
Last Updated 2026-02-13 00:00 GMT

Description

Before deploying on Seldon Core 2, models need to be trained, serialized (e.g., joblib, pickle, SavedModel), and paired with a model-settings.json that specifies the MLServer runtime implementation and artifact URI. This preparation step bridges the gap between model development and model serving by producing two key outputs: a serialized model artifact and a configuration file that tells the inference server how to load and serve the model.

The serialization format depends on the ML framework used:

  • scikit-learn: joblib.dump() produces .joblib files
  • TensorFlow: tf.saved_model.save() produces SavedModel directories
  • PyTorch: torch.save() produces .pt or .pth files
  • XGBoost: model.save_model() produces .bst or .json files

Each artifact must be accompanied by a model-settings.json that declares the MLServer runtime implementation class, the model name, and the URI pointing to the artifact location.

Theoretical Basis

Model serialization converts in-memory model objects to persistent byte streams. This is a fundamental requirement for decoupling model training from model serving: trained models can be stored, versioned, and distributed independently of the training environment.

MLServer uses the model-settings.json configuration to know which runtime to load and where the artifact is stored. The configuration follows a declarative pattern where the implementation field maps to a specific MLServer runtime class (e.g., mlserver_sklearn.SKLearnModel), and the uri field points to the serialized artifact. This indirection allows MLServer to support multiple frameworks through a plugin-based architecture.

The serialization process must preserve:

  • Model parameters: Learned weights, coefficients, and fitted transformers
  • Pipeline structure: For composite models (e.g., sklearn Pipelines), the ordering and nesting of transformers and estimators
  • Metadata: Version information, feature names, and expected input/output shapes

Usage

This principle applies when preparing new ML models for deployment on Seldon Core 2 with MLServer. The typical workflow is:

  1. Train the model using the appropriate ML framework
  2. Serialize the model to a persistent artifact using framework-specific tools
  3. Create a model-settings.json specifying the runtime and artifact URI
  4. Upload both files to a storage location (GCS, S3, MinIO, or local path)
{
  "name": "iris",
  "implementation": "mlserver_sklearn.SKLearnModel",
  "parameters": {
    "uri": "./model.joblib",
    "version": "v0.1.0"
  }
}

Related Pages

Implementation:SeldonIO_Seldon_core_Sklearn_Pipeline_Train_And_Serialize

Page Connections

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