Creating registered model versions
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.
- Standard Verta Models: Models that follow the Verta Model Specificationand 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 managedby the user
Verta Standard Models require a few key pieces of information:
- Implementation language (required)
- Library dependencies (required)
- Artifacts the model depends on (optional)
- Code dependencies (optional)
- OS dependencies (optional)
from verta.registry import VertaModelBase
class MyModel(VertaModelBase):
def __init__(self, artifacts):
self.a = 1
self.b = 0.5
def predict(self, data):
predictions = []
for input in data:
predictions.append(input*self.a + self.b)
return predictions
from verta.environment import Python
model_version = some_registered_model.create_standard_model(
name="v0", #version name
model_cls=MyModel,
environment=Python(['pkg-one', 'pkg-two==1.0.0']), # pip installable packages required by model
check_model_dependencies=True, # optional check for missing dependencies in the environment
)
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.
Coming soon
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.)
model_version = some_registered_model.create_version(
name="my version",
)
# Logging just the weights
model_version.log_artifact({"weights": "weights.json"})