02 / 04

How to initialise a model in langchain?

LangChain supports all major model providers through dedicated integration packages. Each provider package implements the same standard interface, so you can swap providers without rewriting application logic. New model names work immediately — no LangChain update required — because provider packages pass model names directly to the provider’s API.

Basic implementation using initChatModel:
Implementation using Model class
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.