Skip to main content

Streaming AI Chat with Model Serving

Build a streaming AI chat experience using AI SDK and Databricks Model Serving endpoints.

Streaming AI Chat with Model Serving preview

Build with AI

  1. Copy the prompt below
  2. Paste into Cursor, Claude Code, Codex, or any coding agent
  3. Your agent builds it — asking questions along the way so the result is exactly what you want

New to templates? Learn more here

When done, you will have:

  • A real-time streaming chat interface in your Databricks App
  • Integration with Databricks Model Serving via AI Gateway
  • Server-side chat transport and client-side chat UI wired together
  • A deployed app where users can converse with a Databricks-hosted LLM

Prerequisites

Complete these prerequisite templates first:

Then verify these Databricks workspace features are enabled. If any check fails, ask your workspace admin to enable the feature.

  • An OpenAI-compatible chat endpoint in Model Serving. Run databricks serving-endpoints list --profile <PROFILE> and confirm at least one OpenAI-compatible chat endpoint is listed (e.g. databricks-gpt-5-4-mini, databricks-meta-llama-3-3-70b-instruct, or databricks-claude-sonnet-4). Endpoint availability varies by workspace and region; note the one you plan to set as DATABRICKS_ENDPOINT.
  • Databricks Apps enabled. Run databricks apps list --profile <PROFILE> and confirm the command succeeds (an empty list is fine). A permission or not enabled error means Apps is not available to this identity in this workspace.