Skip to main content
Open on GitHub

Chat models

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.

info

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[google-genai]"
import getpass
import os

if not os.environ.get("GOOGLE_API_KEY"):
os.environ["GOOGLE_API_KEY"] = getpass.getpass("Enter API key for Google Gemini: ")

from langchain.chat_models import init_chat_model

model = init_chat_model("gemini-2.0-flash", model_provider="google_genai")
model.invoke("Hello, world!")
info

While all these LangChain classes support the indicated advanced feature, you may have to open the provider-specific documentation to learn which hosted models or backends support the feature.

ProviderTool callingStructured outputJSON modeLocalMultimodalPackage
ChatAnthropicโœ…โœ…โŒโŒโœ…langchain-anthropic
ChatMistralAIโœ…โœ…โŒโŒโŒlangchain-mistralai
ChatFireworksโœ…โœ…โœ…โŒโŒlangchain-fireworks
AzureChatOpenAIโœ…โœ…โœ…โŒโœ…langchain-openai
ChatOpenAIโœ…โœ…โœ…โŒโœ…langchain-openai
ChatTogetherโœ…โœ…โœ…โŒโŒlangchain-together
ChatVertexAIโœ…โœ…โŒโŒโœ…langchain-google-vertexai
ChatGoogleGenerativeAIโœ…โœ…โŒโŒโœ…langchain-google-genai
ChatGroqโœ…โœ…โœ…โŒโŒlangchain-groq
ChatCohereโœ…โœ…โŒโŒโŒlangchain-cohere
ChatBedrockโœ…โœ…โŒโŒโŒlangchain-aws
ChatHuggingFaceโœ…โœ…โŒโœ…โŒlangchain-huggingface
ChatNVIDIAโœ…โœ…โœ…โœ…โœ…langchain-nvidia-ai-endpoints
ChatOllamaโœ…โœ…โœ…โœ…โŒlangchain-ollama
ChatLlamaCppโœ…โœ…โŒโœ…โŒlangchain-community
ChatAI21โœ…โœ…โŒโŒโŒlangchain-ai21
ChatUpstageโœ…โœ…โŒโŒโŒlangchain-upstage
ChatDatabricksโœ…โœ…โŒโŒโŒdatabricks-langchain
ChatWatsonxโœ…โœ…โœ…โŒโŒlangchain-ibm
ChatXAIโœ…โœ…โŒโŒโŒlangchain-xai
ChatPerplexityโŒโœ…โœ…โŒโœ…langchain-perplexity

All chat modelsโ€‹

