Chat models are language models that use a sequence of messages as inputs and return messages as outputs (as opposed to using plain text). These are generally newer models.
If you’d like to write your own chat model, see this how-to.If you’d like to contribute an integration, see Contributing integrations.
pip install -qU "langchain[openai]"
import getpass
import os

if not os.environ.get("OPENAI_API_KEY"):
  os.environ["OPENAI_API_KEY"] = getpass.getpass("Enter API key for OpenAI: ")

from langchain.chat_models import init_chat_model

model = init_chat_model("gpt-4o-mini", model_provider="openai")
model.invoke("Hello, world!")
While all these LangChain classes support the indicated advanced feature, you may haveto open the provider-specific documentation to learn which hosted models or backends support the feature.
ProviderTool callingStructured outputJSON modeLocalMultimodalPackage
ChatAnthropiclangchain-anthropic
ChatMistralAIlangchain-mistralai
ChatFireworkslangchain-fireworks
AzureChatOpenAIlangchain-openai
ChatOpenAIlangchain-openai
ChatTogetherlangchain-together
ChatVertexAIlangchain-google-vertexai
ChatGoogleGenerativeAIlangchain-google-genai
ChatGroqlangchain-groq
ChatCoherelangchain-cohere
ChatBedrocklangchain-aws
ChatHuggingFacelangchain-huggingface
ChatNVIDIAlangchain-nvidia-ai-endpoints
ChatOllamalangchain-ollama
ChatLlamaCpplangchain-community
ChatAI21langchain-ai21
ChatUpstagelangchain-upstage
ChatDatabricksdatabricks-langchain
ChatWatsonxlangchain-ibm
ChatXAIlangchain-xai
ChatPerplexitylangchain-perplexity

All chat models

Abso

AI21 Labs

Alibaba Cloud PAI EAS

Anthropic

Anyscale

AzureAIChatCompletionsModel

Azure OpenAI

Azure ML Endpoint

Baichuan Chat

Baidu Qianfan

AWS Bedrock

Cerebras

CloudflareWorkersAI

Cohere

ContextualAI

Coze Chat

Dappier AI

Databricks

DeepInfra

DeepSeek

Eden AI

EverlyAI

Featherless AI

Fireworks

ChatFriendli

Goodfire

Google Gemini

Google Cloud Vertex AI

GPTRouter

DigitalOcean Gradient

GreenNode

Groq

ChatHuggingFace

IBM watsonx.ai

JinaChat

Kinetica

Konko

LiteLLM

Llama 2 Chat

Llama API

LlamaEdge

Llama.cpp

maritalk

MiniMax

MistralAI

MLX

ModelScope

Moonshot

Naver

Nebius

Netmind

NVIDIA AI Endpoints

ChatOCIModelDeployment

OCIGenAI

ChatOctoAI

Ollama

OpenAI

Outlines

Perplexity

Pipeshift

ChatPredictionGuard

PremAI

PromptLayer ChatOpenAI

Qwen QwQ

Reka

RunPod Chat Model

SambaNovaCloud

SambaStudio

ChatSeekrFlow

Snowflake Cortex

solar

SparkLLM Chat

Nebula (Symbl.ai)

Tencent Hunyuan

Together

Tongyi Qwen

Upstage

vectara

vLLM Chat

Volc Engine Maas

Chat Writer

xAI

Xinference

YandexGPT

ChatYI

Yuan2.0

ZHIPU AI