stbjelcevic
Databricks Employee
Databricks Employee

Hi @heramb13 ,

Your chain is being serialized by MLflow; during that process MLflow re-imports each runnable by its module path. The error shows MLflow is trying to import ChatDatabricks from the legacy module path “langchain_databricks”, which isn’t installed in the environment that’s saving the chain. This exact failure has been reported and typically occurs when the ChatDatabricks object (or its alias) resolves to the old path even if your source import line uses databricks_langchain. The fix is to either rebuild the chain so the class resolves to the new module path, or include the legacy shim as a dependency at log time.

Quick checks

Confirm ChatDatabricks resolves to the new module path with print(ChatDatabricks.module)

  • Ensure your input_example shape matches the first runnable in the chain (dict with “messages”, not a raw string)
  • Always pass pip_requirements with databricks-langchain (and optionally langchain-databricks if the legacy path appears)

References that should help: