Registry / llm-agents / langchain-databricks

langchain-databricks

JSON →
library0.1.2pypypi✓ verified 84d ago

The `langchain-databricks` package was an integration library connecting LangChain with Databricks AI features, including LLMs, vector search, and MLflow. It has been superseded by `databricks-langchain` to consolidate Databricks-related LangChain components. The last published version of `langchain-databricks` is 0.1.2, and it is no longer actively maintained or receiving new features. Users should migrate to the `databricks-langchain` package for continued support and new functionality.

pip install langchain-databricks
INSTALL
IMPORT
SIG · LANGCHAIN-DATABRIC
L
langchain-databricks
llm-agentspythonv0.1.2
Install
46.5s avg
Import
14598ms
Disk
832MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 51.19s
py 3.11
✕ build_error
✓ 45.81s
py 3.12
✕ build_error
✓ 41.13s
py 3.13
✕ build_error
4/8 runs
py 3.9
✕ build_error
✓ 47.75s
832MB installed
● package 832MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ChatDatabricks
from langchain_databricks import ChatDatabricks
from databricks_langchain import ChatDatabricks
DatabricksEmbeddings
from langchain_databricks import DatabricksEmbeddings
DatabricksVectorSearch
from langchain_databricks import DatabricksVectorSearch

This quickstart demonstrates how to instantiate and use `ChatDatabricks` from the *recommended* `databricks-langchain` package to interact with a Databricks Model Serving endpoint. If running outside a Databricks Workspace, ensure `DATABRICKS_HOST` and `DATABRICKS_TOKEN` environment variables are set for authentication. The code for the deprecated `langchain-databricks` is shown for historical context but should not be used in new projects.

import os from databricks_langchain import ChatDatabricks from langchain_core.messages import HumanMessage # --- IMPORTANT: FOR RUNNING OUTSIDE DATABRICKS WORKSPACE --- # Set these environment variables or pass them directly to the ChatDatabricks constructor. # os.environ["DATABRICKS_HOST"] = os.environ.get("DATABRICKS_HOST", "https://your-databricks-workspace.cloud.databricks.com") # os.environ["DATABRICKS_TOKEN"] = os.environ.get("DATABRICKS_TOKEN", "dapi********************************") # Instantiate the chat model using a Databricks Model Serving endpoint # Replace 'databricks-meta-llama-3-70b-instruct' with your actual endpoint name. # Ensure DATABRICKS_HOST and DATABRICKS_TOKEN are set if running outside Databricks workspace. chat_model = ChatDatabricks( endpoint="databricks-meta-llama-3-70b-instruct", temperature=0.1, max_tokens=256 ) # Invoke the model response = chat_model.invoke([HumanMessage(content="What is MLflow?")]) print(response.content) # --- DEPRECATED PACKAGE USAGE (for context, prefer databricks-langchain) --- # from langchain_databricks import ChatDatabricks # deprecated_chat_model = ChatDatabricks(endpoint="your-deprecated-endpoint") # print("WARNING: Using deprecated langchain-databricks package.")
Debug
Known issues
breakingThe `langchain-databricks` package is deprecated. All features have been consolidated into the new `databricks-langchain` package. Future updates and new features will be released exclusively in `databricks-langchain`.
fix
Migrate your `pip install` command to `pip install databricks-langchain` and update all imports from `langchain_databricks` to `databricks_langchain`.
affects: <0.1.2
gotchaWhen running outside a Databricks workspace, you must explicitly set Databricks authentication credentials (hostname and personal access token).
fix
Set `DATABRICKS_HOST` and `DATABRICKS_TOKEN` environment variables or pass `databricks_host` and `databricks_token` directly during class instantiation (e.g., `ChatDatabricks(endpoint=..., databricks_host=..., databricks_token=...)`).
affects: All
gotchaModel serving endpoint name mismatches or incorrect API key/configuration are common causes for invocation failures.
fix
Double-check that the `endpoint` name passed to `ChatDatabricks` or `DatabricksEmbeddings` exactly matches the configured endpoint name in your Databricks workspace. Verify associated API keys and resource configurations.
affects: All
gotchaWhen logging LangChain models with MLflow, ensure the model name adheres to the three-level Unity Catalog path (`<catalog>.<schema>.<model>`) and that `chain_type` is passed in `model_config` for proper reconstruction.
fix
Use `mlflow.langchain.log_model(lc_model=..., registered_model_name='your_catalog.your_schema.your_model', model_config={'chain_type': 'stuff'})`.
affects: All
Upgrade
Version history
0.1.2latest on PyPI · released Dec 20, 2024
Audit
Dependencies
langchainrequiredCore LangChain framework, implicitly required for using the integrations.
langchain-communityoptionalMany Databricks integrations were initially in or moved to langchain-community before the dedicated databricks-langchain package. Often installed alongside.
mlflow>=2.9.0optionalRequired for MLflow integration features, such as logging and tracking LangChain models.
databricks-sdkoptionalOften needed for authentication and programmatic interaction with Databricks services, especially when running outside a Databricks Workspace.
Agent activity
26 hits · last 30 days
node
24
Bingbot
1
OpenAI (training)
1
Resources
langchain-databricks — pip install langchain-databricks · libregistry