Skip to content

Access production-ready models from model registry#

Model registry is deprecated

The model registry feature is deprecated. This includes:

  • The Models section in the web app.
  • The Model and ModelVersion objects of the API.

The feature will be deactivated on 2025-04-01.

For examples of model lifecycle management using experiments, see:

For how to migrate your models, see Migrate from model registry to experiments.

The following examples illustrate how to download production-stage model files.

This example assumes the following:

  • There exists a model with the ID CLS-PRE, which has at least one version with the stage set to "production".
  • There are model binaries stored in the "model/binary" field of the model version.

To access and download model files based on their stage:

  1. Initialize a registered model and fetch its versions:

    model = neptune.init_model(
        with_id="CLS-PRE", # (1)!
    )
    
    model_versions_df = model.fetch_model_versions_table().to_pandas()
    
    1. The Neptune ID of the model
  2. Filter the pandas DataFrame for model versions with the stage set to "production":

    production_models = model_versions_df[
        model_versions_df["sys/stage"] == "production"
    ]
    
  3. Initialize each model version and download the files from the model/binary field:

    for index, model_version in production_models.iterrows():
        version_id = model_version["sys/id"]
        model_version = neptune.init_model_version(version=version_id)
        model_version["model/binary"].download(f"{version_id}_model.xgb")