Skip to main content

Applying Model instances to db

There are 4 key AI Model sub classes, see here for detailed usage:

PathDescription
superduper.components.model.ObjectModelWraps a Python object to compute outputs
superduper.components.model.APIModelWraps a model hosted behind an API to compute outputs
superduper.components.model.QueryModelMaps a Database select query with a free variable over inputs
superduper.components.model.SequentialModelComputes outputs sequentially for a sequence of Model instances

As well as these key sub-classes, we have classes in the superduper.ext.* subpackages: See here for more information.

Whenever one of these Model descendants is instantiated, and db.apply(model) is called, several things can (do) happen:

  1. The Model's metadata is saved in the db.metadata_store.
  2. It's associated data (e.g.) model is saved in the db.artifact_store.
  3. (Optional) if the Model has a Trainer attached, then the Model is trained/ fit on the specified data.
  4. (Optional) if the Model has an Evaluation method attached, then the Model is evaluated on the specified data.