Sahaj.blogs

Day page

1 Apr 2026

Study

LangChain · Chat models

LangChain's chat-model interface: messages in, an AIMessage out, the same invoke/stream/batch methods for every provider, shown with a local Hugging Face model and a fake model for tests.

  • Every chat model in LangChain speaks the same interface: a list of messages in, an AIMessage out.
  • Swapping providers changes one line; the rest of the app stays the same.

Read the post →