Truefoundry provides a comprehensive model registry to store and manage models. Models are stored in repositories which are backed by S3/GCS/Azure Container/Minio storage on your cloud account. The key functionalities provided by the model registry are:

Upload Model From UI

You can either upload a model file from disk or import a model saved in your S3 bucket.

Log Model In Code

Install the truefoundry library following the instructions here
You can log models of all frameworks in the registry. Example of code to log SkLearn and Transformers are provided below:

from truefoundry.ml import get_client

client = get_client()
model_version = client.log_model(
    ml_repo="name-of-the-ml-repo",
    name="name-for-the-model",
    model_file_or_folder="path/to/model/file/or/folder/on/disk",
    framework=None
)
Any file or folder can be saved as model by passing it in model_file_or_folder and framework can be set to None

For other frameworks, you can use the following classes in truefoundry.ml

FastAIFramework, GluonFramework, H2OFramework, KerasFramework, LightGBMFramework, ONNXFramework, PaddleFramework, SklearnFramework, SpaCyFramework, StatsModelsFramework, TransformersFramework, XGBoostFramework

Any subsequent calls to log_model with the same name would create a new version of this model - v2, v3 and so on.

View and manage versions

The logged model can be found in the Models tab. It can also be accessed from inside the MLRepo.

You can view the details of each model version from there on.

Once a model version is created, the model version files are immutable. Only fields like description, framework, metadata can be updated using CLI or UI.

Using the Model in your code

For every model version, you can find the code to download it in your inference service.

Code Snippet to download model