Deploy and test a model

Create an endpoint, choose its access mode, send a test prediction and call it from code.

A deployment is a live prediction endpoint. It serves one model version at a stable address, counts every prediction, and lets you test, monitor and roll back from one page. This page shows how to create an endpoint, test it in the app and call it from your own code.

To deploy, you need an editor role or higher in the workspace. Members with a read-only role can look at deployments but cannot create, delete or roll them back.

Deploy the best model of a run

Open the run

Open your project, select Runs, and open a run that has finished. Training must have succeeded and produced at least one model. Baseline models are reference points only and cannot be deployed.

Select Deploy best model

In the run header, select Deploy best model. A dialog opens with three tabs: Download, Deploy anywhere and Monitor it. Open Deploy anywhere and select Deploy on mlflow. The other cards in this tab create kits for your own infrastructure; see Deploy anywhere.

You can also deploy a different candidate. Open a model candidate from the leaderboard and use its Deploy & export tab, which has the same three tabs.

Confirm the promotion

If the model is not yet a pipeline version, a dialog titled Promote and deploy appears. It explains that deploying first creates a pipeline version (and a registry version) from the model, and then asks for the endpoint details. Select Promote and continue.

Name the endpoint

In the dialog titled Deploy followed by the model name, enter an Endpoint slug and select Deploy. The slug is filled in from the model name; change it if you like. The access mode is hidden under Access control and defaults to workspace members. See Endpoint slug and access mode.

When the deployment is created, mlflow opens its page.

Deploy a registered version

If you manage models in the registry, deploy a specific version instead.

  1. Select Models and open a registered model.
  2. In the version list, select Deploy on the version you want. The dialog is titled Deploy v followed by the version number.
  3. Enter an Endpoint slug, choose an Auth mode and select Deploy.

A deployment created from the registry remembers which version it serves. See Register and manage models for versions, statuses and approvals.

Access modes in the registry dialog

In this dialog the options api-key and public carry the suffix "(V2)". The server accepts all three modes and they behave as described below. If you want clearer labels, deploy from a run: its dialog names the options Workspace (member token), API key and Public (any signed-in user).

Endpoint slug and access mode

Endpoint slug. The slug is the name of the endpoint in its address. Rules:

  • 3 to 64 characters: lowercase letters, digits and dashes.
  • It must start and end with a letter or a digit.
  • It must be unique across the whole server, not only in your workspace. If it is taken, the dialog shows an error and you choose another.
  • You cannot rename an endpoint. To use a different slug, deploy again.

The endpoint address is POST /api/v1/deployments/<slug>/predict.

Access mode. The access mode decides who may call the endpoint:

ModeWho can call it
Workspace members (default)Signed-in members of the workspace, with a session or an API key. Everyone else gets "not found".
API keyAnyone holding an API key of a workspace member, sent in X-API-Key. The key needs the predict scope. Without a key the call is refused with 401; with a key that lacks the scope, 403.
PublicAnyone on the internet, with no credentials. Only a workspace admin can choose this mode.

Public means anyone with the URL

Public endpoints need no account and no key. Calls from outside the workspace are rate limited per client address, and they do not appear in your prediction log or your monitoring, so strangers cannot read your traffic or change your drift baseline. For a service that calls your model, prefer the API key mode with a key that has the predict scope; see API keys and scopes.

Test a prediction

Open the deployment and select the Test tab. The card Test a prediction is filled in for you.

Check the rows

The box Rows (JSON array) holds one example row taken from the data the model was trained on. The hint below it says how many features the model expects and which target column is excluded. Each row is an object whose keys are the column names used in training. You can edit the values or add more rows.

Send the request

Select Send request. While it runs, the button reads Predicting….

Read the response

The Response area shows the latency in milliseconds and the request ID, then a table with one Prediction per row. For classification models it also shows the probability of each class, titled P(class).

If the JSON is not an array of objects, the box shows the parse error and the button stays disabled. If a column is missing or holds the wrong kind of value, the response shows the error from the model instead of predictions.

