Databricks-ML-Pro ML Ops Practice Question
A machine learning engineer is using Databricks Model Serving to deploy a model that requires a custom Python library not available in the default environment. The engineer wants to ensure the endpoint uses the exact library version and that the deployment is reproducible. Which approach should the engineer take?
⚠ Common exam trap
The trap here is assuming that libraries installed on a training cluster or via init scripts will carry over to the serverless Model Serving environment, which is not the case.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Package the custom library as a Python wheel and include it in the model's conda environment or requirements file when logging the model with MLflow.
To ensure a custom library is available and reproducible in Databricks Model Serving, it must be included as a dependency when logging the MLflow model. Packaging the library as a wheel and adding it to the conda environment or requirements file ensures that Model Serving installs the exact version during deployment. This is the supported and recommended practice.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Install the custom library on all driver and worker nodes of the cluster used for model training, then deploy the model to Model Serving.
Why it's wrong here
Installing libraries on the training cluster does not affect the Model Serving environment. Model Serving runs in a separate, managed environment and does not inherit cluster libraries. This approach would not make the library available at inference time, so the deployment would fail or use a different version.
- ✗
Use the Databricks REST API to upload the library to the Model Serving endpoint after deployment, then restart the endpoint.
Why it's wrong here
Databricks Model Serving does not support uploading arbitrary libraries to a running endpoint via REST API. The environment is defined at deployment time based on the model's dependencies. This approach is not supported and would not provide a reproducible environment.
- ✓
Package the custom library as a Python wheel and include it in the model's conda environment or requirements file when logging the model with MLflow.
Why this is correct
MLflow models can capture dependencies via a conda environment or requirements file. By packaging the custom library as a wheel and including it in the model's environment specification, Databricks Model Serving will install that exact version when deploying the model. This ensures reproducibility and availability of the custom library at inference time.
- ✗
Create an init script that installs the custom library on the Model Serving cluster, and attach it to the endpoint configuration.
Why it's wrong here
Databricks Model Serving is a serverless offering and does not expose cluster configuration or init scripts. Users cannot attach init scripts to a serving endpoint. Therefore, this method is not applicable and would not install the library in the serving environment.
About these practice questions
One of 300 original Databricks-ML-Pro practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-ML-Pro practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-ML-Pro exam.