The .get_model_deployment_state() method of the ModelDeployer class accepts a model deployment OCID and returns an enum state. This is a convenience method to obtain the model deployment state when the model deployment OCID is known.

from ads.model.deployment import ModelDeployer

deployer = ModelDeployer()


You can determine the state of the model deployment using the attribute of a ModelDeployment object. This returns a string with values like ‘ACTIVE’, ‘INACTIVE’, and ‘FAILED’.

In the following code snippets, the variable deployment is a ModelDeployment object. This object can be obtained from a call to .deploy() or .get_model_deployment().