Skip to main content
Version: Next

ML Model Deployment

ML Model Deployments represent deployed instances of machine learning models running in production or other environments. They track the operational aspects of ML models, including their deployment status, platform, configuration, and lifecycle. Model deployments are distinct from ML models themselves - while an ML model represents the trained artifact, a deployment represents a specific instance of that model serving predictions in a particular environment.

Identity

ML Model Deployments are identified by three pieces of information:

  • The platform where the deployment is hosted: This is the specific deployment or serving platform that hosts the model. Examples include sagemaker, azureml, vertexai, mlflow, seldon, kserve, etc. This corresponds to a data platform URN.
  • The name of the deployment: Each platform has its own way of naming deployments. For example, SageMaker uses endpoint names, while Azure ML uses deployment names within a workspace.
  • The environment or origin: This qualifier indicates the environment where the deployment runs (PROD, DEV, TEST, etc.), similar to the fabric concept used for datasets.

An example of an ML model deployment identifier is urn:li:mlModelDeployment:(urn:li:dataPlatform:sagemaker,recommendation-endpoint,PROD).

Important Capabilities

Deployment Properties

The core metadata about a deployment is stored in the mlModelDeploymentProperties aspect. This includes:

  • Description: Documentation explaining the purpose and configuration of the deployment
  • Deployment Status: The current operational state of the deployment, which can be:
    • IN_SERVICE: Active deployments serving predictions
    • OUT_OF_SERVICE: Deployments that are not currently serving traffic
    • CREATING: Deployments being provisioned
    • UPDATING: Deployments being updated with new configurations
    • ROLLING_BACK: Deployments being reverted to a previous version
    • DELETING: Deployments being removed
    • FAILED: Deployments in an error state
    • UNKNOWN: Deployments with unmapped or unknown status
  • Version: The version of the deployment configuration
  • Created At: Timestamp indicating when the deployment was created
  • Custom Properties: Additional platform-specific configuration details
  • External URL: Link to view the deployment in its native platform

The following code snippet shows you how to create an ML model deployment.

Python SDK: Create an ML model deployment
# Inlined from /metadata-ingestion/examples/library/mlmodel_deployment_create.py
import os

import datahub.emitter.mce_builder as builder
import datahub.metadata.schema_classes as models
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.emitter.rest_emitter import DatahubRestEmitter

# Get DataHub connection details from environment
gms_server = os.getenv("DATAHUB_GMS_URL", "http://localhost:8080")
token = os.getenv("DATAHUB_GMS_TOKEN")

# Create a deployment URN - the unique identifier for the ML model deployment
deployment_urn = builder.make_ml_model_deployment_urn(
platform="sagemaker",
deployment_name="recommendation-endpoint",
env="PROD",
)

# Define deployment properties with status and custom properties
deployment_properties = models.MLModelDeploymentPropertiesClass(
description="Production deployment of recommendation model on SageMaker",
customProperties={
"instance_type": "ml.m5.xlarge",
"instance_count": "3",
"endpoint_config": "recommendation-endpoint-config-v1",
},
externalUrl="https://console.aws.amazon.com/sagemaker/home#/endpoints/recommendation-endpoint",
status=models.DeploymentStatusClass.IN_SERVICE,
)

# Create a metadata change proposal
event = MetadataChangeProposalWrapper(
entityUrn=deployment_urn,
aspect=deployment_properties,
)

# Emit the metadata
rest_emitter = DatahubRestEmitter(gms_server=gms_server, token=token)
rest_emitter.emit(event)
print(f"Created ML model deployment: {deployment_urn}")

Linking Deployments to Models

ML Model Deployments are connected to their underlying ML Models through the mlModelProperties.deployments field. This relationship enables:

  • Deployment Tracking: Understanding where and how a model is deployed
  • Version Management: Tracking which model version is deployed in each environment
  • Impact Analysis: Understanding the production footprint of a model
  • Rollback Planning: Identifying active deployments when model issues arise
Python SDK: Link a deployment to an ML model
# Inlined from /metadata-ingestion/examples/library/mlmodel_deployment_add_to_model.py
from datahub.emitter import mce_builder
from datahub.metadata.urns import MlModelUrn
from datahub.sdk import DataHubClient

client = DataHubClient.from_env()

mlmodel_urn = MlModelUrn(platform="sagemaker", name="recommendation-model")

