Verta
Search…
Creating registered model versions

Creating a model version

Once a registered model has been created, we can add versions to it. A Registered Model Version (RMV) is the unit of reuse, deployment, and monitoring and therefore stores the necessary information such as artifacts, models, requirements, etc.
As discussed in Registry Concepts, RMVs are of one of the following types:
    Standard Verta Models: Models that follow the Verta Model Specification
    and can be deployed from within Verta to the supported deployment systems
    (e.g., Verta Inference, Spark, Kafka, SageMaker, etc.)
    User Containerized Models: Fully packaged model containers
    Custom models: completely flexible, packaging and deployment managed
    by the user

1. Creating a version from a Standard Verta Model

Verta Standard Models require a few key pieces of information:
    Implementation language (required)
    Model class deriving from the VertaModelBase class (required)
    Library dependencies (required)
    Artifacts the model depends on (optional)
    Code dependencies (optional)
    OS dependencies (optional)

1.1. Define a model class that derives from VertaModelBase

1
class MyModel(VertaModelBase):
2
def __init__(self, artifacts):
3
self.a = 1
4
self.b = 0.5
5
6
def predict(self, data):
7
predictions = []
8
for input in data:
9
predictions.append(input*self.a + self.b)
10
return predictions
Copied!

1.2. Define a Registered Model Version from MyModel

Use the create_standard_model API call to create a version following the Verta Model Specification.
1
model_version = some_registered_model.create_standard_model(
2
name="v0", #version name
3
model_cls=MyModel,
4
library_dependencies=Python(),
5
)
Copied!
If your model requires artifacts or OS-level dependencies, you may define them here.
If you are using "pure" scikit-learn, XGBoost, Keras, or PyTorch models, you can use convenience functions purpose-built for these libraries. Refer to this guide for details.

Creating a version from a Container

Coming soon

Creating a Custom model version

Unlike Verta Standard Models, Custom models do not need to adhere to a specification. As a result, you can use them as appropriate for your use case (e.g., just to share weights.)
1
model_version = some_registered_model.create_version(
2
name="my version",
3
)
4
5
# Logging just the weights
6
model_version.log_artifact({"weights": "weights.json"})
Copied!
See the full set of functions available on RegisteredModelVersions here.
Last modified 2mo ago