A model needs custom preprocessing and post-processing logic around predict. How do you serve it on Model Serving?
- Exam domain
- Model Deployment and Monitoring13% of the exam
- Difficulty
- Medium
- In this mock
- 6 questions on this domainPractise this domain
Why the exam asks this
Model Deployment and Monitoring (13% of the exam)
Objective in the exam guide: Deploy a custom model to a model endpoint
Deploying a custom model is named.
Why A is the answer
Wrap it as an MLflow pyfunc model, register it and serve it
A custom pyfunc model packages arbitrary Python logic with its environment. Registered in Unity Catalog, it can be deployed to Model Serving.
Remember: pyfunc packages custom logic.
How it works
MLflow pyfunc models carry custom inference code.
In detail
- pyfunc for custom logic.
- Register, then serve.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Wrap it as an MLflow pyfunc model, register it and serve itRight
pyfunc packages custom logic.
B. Paste the code into the endpoint's description fieldWrong
Descriptions are not code.
C. Serve the raw pickle file without MLflowWrongMost tempting
Model Serving serves MLflow models.
Why it tempts: Pickles are common, but serving expects MLflow models.
D. Run it on the driver of an all-purpose clusterWrong
A cluster driver is not a serving endpoint.
Use case
An illustrative scenario, not a real incident.
Illustrative: a pyfunc wraps text cleaning and a classifier into one served model.
See it in different ways
flowchart LR S0["Write PythonModel"] --> S1["log_model"] --> S2["Register in Unity Catalog"] --> S3["Create endpoint"]
How to read this chart
- Read it in order: Write PythonModel, then log_model, then Register in Unity Catalog, then Create endpoint.
sequenceDiagram participant P0 as Data scientist participant P1 as Unity Catalog participant P2 as Model Serving P0->>P1: register pyfunc model P2-->>P1: pull version P2-->>P0: endpoint ready
How to read this chart
- 1. Data scientist sends "register pyfunc model" to Unity Catalog.
- 2. Unity Catalog gets a reply from Model Serving: "pull version".
- 3. Data scientist gets a reply from Model Serving: "endpoint ready".