Databricks Generative AI Engineer Associate Question 90
Select 3You are developing a machine learning application on Databricks that involves using a pre-trained generative AI model for text summarization. The model is deployed as a REST endpoint. Which of the following steps are necessary to integrate the model into your Databricks notebook for real-time predictions?
- A
Use Databricks'
requestslibrary to send HTTP requests to the REST endpoint - B
Write a UDF (User-Defined Function) to handle the API response and process the predictions
- C
Install the pre-trained model directly onto the Databricks cluster
- D
Configure the Databricks notebook to handle API authentication for the REST endpoint
- E
Use Databricks' MLflow Tracking to monitor the API's performance
Show answer and explanation
Correct answers: A, B, D
Explanation
To integrate a pre-trained generative AI model deployed as a REST endpoint into a Databricks notebook, you need to use an HTTP library for sending requests, handle API responses using a UDF, and configure proper authentication for secure access. Installing the model onto the cluster or using MLflow Tracking is not relevant in this scenario as the model is externally deployed and MLflow is not required for API integration.
- A. Correct.
This is correct. Databricks supports using libraries like
requeststo make HTTP calls to external APIs, such as REST endpoints for generative AI models. - B. Correct.
This is correct. Writing a UDF is necessary to encapsulate the logic for processing API responses and integrating them into your pipeline.
- C. Incorrect.
This is incorrect. Since the model is already deployed as a REST endpoint, there is no need to install it directly onto the Databricks cluster.
- D. Correct.
This is correct. Properly configuring the notebook for API authentication (e.g., using tokens or API keys) is essential for securely accessing the REST endpoint.
- E. Incorrect.
This is incorrect. While MLflow Tracking is useful for monitoring experiments, it is not directly relevant for integrating with a REST endpoint.