metadata-models/docs/entities/mlModelGroup.md
ML Model Groups represent collections of related machine learning models within an organization's ML infrastructure. They serve as logical containers for organizing model versions, experimental variants, or families of models that share common characteristics. Model groups are essential for managing the lifecycle of ML models, tracking model evolution over time, and organizing models by purpose, architecture, or business function.
ML Model Groups are identified by three pieces of information:
Platform: The ML platform or tool where the model group exists. This represents the specific ML technology that hosts the model group. Examples include mlflow, sagemaker, databricks, kubeflow, tensorflow, pytorch, etc. The platform is represented as a URN like urn:li:dataPlatform:mlflow.
Name: The unique name of the model group within the specific platform. This is typically a human-readable identifier that describes the purpose or family of models. Names should be meaningful and follow your organization's naming conventions. Examples include recommendation-models, fraud-detection-v2, or customer-churn-prediction.
Origin (Fabric): The environment or fabric where the model group belongs or was generated. This qualifier helps distinguish between models in different environments such as Production (PROD), Staging (QA), Development (DEV), or Testing environments. The full list of supported environments is available in FabricType.pdl.
An example of an ML Model Group identifier is urn:li:mlModelGroup:(urn:li:dataPlatform:mlflow,recommendation-models,PROD).
Model group properties are stored in the mlModelGroupProperties aspect and contain the core metadata about a model group:
Here is an example of creating an ML Model Group with properties:
<details> <summary>Python SDK: Create an ML Model Group</summary>{{ inline /metadata-ingestion/examples/library/mlmodel_group_create.py show_path_as_comment }}
ML Model Groups inherit lineage capabilities from the MLModelLineageInfo record, which captures important information about how models in the group are created and used:
These lineage relationships are visible in DataHub's lineage graph and help track the full lifecycle of ML models from training data through deployment.
<details> <summary>Python SDK: Add training lineage to a model group</summary>{{ inline /metadata-ingestion/examples/library/mlmodel_group_add_lineage.py show_path_as_comment }}
Like other entities in DataHub, ML Model Groups can have owners assigned using the ownership aspect. Model group owners are typically responsible for:
Ownership types for model groups follow the same patterns as other entities, including TECHNICAL_OWNER, BUSINESS_OWNER, DATA_STEWARD, DATAOWNER, PRODUCER, DEVELOPER, etc.
{{ inline /metadata-ingestion/examples/library/mlmodel_group_add_owner.py show_path_as_comment }}
ML Model Groups support both tags and glossary terms for categorization and discovery:
globalTags aspect): Informal labels for quick categorization. Use tags for properties like experimental, production-ready, high-priority, computer-vision, nlp, etc.glossaryTerms aspect): Formal business vocabulary terms that provide standardized definitions. Use terms to link model groups to business concepts.{{ inline /metadata-ingestion/examples/library/mlmodel_group_add_tags.py show_path_as_comment }}
{{ inline /metadata-ingestion/examples/library/mlmodel_group_add_terms.py show_path_as_comment }}
Model groups support documentation through multiple aspects:
mlModelGroupProperties: Primary documentation field for describing the model groupinstitutionalMemory aspect): Links to external resources such as:
{{ inline /metadata-ingestion/examples/library/mlmodel_group_add_documentation.py show_path_as_comment }}
ML Model Groups can be assigned to domains using the domains aspect. This allows organizing model groups by business unit, department, or functional area. A model group can belong to only one domain at a time.
{{ inline /metadata-ingestion/examples/library/mlmodel_group_add_domain.py show_path_as_comment }}
Model groups can be marked as deprecated using the deprecation aspect when they are no longer actively maintained or should be replaced. This helps users understand which model families are still supported.
{{ inline /metadata-ingestion/examples/library/mlmodel_group_deprecate.py show_path_as_comment }}
Model groups support structured properties for storing typed, schema-validated metadata that goes beyond simple key-value pairs. This is useful for enforcing organizational standards around model metadata.
The primary relationship for ML Model Groups is with ML Models themselves. Models can be associated with a model group through the groups field in the mlModelProperties aspect. This creates a MemberOf relationship from the model to the model group.
Common patterns for organizing models in groups include:
Version-based grouping: All versions of a model (v1, v2, v3) belong to the same group. Note that versioning is handled through the versionProperties aspect on individual models (which includes version numbers, versionSet URNs, and aliases like "champion" or "challenger"), while the model group serves as the organizational container.
Experiment-based grouping: Different experimental variants of a model belong to the same group
Architecture-based grouping: Models sharing the same architecture or approach
Purpose-based grouping: Models serving the same business purpose or use case
{{ inline /metadata-ingestion/examples/library/mlgroup_add_to_mlmodel.py show_path_as_comment }}
Through the MLModelLineageInfo fields, model groups can be connected to:
These relationships enable end-to-end lineage tracking from training data through model deployment.
While ML Model Groups don't directly reference ML Features, the individual models within the group often consume ML Features. The model group serves as an organizational layer above the model-to-feature relationships.
Model groups can be organized within containers using the container aspect. This is useful for representing hierarchical structures like:
You can query model groups and their associated models using both the REST API and the Python SDK.
curl 'http://localhost:8080/entities/urn%3Ali%3AmlModelGroup%3A(urn%3Ali%3AdataPlatform%3Amlflow,recommendation-models,PROD)' \
-H 'Authorization: Bearer <token>'
This will return the model group entity with all its aspects, including:
mlModelGroupKey: The unique identifiermlModelGroupProperties: Name, description, version, timestampsownership: Owners of the model groupglobalTags: Tags attached to the groupglossaryTerms: Business terms associated with the groupdomains: Domain assignmentinstitutionalMemory: Links and documentation{{ inline /metadata-ingestion/examples/library/mlmodel_group_read.py show_path_as_comment }}
To find all models that belong to a specific model group, you can query the relationships.
<details> <summary>REST API: Find all models in a model group</summary>curl 'http://localhost:8080/relationships?direction=INCOMING&urn=urn%3Ali%3AmlModelGroup%3A(urn%3Ali%3AdataPlatform%3Amlflow,recommendation-models,PROD)&types=MemberOf' \
-H 'Authorization: Bearer <token>'
This returns all ML Model entities that are members of the specified model group.
</details>ML Model Groups work seamlessly with popular ML platforms:
MLflow's registered models naturally map to DataHub model groups, with model versions becoming individual MLModel entities within the group. The MLflow ingestion connector automatically creates these relationships.
Amazon SageMaker model packages and model package groups can be represented as model groups in DataHub, providing a unified view across AWS environments.
Databricks ML models registered in Unity Catalog can be organized into model groups for better organization and governance.
Kubeflow model registries can leverage model groups to organize models by pipeline or serving configuration.
Any custom ML platform can use model groups by specifying an appropriate platform identifier in the URN.
It's important to understand when to use a model group versus tracking individual models:
Lineage information stored at the model group level (via trainingJobs and downstreamJobs) represents common lineage across all models in the group. Individual models can also have their own specific lineage information in their mlModelProperties aspect. The two levels of lineage are complementary:
When creating model groups, consider your naming strategy:
Model groups support platform instances via the dataPlatformInstance aspect. This is useful when you have multiple instances of the same platform (e.g., multiple MLflow registries) and need to distinguish model groups across them.
Model groups are searchable in DataHub by:
This makes it easy to discover relevant model groups through the DataHub UI or search API.