|
| 1 | +# Using Databricks Models in AI DIAL |
| 2 | + |
| 3 | +From this document you can learn how to use Databricks models in AI DIAL. |
| 4 | + |
| 5 | +## Configure Databricks |
| 6 | + |
| 7 | +### Step 1 (Optional): Create Serving Endpoint |
| 8 | + |
| 9 | +Create a serving endpoint for a Databricks model unless you already have one: |
| 10 | + |
| 11 | +1. In the **Machine Learning** section, navigate to the **Serving** tab and click **Create serving endpoint**. |
| 12 | + |
| 13 | +  |
| 14 | + |
| 15 | +2. Enter a serving endpoint name (it will be used in the [Step 4](#step-4-configure-openai-adapter)) and select the served Entity (model). |
| 16 | + |
| 17 | +  |
| 18 | + |
| 19 | +3. Click **Create** |
| 20 | + |
| 21 | +### Step 2: Create Access Token |
| 22 | + |
| 23 | +To generate access token, navigate to the **Developer** section in your **User Settings**. |
| 24 | + |
| 25 | +  |
| 26 | + |
| 27 | +## Configure AI DIAL |
| 28 | + |
| 29 | +### Step 3: Configure AI DIAL Model |
| 30 | + |
| 31 | +Use the serving endpoint and the access token you have created in two previous steps to add the following configuration in the [DIAL Core dynamic settings](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings) to the `model` section: |
| 32 | + |
| 33 | +```json |
| 34 | +"{dial-deployment-name}": |
| 35 | +{ |
| 36 | + "type": "chat", |
| 37 | + "displayName": "{Deployment name}", |
| 38 | + "endpoint": "http://{open-ai-adapter-host}/openai/deployments/{databricks-deployment-name}/chat/completions", |
| 39 | + "upstreams": [ |
| 40 | + { |
| 41 | + "endpoint": "{databricks-account-address}/serving-endpoints/chat/completions", |
| 42 | + "key": "access token" |
| 43 | + } |
| 44 | + ] |
| 45 | +} |
| 46 | +``` |
| 47 | +### Step 4: Configure OpenAI Adapter |
| 48 | + |
| 49 | +1. Since Databricks serving endpoints utilize an authorization flow that differs from OpenAI's, it's necessary to specify the Databricks deployments in the OpenAI Adapter environment variable: `DATABRICKS_DEPLOYMENTS=databricks-deployment-name`. Refer to [AI DIAL OpenAI adapter documentation](https://github.com/epam/ai-dial-adapter-openai?tab=readme-ov-file#categories-of-deployments) for details. |
| 50 | +2. Restart AI DIAL OpenAI Adapter for changes to apply. |
0 commit comments