NameDescription
AbsoThis will help you get started with ChatAbso chat models. For detaile...
AI21 LabsThis notebook covers how to get started with AI21 chat models.
Alibaba Cloud PAI EASAlibaba Cloud PAI (Platform for AI) is a lightweight and cost-efficie...
AnthropicThis notebook provides a quick overview for getting started with Anth...
AnyscaleThis notebook demonstrates the use of langchain.chat_models.ChatAnysc...
AzureAIChatCompletionsModelThis will help you get started with AzureAIChatCompletionsModel chat ...
Azure OpenAIThis guide will help you get started with AzureOpenAI chat models. Fo...
Azure ML EndpointAzure Machine Learning is a platform used to build, train, and deploy...
Baichuan ChatBaichuan chat models API by Baichuan Intelligent Technology. For more...
Baidu QianfanBaidu AI Cloud Qianfan Platform is a one-stop large model development...
AWS BedrockThis doc will help you get started with AWS Bedrock chat models. Amaz...
CerebrasThis notebook provides a quick overview for getting started with Cere...
CloudflareWorkersAIThis will help you get started with CloudflareWorkersAI chat models. ...
CohereThis notebook covers how to get started with Cohere chat models.
ContextualAIThis will help you get started with Contextual AI's Grounded Language...
Coze ChatChatCoze chat models API by coze.com. For more information, see https...
Dappier AIDappier: Powering AI with Dynamic, Real-Time Data Models
DatabricksDatabricks Lakehouse Platform unifies data, analytics, and AI on one ...
DeepInfraDeepInfra is a serverless inference as a service that provides access...
DeepSeekThis will help you get started with DeepSeek's hosted chat models. Fo...
Eden AIEden AI is revolutionizing the AI landscape by uniting the best AI pr...
EverlyAIEverlyAI allows you to run your ML models at scale in the cloud. It a...
Featherless AIThis will help you get started with FeatherlessAi chat models. For de...
FireworksThis doc helps you get started with Fireworks AI chat models. For det...
ChatFriendliFriendli enhances AI application performance and optimizes cost savin...
GoodfireThis will help you get started with Goodfire chat models. For detaile...
Google GeminiAccess Google's Generative AI models, including the Gemini family, di...
Google Cloud Vertex AIThis page provides a quick overview for getting started with VertexAI...
GPTRouterGPTRouter is an open source LLM API Gateway that offers a universal A...
GroqThis will help you get started with Groq chat models. For detailed do...
ChatHuggingFaceThis will help you get started with langchainhuggingface chat models....
IBM watsonx.aiChatWatsonx is a wrapper for IBM watsonx.ai foundation models.
JinaChatThis notebook covers how to get started with JinaChat chat models.
KineticaThis notebook demonstrates how to use Kinetica to transform natural l...
KonkoKonko API is a fully managed Web API designed to help application dev...
LiteLLMLiteLLM is a library that simplifies calling Anthropic, Azure, Huggin...
Llama 2 ChatThis notebook shows how to augment Llama-2 LLMs with the Llama2Chat w...
Llama APIThis notebook shows how to use LangChain with LlamaAPI - a hosted ver...
LlamaEdgeLlamaEdge allows you to chat with LLMs of GGUF format both locally an...
Llama.cppllama.cpp python library is a simple Python bindings for @ggerganov
maritalkMariTalk is an assistant developed by the Brazilian company Maritaca ...
MiniMaxMinimax is a Chinese startup that provides LLM service for companies ...
MistralAIThis will help you get started with Mistral chat models. For detailed...
MLXThis notebook shows how to get started using MLX LLM's as chat models.
ModelScopeModelScope (Home | GitHub) is built upon the notion of โ€œModel-as-a-Se...
MoonshotMoonshot is a Chinese startup that provides LLM service for companies...
NaverThis notebook provides a quick overview for getting started with Nave...
NetmindThis will help you get started with Netmind chat models. For detailed...
NVIDIA AI EndpointsThis will help you get started with NVIDIA chat models. For detailed ...
ChatOCIModelDeploymentThis will help you get started with OCIModelDeployment chat models. F...
OCIGenAIThis notebook provides a quick overview for getting started with OCIG...
ChatOctoAIOctoAI offers easy access to efficient compute and enables users to i...
OllamaOllama allows you to run open-source large language models, such as L...
OpenAIThis notebook provides a quick overview for getting started with Open...
OutlinesThis will help you get started with Outlines chat models. For detaile...
PerplexityThis page will help you get started with Perplexity chat models. For ...
PipeshiftThis will help you get started with Pipeshift chat models. For detail...
ChatPredictionGuardPrediction Guard is a secure, scalable GenAI platform that safeguards...
PremAIPremAI is an all-in-one platform that simplifies the creation of robu...
PromptLayer ChatOpenAIThis example showcases how to connect to PromptLayer to start recordi...
Qwen QwQThis will help you get started with QwQ chat models. For detailed doc...
RekaThis notebook provides a quick overview for getting started with Reka...
RunPod Chat ModelGet started with RunPod chat models.
SambaNovaCloudThis will help you get started with SambaNovaCloud chat models. For d...
SambaStudioThis will help you get started with SambaStudio chat models. For deta...
ChatSeekrFlowSeekr provides AI-powered solutions for structured, explainable, and ...
Snowflake CortexSnowflake Cortex gives you instant access to industry-leading large l...
solarDeprecated since version 0.0.34: Use langchain_upstage.ChatUpstage in...
SparkLLM ChatSparkLLM chat models API by iFlyTek. For more information, see iFlyTe...
Nebula (Symbl.ai)This notebook covers how to get started with Nebula - Symbl.ai's chat...
Tencent HunyuanTencent's hybrid model API (Hunyuan API)
TogetherThis page will help you get started with Together AI chat models. For...
Tongyi QwenTongyi Qwen is a large language model developed by Alibaba's Damo Aca...
UpstageThis notebook covers how to get started with Upstage chat models.
vectaraVectara is the trusted AI Assistant and Agent platform, which focuses...
vLLM ChatvLLM can be deployed as a server that mimics the OpenAI API protocol....
Volc Engine MaasThis notebook provides you with a guide on how to get started with vo...
Chat WriterThis notebook provides a quick overview for getting started with Writ...
xAIThis page will help you get started with xAI chat models. For detaile...
XinferenceXinference is a powerful and versatile library designed to serve LLMs,
YandexGPTThis notebook goes over how to use Langchain with YandexGPT chat mode...
ChatYIThis will help you get started with Yi chat models. For detailed docu...
Yuan2.0This notebook shows how to use YUAN2 API in LangChain with the langch...
ZHIPU AIThis notebook shows how to use ZHIPU AI API in LangChain with the lan...

Was this page helpful?