Courseiva
Application Development →easyMultiple Choice

Databricks-GenAI-Assoc Application Development Practice Question

A developer is packaging a GenAI chat application as an MLflow model that will be deployed to a Mosaic AI Model Serving endpoint. The application needs to load a retrieval index and a prompt template at startup so the first request is not slowed by initialization. Which MLflow logging pattern should the developer use?

⚠ Common exam trap

The trap here is assuming that serving platforms automatically warm up custom resources, when in fact the model author must initialize them in load_context.

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

✓

Log the application with mlflow.pyfunc.log_model and perform the heavy initialization in the model's load_context method so resources are ready before predict is called.

MLflow's PyFunc flavor calls load_context when the model is loaded, which happens before the endpoint begins serving requests. Initializing the retrieval index and prompt template there ensures they are ready once per replica and reused across calls. Loading inside predict or fetching resources per request would add latency, and a signature alone cannot prepare application state.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Log the application with mlflow.pyfunc.log_model and perform the heavy initialization in the model's load_context method so resources are ready before predict is called.

    Why this is correct

    MLflow's PyFunc flavor invokes load_context when the model is loaded into the serving process, before any predict call. Placing index and template initialization there ensures the endpoint pays the cost once per replica, and subsequent requests reuse the loaded objects. This is the documented pattern for stateful resources in MLflow models deployed to Mosaic AI Model Serving.

  • ✗

    Use mlflow.pyfunc.log_model with a signature only, and rely on the serving environment's default warm-up to populate the index and template automatically.

    Why it's wrong here

    A signature describes input and output schemas; it does not load application resources. There is no automatic warm-up that populates arbitrary indexes or templates for a custom PyFunc model. Without explicit initialization logic, the first request would trigger loading, contradicting the goal of startup-time preparation.

  • ✗

    Log only the prompt template as an artifact and let the Model Serving endpoint fetch the index from Unity Catalog on each request.

    Why it's wrong here

    Fetching the index per request reintroduces the latency the scenario wants to avoid and adds network dependency on every call. Logging only the template also omits the application code needed to run inference. This approach does not prepare resources at startup, so it fails the stated requirement.

  • ✗

    Log the application with mlflow.pyfunc.log_model and load the index and template inside the predict function on every request.

    Why it's wrong here

    Loading the index and template inside predict repeats expensive initialization for every call, which inflates latency and can exhaust memory on a shared endpoint. The scenario explicitly wants startup-time loading so the first request is not slowed. This pattern also conflicts with how Model Serving expects resources to be prepared once per replica.

About these practice questions

This Databricks-GenAI-Assoc question is part of Courseiva's 330-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-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.