Courseiva
Model Deployment →hardMultiple Choice

Databricks-ML-Pro Model Deployment Practice Question

An ML engineer is deploying a model to Databricks Model Serving that requires a custom Python package. The package is not available in the default environment and must be installed from a private PyPI repository. Which method ensures the package is available to the model at serving time?

⚠ Common exam trap

The trap here is assuming that notebook-level installations or cluster init scripts carry over to the serving environment, which is isolated and built from the model's environment 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

✓

Specify the package's index URL and credentials in the model's conda environment file, and ensure the serving endpoint has network access to the private repository.

To use a private PyPI repository, the model's conda environment must include the index URL and credentials. Databricks Model Serving builds the environment based on this specification, provided it has network access to the repository. This ensures the custom package is installed and available during inference.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Add the package to the cluster's init script and ensure the cluster is attached to the serving endpoint.

    Why it's wrong here

    Model Serving endpoints do not use clusters; they run in a managed, serverless environment. Init scripts are not applicable, and you cannot attach a cluster to a serving endpoint. This approach is invalid for Model Serving and would not make the package available.

  • ✗

    Include the package as a wheel file in the model's artifact directory and reference it in the model's conda environment.

    Why it's wrong here

    Including the wheel file in the artifact directory and referencing it in the conda environment is not supported for Model Serving. The serving environment builds dependencies from the conda environment specification, which typically pulls from public repositories. Private repositories require additional authentication that is not handled by simply bundling the wheel; the environment build would fail to resolve the dependency.

  • ✗

    Upload the package to DBFS and use a %pip install command in a notebook before deploying the model.

    Why it's wrong here

    Using %pip install in a notebook only affects the notebook's cluster, not the serving environment. The package would not be available at serving time because the serving endpoint builds its own isolated environment. This approach does not persist dependencies for deployment.

  • ✓

    Specify the package's index URL and credentials in the model's conda environment file, and ensure the serving endpoint has network access to the private repository.

    Why this is correct

    Databricks Model Serving allows you to specify a custom index URL and credentials in the conda environment file (e.g., via pip_requirements or conda_env). The serving environment must have network access to the private repository. This method securely installs the package from the private PyPI repository during environment build.

About these practice questions

This Databricks-ML-Pro question is part of Courseiva's 300-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.