A ~35-line Streamlit chatbot you can deploy on Databricks Free Edition in a few minutes. It calls a hosted Foundation Model (no API keys, no billing setup, no model deployment) and streams the reply. Built as the hands-on build for a "everyone ships an app" workshop.
You make it yours by editing two lines at the top of app.py:
MODEL = "databricks-meta-llama-3-3-70b-instruct" # try another model
SYSTEM_PROMPT = "You are a friendly, concise assistant." # give it a personality- A Databricks Free Edition workspace (free signup).
- The Databricks CLI (
v0.229.0+), authenticated to your workspace:databricks auth login --host https://<your-workspace>.cloud.databricks.com --profile my-free-edition
# 1. Create the app (provisions compute — takes a couple of minutes)
databricks apps create chatbot-starter --profile my-free-edition
# 2. Upload the code to your workspace
databricks sync . /Workspace/Users/<you@example.com>/chatbot-starter \
--exclude .git --profile my-free-edition
# 3. Deploy
databricks apps deploy chatbot-starter \
--source-code-path /Workspace/Users/<you@example.com>/chatbot-starter \
--profile my-free-edition
# 4. Get the URL
databricks apps get chatbot-starter --profile my-free-editionOpen the printed URL, sign in, and chat.
In the workspace UI: Compute → Apps → Create app → pick the Streamlit template, then
paste in the contents of app.py. Same result, zero local tooling.
| File | Purpose |
|---|---|
app.py |
The whole app — Streamlit chat UI + streaming model call. |
app.yaml |
Tells Databricks Apps how to start it (streamlit run app.py). |
requirements.txt |
streamlit, databricks-sdk, openai. |
Inside a Databricks App, credentials are auto-injected, so you don't handle any secrets. The app builds an OpenAI-compatible client pointed at your workspace's serving endpoints:
w = WorkspaceClient()
token = w.config.authenticate()["Authorization"].split(" ", 1)[1]
client = OpenAI(api_key=token, base_url=f"{w.config.host}/serving-endpoints")Gotcha: you may see
serving_endpoints.get_open_ai_client()in newer docs. The Databricks Apps runtime can ship an olderdatabricks-sdkthat doesn't have that helper (AttributeError). The pattern above works regardless of SDK version — that's why this starter uses it.
Any of these MODEL values work out of the box (list yours with
databricks serving-endpoints list):
databricks-meta-llama-3-3-70b-instructdatabricks-llama-4-maverickdatabricks-gpt-oss-120b/databricks-gpt-oss-20bdatabricks-qwen3-next-80b-a3b-instructdatabricks-gemma-3-12b
MIT — see LICENSE.