Courseiva
Design Applications →mediumMultiple Choice

Databricks-GenAI-Assoc Design Applications Practice Question

Exhibit

import mlflow
mlflow.set_tracking_uri("databricks")
# Code missing here
model = mlflow.pyfunc.load_model("models:/my_model/1")

Refer to the exhibit. What is the correct way to log a custom RAG chain so it can be loaded using the provided code?

⚠ Common exam trap

Candidates often confuse 'log_model' with 'save_model' or try to log raw files manually. Using 'mlflow.pyfunc.log_model' is the specific standard for capturing custom RAG chains as deployable artifacts.

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

✓

mlflow.pyfunc.log_model(artifact_path="my_model", python_model=my_chain_object)

To load a custom chain using the 'models:/' URI, the chain must be logged as an MLflow model. Using 'mlflow.pyfunc.log_model' with the appropriate artifact parameters allows the entire RAG pipeline—retrieval logic, prompt handling, and LLM inference—to be captured as a single deployable unit. This ensures consistency between local development and production serving environments.

Answer analysis

Option-by-option breakdown

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

  • ✗

    mlflow.log_artifact(local_path="chain.py")

    Why it's wrong here

    Logging a file as an artifact is not the same as logging it as a model. While the code might be saved, it cannot be loaded using the 'pyfunc.load_model' interface, which expects a specific model structure and metadata to enable serving and inference capabilities in Databricks.

  • ✓

    mlflow.pyfunc.log_model(artifact_path="my_model", python_model=my_chain_object)

    Why this is correct

    This method correctly logs a custom Python object (the RAG chain) as an MLflow model. By defining the chain as a Python model, it becomes compatible with the MLflow Model Serving platform, allowing for seamless deployment to production endpoints where it can be invoked via standard API calls.

  • ✗

    mlflow.register_model("path/to/chain")

    Why it's wrong here

    Registering a model is an action performed after the model is already logged. You cannot register a model that hasn't been created and saved through a logging function. This approach skips the critical step of defining the model's signature and environment, leading to deployment failures.

  • ✗

    mlflow.sklearn.log_model(my_chain_object)

    Why it's wrong here

    MLflow's sklearn flavor is intended for Scikit-Learn models, not for generic RAG chains or custom LLM pipelines. Using the wrong flavor will result in serialization errors or an inability to properly invoke the model, as the underlying expectations for input and output formats will not align.

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 →

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.