mlflow/mlflow · error · NotImplementedError

This method is not implemented for `OpenAIDeploymentClient`.

Error message

This method is not implemented for `OpenAIDeploymentClient`.

What it means

The OpenAI deployment plugin only supports prediction against OpenAI routes; per-deployment CRUD operations are intentionally unimplemented and raise NotImplementedError. create_deployment has no meaning for OpenAI-backed endpoints.

Source

Thrown at mlflow/deployments/openai/__init__.py:54

        client = get_deploy_client("openai")
        client.predict(
            endpoint="gpt-4o-mini",
            inputs={
                "messages": [
                    {"role": "user", "content": "Hello!"},
                ],
            },
        )
    """

    def create_deployment(self, name, model_uri, flavor=None, config=None, endpoint=None):
        """
        .. warning::

            This method is not implemented for `OpenAIDeploymentClient`.
        """
        raise NotImplementedError

    def update_deployment(self, name, model_uri=None, flavor=None, config=None, endpoint=None):
        """
        .. warning::

            This method is not implemented for `OpenAIDeploymentClient`.
        """
        raise NotImplementedError

    def delete_deployment(self, name, config=None, endpoint=None):
        """
        .. warning::

            This method is not implemented for `OpenAIDeploymentClient`.
        """
        raise NotImplementedError

    def list_deployments(self, endpoint=None):

View on GitHub (pinned to 6a27f2decc)

Solutions

  1. Use create_endpoint/update_endpoint on the OpenAI client (which is how routes are configured), or create the deployment via the MLflow deployments server config.
  2. Use predict() against an existing route.
  3. Catch NotImplementedError and branch per target capability.

Example fix

// before
client = mlflow.deployments.get_deploy_client("openai")
client.create_deployment("gpt-4", "models:/gpt-4/1")
// after
client = mlflow.deployments.get_deploy_client("openai")
client.create_endpoint("gpt-4-endpoint", config={"name": "gpt-4", ...})
Defensive patterns

Strategy: validation

Validate before calling

if isinstance(client, mlflow.deployments.openai.OpenAIDeploymentClient):
    raise RuntimeError("create_deployment unsupported for openai target; use create_endpoint")

Type guard

def supports_deployment_crud(client):
    from mlflow.deployments.openai import OpenAIDeploymentClient
    return not isinstance(client, OpenAIDeploymentClient)

Try / catch

try:
    client.create_deployment(name, model_uri)
except NotImplementedError:
    client.create_endpoint(name, config={...})

Prevention

When it happens

Trigger: Calling OpenAIDeploymentClient.create_deployment(name, model_uri[, flavor, config, endpoint]).

Common situations: Generic deployment scripts written for the sagemaker plugin reused with target='openai'; attempts to register model URIs as OpenAI deployments.

Related errors


AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29). Data as JSON: /api/errors/69bd1f2a34d9eae8. Report an issue: GitHub.