Which code queries a Model Serving endpoint with the MLflow Deployments SDK?
- Exam domain
- Model Deployment12% of the exam
- Difficulty
- Medium
- In this mock
- 6 questions on this domainPractise this domain
Why the exam asks this
Model Deployment (12% of the exam)
Objective in the exam guide: Query custom models via REST API or MLflow Deployments SDK.
Querying custom models is named.
Why A is the answer
get_deploy_client("databricks").predict(endpoint="churn", inputs={"dataframe_records": rows})
The Deployments SDK client for Databricks queries endpoints with predict. The REST API at the invocations URL is the other option.
Remember: Deployments SDK or REST.
How it works
Endpoints can be queried by REST or the Deployments SDK.
In detail
- get_deploy_client("databricks").
- Or REST invocations.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. get_deploy_client("databricks").predict(endpoint="churn", inputs={"dataframe_records": rows})Right
Deployments SDK or REST.
B. spark.read.endpoint("churn")Wrong
There is no such reader.
C. mlflow.log_model("churn").predict()Wrong
log_model does not query.
D. mlflow.pyfunc.load_model("endpoint").predict(df), which calls the remote endpoint over HTTPWrongMost tempting
load_model loads locally; it does not call the endpoint.
Why it tempts: load_model is the usual MLflow call.
Use case
An illustrative scenario, not a real incident.
Illustrative: a batch notebook calls the endpoint through the Deployments SDK for a spot check.
See it in different ways
sequenceDiagram participant P0 as App participant P1 as Deployments client participant P2 as Endpoint P0->>P1: predict inputs P1->>P2: HTTPS request P2-->>P0: predictions
How to read this chart
- 1. App sends "predict inputs" to Deployments client.
- 2. Deployments client sends "HTTPS request" to Endpoint.
- 3. App gets a reply from Endpoint: "predictions".
mindmap
root(("Query"))
n1["REST"]
n2["POST invocations"]
n3["MLflow Deployments SDK"]
n4["client.predict"]How to read this chart
- The centre is "Query".
- "REST" covers "POST invocations".
- "MLflow Deployments SDK" covers "client.predict".