deployment_urn = mce_builder.make_ml_model_deployment_urn(
platform="sagemaker",
deployment_name="recommendation-endpoint",
env="PROD",
)

mlmodel = client.entities.get(mlmodel_urn)
mlmodel.add_deployment(deployment_urn)

client.entities.update(mlmodel)

Tags and Classification

ML Model Deployments can have tags attached to them using the globalTags aspect. Tags are useful for:

  • Categorizing deployments by purpose (production, canary, shadow)
  • Tracking cost centers or teams
  • Marking deployments for compliance or security review
  • Organizing deployments by model type or use case

Ownership

Ownership is associated with a deployment using the ownership aspect. Owners can be technical owners (ML engineers, MLOps teams) or business owners (product managers, data scientists) who are responsible for the deployment. Ownership helps with:

  • Accountability for deployment health and performance
  • Contact information for incidents
  • Access control and permissions management
  • Organizational governance
Python SDK: Add an owner to a deployment
# Inlined from /metadata-ingestion/examples/library/mlmodel_deployment_add_owner.py
import datahub.emitter.mce_builder as builder
import datahub.metadata.schema_classes as models
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.emitter.rest_emitter import DatahubRestEmitter
from datahub.ingestion.graph.client import DatahubClientConfig, DataHubGraph

gms_endpoint = "http://localhost:8080"
emitter = DatahubRestEmitter(gms_server=gms_endpoint, extra_headers={})
graph = DataHubGraph(DatahubClientConfig(server=gms_endpoint))

deployment_urn = builder.make_ml_model_deployment_urn(
platform="sagemaker",
deployment_name="recommendation-endpoint",
env="PROD",
)

owner_to_add = builder.make_user_urn("mlops_team")

current_ownership = graph.get_aspect(
entity_urn=deployment_urn, aspect_type=models.OwnershipClass
)

if current_ownership:
if owner_to_add not in [owner.owner for owner in current_ownership.owners]:
current_ownership.owners.append(
models.OwnerClass(
owner=owner_to_add,
type=models.OwnershipTypeClass.TECHNICAL_OWNER,
)
)
else:
current_ownership = models.OwnershipClass(
owners=[
models.OwnerClass(
owner=owner_to_add,
type=models.OwnershipTypeClass.TECHNICAL_OWNER,
)
]
)

emitter.emit(
MetadataChangeProposalWrapper(
entityUrn=deployment_urn,
aspect=current_ownership,
)
)

Platform Instance

The dataPlatformInstance aspect provides additional context about the specific instance of the deployment platform. This is important when organizations have multiple instances of the same platform (e.g., multiple SageMaker accounts, different Azure ML workspaces, separate Kubernetes clusters).

Deprecation and Lifecycle Management

Deployments can be marked as deprecated using the deprecation aspect when they are planned for decommissioning. This includes:

  • Deprecation Flag: Marking the deployment as deprecated
  • Decommission Time: Planned date for removing the deployment
  • Deprecation Note: Information about why the deployment is being deprecated and what replaces it
  • Replacement: Reference to the new deployment that should be used instead

The status aspect can also be used to soft-delete a deployment (mark it as removed) when it has been taken down but you want to preserve the historical metadata.

Organizational Context

Containers

Deployments can belong to a parent container (such as an ML workspace, namespace, or project) using the container aspect. This creates a hierarchical structure:

ML Workspace (Container)
├── Model Deployment 1
├── Model Deployment 2
└── Model Deployment 3

This hierarchy helps with:

  • Organizing deployments by project or team
  • Managing access control at the workspace level
  • Understanding resource utilization and costs
  • Navigating related deployments

Integration with External Systems

Ingestion from ML Platforms

ML Model Deployments are typically ingested automatically from ML platforms using DataHub's ingestion connectors:

  • SageMaker: Ingests endpoint deployments with their configuration and status
  • Azure ML: Ingests model deployments from workspaces
  • Vertex AI: Ingests endpoint deployments from Google Cloud
  • MLflow: Ingests registered model deployments
  • Seldon Core / KServe: Ingests inference services from Kubernetes

Each connector maps platform-specific deployment metadata to DataHub's standardized deployment model.

Querying Deployment Information

You can retrieve deployment information using DataHub's REST API:

