Principle:SeldonIO Seldon core Model Artifact Preparation
| 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.joblibfiles - TensorFlow:
tf.saved_model.save()produces SavedModel directories - PyTorch:
torch.save()produces.ptor.pthfiles - XGBoost:
model.save_model()produces.bstor.jsonfiles
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:
- Train the model using the appropriate ML framework
- Serialize the model to a persistent artifact using framework-specific tools
- Create a
model-settings.jsonspecifying the runtime and artifact URI - 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
- SeldonIO_Seldon_core_Sklearn_Pipeline_Train_And_Serialize implements SeldonIO_Seldon_core_Model_Artifact_Preparation
- SeldonIO_Seldon_core_Model_Resource_Definition follows SeldonIO_Seldon_core_Model_Artifact_Preparation
- SeldonIO_Seldon_core_Model_Deployment_Execution depends on SeldonIO_Seldon_core_Model_Artifact_Preparation
Implementation:SeldonIO_Seldon_core_Sklearn_Pipeline_Train_And_Serialize