Databricks-ML-Pro Model Deployment Practice Question
A team is deploying a model that requires custom Python libraries not available in the default Databricks Runtime. Which TWO methods can be used to ensure these dependencies are available in the Model Serving environment? (Select TWO)
⚠ Common exam trap
Test-takers often think installing libraries directly in the serving endpoint settings or cluster configuration is sufficient, forgetting that dependencies must be captured during model logging.
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
✓
Include a 'requirements.txt' file or a 'conda.yaml' when calling mlflow.log_model().
Model Serving environments are reconstructed based on the metadata captured when the model was logged. To include custom libraries, they must be explicitly defined during the logging process. This ensures that the production environment exactly matches the development environment, preventing 'missing module' errors during real-time inference requests.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Include a 'requirements.txt' file or a 'conda.yaml' when calling mlflow.log_model().
Why this is correct
Providing a requirements file or Conda environment during logging tells MLflow exactly which packages and versions are needed. When the model is deployed to an endpoint, Databricks uses this information to build a container image with all the necessary dependencies pre-installed and ready for execution.
- ✗
Manually install the libraries on the driver node of the cluster used for training.
Why it's wrong here
Libraries installed on a training cluster are not automatically transferred to the Model Serving endpoint. The endpoint runs on a separate, managed infrastructure that only knows about dependencies that were formally recorded in the model's MLflow metadata during the logging phase of the lifecycle.
- ✓
Use the pip_requirements parameter in the mlflow.sklearn.log_model (or similar) function.
Why this is correct
The pip_requirements parameter is a convenient way to pass a list of strings representing the needed libraries directly in the code. This ensures that the information is captured in the MLflow model flavor's metadata, which the serving infrastructure then uses to provision the correct environment.
- ✗
Add the libraries to the Spark configuration of the Model Serving endpoint.
Why it's wrong here
Model Serving endpoints do not expose Spark configuration settings for library management. They are designed as lightweight, containerized services for low-latency inference, and they rely on MLflow's standard environment logging mechanisms rather than cluster-level Spark configurations used in batch processing environments.
- ✗
Upload the wheel files to a DBFS location and reference them in the endpoint UI.
Why it's wrong here
The Model Serving UI does not provide a mechanism to manually link wheel files or external libraries. All environment definitions must be part of the model version being served, ensuring that the model is a self-contained unit that can be moved across different environments reliably.
About these practice questions
Courseiva writes every Databricks-ML-Pro question from scratch — 300 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.