Fetch deployment entity snapshot
curl 'http://localhost:8080/entities/urn%3Ali%3AmlModelDeployment%3A(urn%3Ali%3AdataPlatform%3Asagemaker,recommendation-endpoint,PROD)'

The response includes all aspects of the deployment, including:

  • Deployment properties (status, version, description)
  • Ownership information
  • Tags and classification
  • Platform instance details
  • Deprecation status

Relationships API

You can query deployment relationships to understand its connections to other entities:

Find deployments for a specific ML model
curl 'http://localhost:8080/relationships?direction=INCOMING&urn=urn%3Ali%3AmlModel%3A(urn%3Ali%3AdataPlatform%3Asagemaker,recommendation-model,PROD)&types=DeployedTo'

This returns all deployments of the specified ML model.

Find the ML model for a deployment
curl 'http://localhost:8080/relationships?direction=OUTGOING&urn=urn%3Ali%3AmlModel%3A(urn%3Ali%3AdataPlatform%3Asagemaker,recommendation-model,PROD)&types=DeployedTo'

This returns the ML model that is deployed to the specified deployment.

Notable Exceptions

Deployment vs Model Distinction

It's important to understand the distinction between ML Models and ML Model Deployments:

  • ML Model: Represents the trained model artifact, including training data, metrics, hyperparameters, and model metadata. A model can have multiple versions and can exist independently of any deployment.

  • ML Model Deployment: Represents a running instance of a model serving predictions. A deployment references a specific model version and includes operational metadata like status, configuration, and serving platform details.

This separation enables:

  • Tracking the same model deployed to multiple environments (dev, staging, prod)
  • Understanding deployment history and rollbacks
  • Managing the operational lifecycle independently from model development
  • Supporting A/B testing and canary deployments of the same model

Multiple Deployments per Model

A single ML model can have multiple deployments simultaneously:

  • Different environments (production, staging, development)
  • Different regions (US, EU, Asia)
  • Different configurations (batch vs real-time, different instance types)
  • A/B testing scenarios (challenger vs champion)

Each deployment is tracked as a separate entity with its own metadata.

Ephemeral Deployments

Some platforms create temporary or ephemeral deployments (e.g., for batch inference jobs). These deployments may have short lifespans but are still valuable to track for:

  • Cost attribution
  • Compliance and audit trails
  • Understanding model usage patterns
  • Debugging and troubleshooting

Platform-Specific Deployment Concepts

Different ML platforms have varying concepts that map to deployments:

  • SageMaker Endpoints: Real-time inference endpoints with one or more model variants
  • Azure ML Online Endpoints: Managed endpoints with blue-green deployment support
  • Vertex AI Endpoints: Deployed models with traffic splitting capabilities
  • Kubernetes Inference Services: Pod-based model serving with auto-scaling

DataHub's deployment model abstracts these platform differences while preserving important platform-specific details in custom properties.

ML Model Deployments frequently interact with these other DataHub entities:

  • MLModel: The underlying trained model that is deployed
  • MLModelGroup: A collection of related models that may share deployment infrastructure
  • DataPlatform: The platform hosting the deployment (SageMaker, Azure ML, etc.)
  • Container: The workspace, namespace, or project containing the deployment
  • CorpUser / CorpGroup: Owners and operators of the deployment
  • Tag: Classification and organizational tags
  • DataPlatformInstance: The specific instance of the deployment platform

Technical Reference Guide

The sections above provide an overview of how to use this entity. The following sections provide detailed technical information about how metadata is stored and represented in DataHub.

Aspects are the individual pieces of metadata that can be attached to an entity. Each aspect contains specific information (like ownership, tags, or properties) and is stored as a separate record, allowing for flexible and incremental metadata updates.

Relationships show how this entity connects to other entities in the metadata graph. These connections are derived from the fields within each aspect and form the foundation of DataHub's knowledge graph.

Reading the Field Tables

Each aspect's field table includes an Annotations column that provides additional metadata about how fields are used:

  • ⚠️ Deprecated: This field is deprecated and may be removed in a future version. Check the description for the recommended alternative
  • Searchable: This field is indexed and can be searched in DataHub's search interface
  • Searchable (fieldname): When the field name in parentheses is shown, it indicates the field is indexed under a different name in the search index. For example, dashboardTool is indexed as tool
  • → RelationshipName: This field creates a relationship to another entity. The arrow indicates this field contains a reference (URN) to another entity, and the name indicates the type of relationship (e.g., → Contains, → OwnedBy)

