Model versions
The following code lists the latest 1000 model versions of each registered model in a workspace and copies their metadata into a Delta table.
Note: The search_model_versions
REST API does not support pagination, nor does it support filtering based on the version column. To list all model versions under a registered model, Databricks recommends listing model versions 10,000 at a time in order of descending version, deleting versions you no longer need, and then repeating the process as necessary until you are under the limit.
search_params = {
"filter": f"name = 'too_many_model_versions'",
"max_results": 10000,
"order_by": ["version DESC"]
}
Inventory workspace model registry entities
This notebook uses the model registry REST API to copy all registered model and model version metadata into Delta tables. You can use then use the Delta tables to understand your model registry entities and select entities to delete.