Two ways to use this template
- 1. Click "Copy prompt" below
- 2. Paste into Cursor, Claude Code, Codex, or any coding agent
- 3. Your agent builds the app — it asks questions along the way so the result is exactly what you want
Follow the steps below to set things up manually, at your own pace.
Generate Embeddings with AI Gateway
Generate text embeddings from a Databricks AI Gateway endpoint using the Databricks SDK.
Generate text embeddings from a Databricks AI Gateway endpoint using the Databricks SDK.
When done, you will have:
- A configured embedding endpoint in your app environment
- A reusable helper function that generates vector embeddings from text input
- Integration with your existing Databricks workspace client via AppKit
Prerequisites
Verify these Databricks workspace features are enabled before starting. If any check fails, ask your workspace admin to enable the feature.
- Databricks CLI authenticated. Run
databricks auth profilesand confirm at least one profile showsValid: YES. If none do, authenticate withdatabricks auth login --host <workspace-url> --profile <PROFILE>. - An embedding endpoint in Model Serving. Run
databricks serving-endpoints list --profile <PROFILE>and confirm at least one embedding endpoint is listed (for exampledatabricks-gte-large-enordatabricks-bge-large-en, both 1024-dimension). Endpoint availability varies by workspace; note the endpoint name you plan to set asDATABRICKS_EMBEDDING_ENDPOINT.
Generate Embeddings with AI Gateway
Generate text embeddings from a Databricks AI Gateway endpoint using the Databricks SDK.
1. Find an embedding endpoint
databricks serving-endpoints list --profile <PROFILE>
Common embedding endpoints: databricks-gte-large-en (1024d), databricks-bge-large-en (1024d).
2. Configure environment
.env:
DATABRICKS_EMBEDDING_ENDPOINT=databricks-gte-large-en
app.yaml:
env:
- name: DATABRICKS_EMBEDDING_ENDPOINT
value: "databricks-gte-large-en"
3. Embedding helper
Create server/lib/embeddings.ts:
import { getWorkspaceClient } from "@databricks/appkit";
const workspaceClient = getWorkspaceClient({});
export async function generateEmbedding(text: string): Promise<number[]> {
const endpoint =
process.env.DATABRICKS_EMBEDDING_ENDPOINT || "databricks-gte-large-en";
const result = await workspaceClient.servingEndpoints.query({
name: endpoint,
input: text,
});
return result.data![0].embedding!;
}
No additional dependencies — uses @databricks/appkit already in your project.
4. Verify
databricks serving-endpoints query <embedding-endpoint> \
--json '{"input": "Hello, world!"}' \
--profile <PROFILE>
Response includes a data array with embedding (float array).