Skip to content

[ML] Check for model deployment in inference endpoints before stopping #129325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

davidkyle
Copy link
Member

It is possible to use the ml stop trained model API to stop a deployment used by an inference endpoint, this breaks the endpoint and it can no longer be used for inference. This PR adds a check to the ml stop API (_ml/trained_models/x/deployment/_stop) and rejects the request if deployment is used by or managed by an inference endpoint. The force options overrides this check.

If an inference endpoint is broken because it's model has been stopped then the to fix it is to redeploy the model using the inference endpoint Id as the deployment Id.

There are 2 cases to check for:

  • The deployment was created by the inference endpoint
  • The inference endpoint was created by using an existing deployment

In both case the stop deployment request will fail unless the force parameter is used.

Closes #128549

@davidkyle davidkyle added >bug :ml Machine learning auto-backport Automatically create backport pull requests when merged v8.19.0 v9.1.0 v9.0.3 v8.18.3 labels Jun 12, 2025
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Jun 12, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine
Copy link
Collaborator

Hi @davidkyle, I've created a changelog YAML for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :ml Machine learning Team:ML Meta label for the ML team v8.18.4 v8.19.0 v9.0.4 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Stopping a model deployment does not check if it is used by an inference endpoint
3 participants