Databricks Lakehouse Platform unifies data, analytics, and AI on one platform.This guide provides a quick overview for getting started with Databricks chat models. For detailed documentation of all ChatDatabricks features and configurations head to the API reference.
ChatDatabricks
class wraps a chat model endpoint hosted on Databricks Model Serving. This example notebook shows how to wrap your serving endpoint and use it as a chat model in your LangChain application.
Class | Package | Local | Serializable | Package downloads | Package latest |
---|---|---|---|---|---|
ChatDatabricks | databricks-langchain | ❌ | beta |
Tool calling | Structured output | JSON mode | Image input | Audio input | Video input | Token-level streaming | Native async | Token usage | Logprobs |
---|---|---|---|---|---|---|---|---|---|
✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
ChatDatabricks
supports all methods of ChatModel
including async APIs.
ChatDatabricks
wraps must have OpenAI-compatible chat input/output format (reference). As long as the input format is compatible, ChatDatabricks
can be used for any endpoint type hosted on Databricks Model Serving:
DATABRICKS_HOST
and DATABRICKS_TOKEN
environment variables, respectively. See Authentication Documentation for how to get an access token.
databricks-langchain
package.
ChatDatabricks
.
For other type of endpoints, there are some difference in how to set up the endpoint itself, however, once the endpoint is ready, there is no difference in how to query it with ChatDatabricks
. Please refer to the bottom of this notebook for the examples with other type of endpoints.
ChatDatabricks
can be used as a part of a complex chain.
ChatDatabricks.bind_tools
, we can easily pass in Pydantic classes, dict schemas, LangChain tools, or even functions as tools to the model. Under the hood these are converted to the OpenAI-compatible tool schemas, which looks like: