Databricks-GenAI-Assoc Assembling and Deploying Apps Practice Question
An engineer is preparing to deploy a Mosaic AI Agent to a Model Serving endpoint. The agent depends on a custom Python library that is not available on PyPI. Which approach ensures the library is available at serving time?
⚠ Common exam trap
The trap here is assuming that installing a library on a development cluster will carry over to the serving endpoint, when serving environments are built solely from the logged model's dependency specification.
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 the library as a wheel file in the MLflow model's requirements or artifacts so it is installed in the serving environment.
Model Serving builds its container from the MLflow model's declared environment, so custom libraries must be packaged as artifacts and referenced in the model's requirements. This ensures the dependency is installed in the serving environment and the agent can import it reliably.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Copy the library source into the notebook that defines the agent and rely on the notebook's sys.path.
Why it's wrong here
Notebook-local code and sys.path modifications are not carried into the serving container. The endpoint builds from the logged MLflow model, so any library code that is not packaged as part of the model artifacts or declared as a dependency will not be present at inference time.
- ✗
Install the library manually on the driver node of the cluster used to log the model.
Why it's wrong here
Installing a library on a cluster driver affects only that cluster's runtime, not the Model Serving container. The serving environment is built independently from the model's declared dependencies, so a manual driver install does not persist to the endpoint and the agent will fail to import the library.
- ✗
Add the library to the workspace's global init script so all clusters install it at startup.
Why it's wrong here
Global init scripts apply to interactive and job clusters, not to Model Serving endpoints. Model Serving containers are built from the model's environment specification, so an init script does not influence the serving environment and the custom library will be missing.
- ✓
Include the library as a wheel file in the MLflow model's requirements or artifacts so it is installed in the serving environment.
Why this is correct
MLflow models capture their Python dependencies, and Model Serving builds the container using those dependencies. Including the custom wheel as an artifact and referencing it in the model's requirements ensures the library is installed in the serving environment, making it available to the agent at inference time.
About these practice questions
One of 330 original Databricks-GenAI-Assoc 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-GenAI-Assoc 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-GenAI-Assoc exam.