Databricks Chat Model icon

Databricks Chat Model

Use Databricks hosted LLM models

Overview

This node integrates with Databricks hosted large language models (LLMs) to perform chat-based AI interactions. It allows users to select a specific deployed model on Databricks and send chat prompts to generate responses. This is useful for scenarios such as automating customer support, generating content, summarizing text, or any task that benefits from conversational AI powered by Databricks LLMs.

Practical examples:

  • Automatically generate replies to user queries in a chatbot.
  • Summarize long documents or emails using the selected Databricks model.
  • Create creative writing or code snippets based on prompts.

Properties

Name Meaning
Model The specific Databricks hosted model to use for generating chat completions.
Options Additional parameters to customize the model's output behavior:
- Maximum Tokens Limits the maximum number of tokens in the generated response (default 512, max 32768).
- Temperature Controls randomness of output; higher values (up to 2) produce more diverse results (default 0.7).
- Top P Nucleus sampling parameter controlling diversity; value between 0 and 1 (default 1).

Output

The node outputs a JSON object containing the AI-generated chat completion result from the selected Databricks model. The exact structure follows the typical response format of the underlying LangChain/OpenAI Chat API wrapper, which includes the generated text content.

No binary data output is produced by this node.

Dependencies

  • Requires a Databricks API host URL and an API authentication token configured as credentials in n8n.
  • Uses the @langchain/openai package internally to interact with the Databricks serving endpoints.
  • Network access to the Databricks API endpoint /api/2.0/serving-endpoints is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing API token or host URL will cause authentication failures.
    • Selecting a model name that does not exist or is not deployed will result in errors.
    • Exceeding token limits or invalid parameter values may cause request rejections.
  • Error messages and resolutions:

    • 401 Unauthorized: Check that the API token credential is valid and has proper permissions.
    • 404 Not Found when loading models: Verify the Databricks host URL and that models are deployed.
    • Request timeout: Increase timeout option or check network connectivity.
    • Invalid parameter: Ensure numeric options like temperature and top_p are within allowed ranges.

Links and References

Discussion