Fields with complex types (like Edge, AuditStamp) link to their definitions in the Common Types section below.

Aspects

mlModelDeploymentKey

Key for an ML model deployment

FieldTypeRequiredDescriptionAnnotations
platformstringStandardized platform urn for the model Deployment
namestringName of the MLModelDeploymentSearchable
originFabricTypeFabric type where model Deployment belongs to or where it was generatedSearchable

mlModelDeploymentProperties

Properties associated with an ML Model Deployment

FieldTypeRequiredDescriptionAnnotations
customPropertiesmapCustom property bag.Searchable
externalUrlstringURL where the reference existSearchable
descriptionstringDocumentation of the MLModelDeploymentSearchable
createdAtlongDate when the MLModelDeployment was developed
versionVersionTagVersion of the MLModelDeployment
statusDeploymentStatusStatus of the deploymentSearchable (deploymentStatus)

ownership

Ownership information of an entity.

FieldTypeRequiredDescriptionAnnotations
ownersOwner[]List of owners of the entity.
ownerTypesmapOwnership type to Owners map, populated via mutation hook.Searchable
lastModifiedAuditStampAudit stamp containing who last modified the record and when. A value of 0 in the time field indi...

status

The lifecycle status metadata of an entity, e.g. dataset, metric, feature, etc. This aspect is used to represent soft deletes conventionally.

FieldTypeRequiredDescriptionAnnotations
removedbooleanWhether the entity has been removed (soft-deleted).Searchable

deprecation

Deprecation status of an entity

FieldTypeRequiredDescriptionAnnotations
deprecatedbooleanWhether the entity is deprecated.Searchable
decommissionTimelongThe time user plan to decommission this entity.
notestringAdditional information about the entity deprecation plan, such as the wiki, doc, RB.
actorstringThe user URN which will be credited for modifying this deprecation content.
replacementstring

globalTags

Tag aspect used for applying tags to an entity

FieldTypeRequiredDescriptionAnnotations
tagsTagAssociation[]Tags associated with a given entitySearchable, → TaggedWith

dataPlatformInstance

The specific instance of the data platform that this entity belongs to

FieldTypeRequiredDescriptionAnnotations
platformstringData PlatformSearchable
instancestringInstance of the data platform (e.g. db instance)Searchable (platformInstance)

testResults

Information about a Test Result

FieldTypeRequiredDescriptionAnnotations
failingTestResult[]Results that are failingSearchable, → IsFailing
passingTestResult[]Results that are passingSearchable, → IsPassing

container

Link from an asset to its parent container

FieldTypeRequiredDescriptionAnnotations
containerstringThe parent container of an assetSearchable, → IsPartOf

Common Types

These types are used across multiple aspects in this entity.

AuditStamp

Data captured on a resource/association/sub-resource level giving insight into when that resource/association/sub-resource moved into a particular lifecycle stage, and who acted to move it into that specific lifecycle stage.

Fields:

  • time (long): When did the resource/association/sub-resource move into the specific lifecyc...
  • actor (string): The entity (e.g. a member URN) which will be credited for moving the resource...
  • impersonator (string?): The entity (e.g. a service URN) which performs the change on behalf of the Ac...
  • message (string?): Additional context around how DataHub was informed of the particular change. ...

TestResult

Information about a Test Result

Fields:

  • test (string): The urn of the test
  • type (TestResultType): The type of the result
  • testDefinitionMd5 (string?): The md5 of the test definition that was used to compute this result. See Test...
  • lastComputed (AuditStamp?): The audit stamp of when the result was computed, including the actor who comp...

Relationships

Outgoing

These are the relationships stored in this entity's aspects

  • OwnedBy

    • Corpuser via ownership.owners.owner
    • CorpGroup via ownership.owners.owner
  • ownershipType

    • OwnershipType via ownership.owners.typeUrn
  • TaggedWith

    • Tag via globalTags.tags
  • IsFailing

    • Test via testResults.failing
  • IsPassing

    • Test via testResults.passing
  • IsPartOf

    • Container via container.container

Incoming

These are the relationships stored in other entity's aspects

  • DeployedTo

    • MlModel via mlModelProperties.deployments

Global Metadata Model

Global Graph