The same tab holds Batch predict, which scores a whole file. See Batch predictions.

Use the endpoint from anywhere

Every deployment has one stable address that works from any machine, with no browser session:

https://app.mlflow.es/api/v1/deployments/<slug>/predict

Open the deployment and look at the Use this endpoint card on the Overview tab. It shows the full URL, the method, what the deployment's access mode requires, and copy-ready snippets for curl, Python and JavaScript. The example rows use the real column names of your model, with a sample row from its training data. On a self-hosted server the URL starts with your server's public address instead.

In API key mode, select Create API key with predict scope on that card. The key is shown once, and it is already filled into the snippets. A predict key can only call predictions; it cannot read or change anything else.

Browsers on any origin may call endpoints in API key and public mode (CORS is open for the predict address only, and cookies are not sent). Workspace endpoints answer only to the app itself. The request and response schema is in the OpenAPI document under POST /deployments/{endpoint_slug}/predict.

Call the endpoint

Send a JSON body with a rows list. Except for public endpoints, every request needs credentials: a session token or, for code, an API key in the X-API-Key header.

POST/api/v1/deployments/{slug}/predict
bash
curl -s https://app.mlflow.es/api/v1/deployments/churn-prod/predict \
  -H "X-API-Key: $MLFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rows": [{"tenure": 14, "plan": "basic", "monthly_charges": 53.5}]}'

A successful response looks like this. The values are an example.

json
{
  "deployment_id": "0b6f...",
  "endpoint_slug": "churn-prod",
  "predictions": [
    {"index": 0, "prediction": "yes", "probabilities": {"no": 0.31, "yes": 0.69}}
  ],
  "latency_ms": 12.4,
  "request_id": "7c1d..."
}

probabilities appears only for models that can score classes.

Common errors:

StatusMeaning
400The body has no non-empty rows list, or the model could not predict on the rows (the message says why).
401No credentials were sent to an endpoint that needs them, or the key is invalid, expired or revoked.
403The key lacks the predict scope, or it is bound to another workspace.
404The slug does not exist, or you cannot see it.
409The deployment is not active, so it cannot serve.
429Too many calls from outside the workspace to a public endpoint. Wait for the Retry-After time.

A stable address for the production version

If the model is in the registry, you can call the version that is currently in production without knowing the slug:

POST /api/v1/inference/<workspace_id>/<model_name>/predict

The body is the same. When you promote a new version to production and deploy it, clients keep using the same address. The call answers "not found" until an active deployment serves the production version.

Versions and rollback

Open the Versions tab to see every version of the model behind the deployment: its number, model, creation date and the SHA-256 fingerprint of its file. The version being served is marked active.

To go to another version, select Rollback to v and the number, then confirm. The endpoint keeps its slug and access mode and starts serving the chosen version on the next request. This restarts the drift baseline, because a different model is now serving.

New versions appear here when you promote a run under the same model name as the current one. If only one version exists, the tab says so and offers no rollback.

The Deployments list

Select Deployments in the sidebar to see every endpoint in the workspace. The Endpoints tab lists, for each deployment:

ColumnMeaning
EndpointThe slug.
StatusActive, Paused or Archived. Only active deployments serve predictions.
AccessThe access mode.
Predictions and ErrorsTotals since the deployment was created.
p50 and p95Typical and slow latency, measured over the last 100 predictions.
Last predictionWhen the endpoint was last called.

The Health tab shows alert rules, metrics and drift; see Drift and alerts. Select Deploy a model to open the registry and pick a version.

On a deployment, the Overview tab shows the same counters and the latest requests under Recent predictions (all, successful or errors), plus the deployment, workspace and pipeline IDs. The overflow menu has Delete, which removes the endpoint but not the model behind it. The Monitor tab is covered in Drift and alerts and Retraining.

Next steps

Learn the theory

Lessons on learning.mlflow.es that explain the ideas behind this page.

Updated 2026-11-23