Sub topic 7
What Model Serving provides
This chapter explains what Databricks Model Serving does and which parts of the work it handles for you. It assumes you can train a scikit-learn model, you have used a Databricks workspace and notebooks, and you know what a REST API and a JSON request are. You don't need to create anything yet. The next chapter builds an endpoint.
The problem it solves
A trained model in a notebook is only useful to you. An application needs a stable HTTP address it can call with input data and get predictions back. Building that yourself means packaging the model with its dependencies, running it in a container, putting a web server in front of it, adding authentication, scaling it with traffic, and collecting logs.
Model Serving is the Databricks service that does this for you. You point it at a model, and it gives you a managed REST endpoint.
What you get
A serving endpoint is a named, managed deployment of one or more models. Databricks provides the following.
| Capability | What it means for you |
|---|---|
| Managed compute | Databricks builds a container from the model's logged dependencies and runs it. You don't manage servers. |
| REST interface | Each endpoint has an invocations URL of the form `/serving-endpoints/<name>/invocations`. |
| Autoscaling | Capacity grows and shrinks with request volume, within the workload size you choose. |
| Scale to zero | An idle endpoint can release its compute. The first request after idle is slower. |
| Authentication | Requests must carry a credential, such as a personal access token or an OAuth token. |
| Governance | Models served from Unity Catalog use the same privileges and lineage as other Unity Catalog objects. |
| Observability | Each endpoint has events, logs and metrics you can inspect. |
Later chapters cover compute settings, authentication and monitoring in detail. For now, treat them as features of the service.
What you can serve
Model Serving handles three kinds of endpoints. This tutorial covers only the first.
- Custom models: models you logged with MLflow, such as the scikit-learn classifier used in this tutorial.
- Foundation model endpoints: large language models hosted by Databricks.
- External models: models hosted by another provider, called through a Databricks endpoint so access stays in one place.
How it fits the workflow
Serving depends on the earlier steps in this tutorial. The endpoint needs a model that was logged with MLflow. The model needs a signature, so the service knows what input to expect. It must also be registered under a three-level name in Unity Catalog. Versions and aliases then identify exactly which model the endpoint runs.
Because the endpoint reads from the registry, the person who creates it needs the right privileges on the model. The chapter on granting privileges covers this. A missing privilege is one of the most common reasons endpoint creation fails.
Things to expect
A few behaviors surprise people the first time they use the service.
- Creating an endpoint is not instant. Databricks builds the container and starts the compute, which can take several minutes. That is why the SDK offers a create-and-wait call.
- An endpoint serves a fixed model version. Registering a new version does not change a running endpoint. You update the endpoint yourself, which a later chapter covers.
- With scale to zero, the first request after an idle period is slower while compute starts. Expect this latency for rarely used endpoints.
- The input shape matters. A request whose columns or types don't match the model's signature is rejected. Errors of this kind come back as HTTP error responses, not as bad predictions.
What comes next
The following chapters follow the order of the workflow. You will create an endpoint from a registered model version, choose its compute settings, authenticate, send requests, roll it forward to a new version, and troubleshoot failures.
Exercise
A teammate registered version 2 of a model in Unity Catalog while an endpoint was already serving version 1. They then sent requests to the endpoint and still got version 1 predictions. Why, and what has to happen for version 2 to be served?
Show answer
An endpoint serves the specific model version it was configured with. Registering a new version doesn't change a running endpoint. The endpoint configuration has to be updated to point at version 2, and then the service rolls the endpoint forward.