Skip to main content
Table of Contents
< All Topics
Print

Add AI Builder Models

This guide explains how tenant administrators can register Databricks Model Serving Endpoints for the VDAB AI Builder, how builders select and use those models, where to obtain access tokens, and how to track model usage in Databricks.

Prerequisites

  1. Tenant admin role in VDAB (required to create, edit, or delete models).
  2. At least one Databricks workspace connection on the VDAB Databricks Connections page.
  3. A Model Serving endpoint in that workspace that:
    • Is reachable through the Unity AI Gateway / pay-per-token Foundation Model APIs path VDAB uses
    • Supports tool calling because the builder agent invokes canvas tools while generating your app
  4. A Databricks personal access token with permission to query that endpoint in the same workspace as the connection.

1. Prepare the serving endpoint in Databricks

  1. In your Databricks workspace, open Serving or AI Gateway and create or identify an endpoint you want AI Builder to use.
  2. Confirm the endpoint is Ready and accepts chat-completions-style requests through the AI Gateway.
  3. Note the exact endpoint name (this is the Semantic Kernel model id VDAB sends on each request).
  4. Grant the identity that will own the PAT Can Query on the endpoint (or equivalent AI Gateway invoke permission).

2. Create a Databricks access token (PAT)

VDAB does not reuse the OAuth tokens from your workspace connection for AI Builder model calls. Each tenant AI model stores its own encrypted PAT used as the Bearer token when VDAB calls your endpoint.

In the same Databricks workspace linked to the model:

  1. Select your model within the AI Gateway (OpenAI, Anthropic, Gemini, etc.)
  2. At the bottom of the ‘Overview’ tab, select the Generate Access Token button
  3. Copy the Access Token and save it somewhere local temporarily

3. Register the model in VDAB

  1. Open VDAB and go to Databricks Connections.
  2. Select the AI Models tab.
  3. Click + Add AI Model (tenant admins only) and fill in all of the fields:
    • Model display name
    • Select the Databricks workspace the model is from
    • Select Databricks model serving endpoint name
    • Paste in the previously copied Access Token
  4. Click Create model.

4. Use the model in AI Builder

Any tenant member can use registered models in the app builder.

  1. Open any app in VDAB.
  2. Open the AI Builder chat panel by selecting the Prompt button.
  3. Use the model selector in the chat header to select your newly added model.
    • Each option in the selector shows the display name, endpoint name, and workspace.
  4. Chat as usual by describing the app you want to build, and the agent will scaffold components on the canvas.

Extra: Tracking AI model usage

Using models provided in the Databricks Unity AI Gateway, the usage data is recorded within the Unity Catalog under the system.ai_gateway.usage table. VDAB provides request tags to this usage table which can be queried and provide insight into model usage within VDAB by user, VDAB app, etc.

Some example queries:

  • Filter VDAB Builder usage in last 30 days
SELECT
  usage_date,
  request_tags['end_user'] AS vdab_user,
  request_tags['app_id'] AS vdab_app_id,
  request_tags['app_name'] AS vdab_app_name,
  request_tags['tenant_name'] AS vdab_tenant_name,
  request_tags['model_source'] AS model_source,
  request_tags['tenant_ai_model_id'] AS tenant_ai_model_id,
  request_tags['endpoint_name'] AS endpoint_name,
  input_token_count,
  output_token_count,
  total_token_count
FROM system.ai_gateway.usage
WHERE request_tags['source'] = 'vdab'
  AND request_tags['feature'] = 'ai-builder'
  AND usage_date >= current_date() - INTERVAL 30 DAYS
ORDER BY usage_date DESC;
  • Aggregate tokens by VDAB app
SELECT
  request_tags['app_id'] AS vdab_app_id,
  request_tags['app_name'] AS vdab_app_name,
  SUM(total_token_count) AS total_tokens,
  COUNT(*) AS request_count
FROM system.ai_gateway.usage
WHERE request_tags['source'] = 'vdab'
  AND request_tags['feature'] = 'ai-builder'
  AND usage_date >= current_date() - INTERVAL 30 DAYS
GROUP BY request_tags['app_id'], request_tags['app_name']
ORDER BY total_tokens DESC;
  • Aggregate by tenant AI model
SELECT
  request_tags['tenant_ai_model_id'] AS tenant_ai_model_id,
  request_tags['endpoint_name'] AS endpoint_name,
  SUM(total_token_count) AS total_tokens
FROM system.ai_gateway.usage
WHERE request_tags['source'] = 'vdab'
  AND request_tags['model_source'] = 'tenant'
  AND usage_date >= current_date() - INTERVAL 30 DAYS
GROUP BY request_tags['tenant_ai_model_id'], request_tags['endpoint_name'];