Skip to main content
Chat models are language models that use a sequence of messages as inputs and return messages as outputs .

Install and use

Install:
Add environment variables:
Instantiate the model:
Install:
Add environment variables:
Instantiate the model:
Install:
Add environment variables:
Instantiate the model:
Install:
Add environment variables:
Instantiate the model:
Install:
Add environment variables:
Instantiate the model:
While these LangChain classes support the indicated advanced feature, you may need to refer to provider-specific documentation to learn which hosted models or backends support the feature.
See the full list of chat model integrations below for more options.

Routers & proxies

Routers and proxies give you access to models from multiple providers through a single API and credential. They can simplify billing, let you switch between models without changing integrations, and offer features like automatic fallbacks.

Chat Completions API

Certain model providers offer endpoints that are compatible with OpenAI’s (legacy) Chat Completions API. In such case, you can use ChatOpenAI with a custom base_url to connect to these endpoints. Note that features built on top of the Chat Completions API may not be fully supported by ChatOpenAI; in such cases, consider using a provider-specific class if available.

All chat models

Anthropic

Azure OpenAI

Baidu Qianfan

Amazon Bedrock Converse

Cerebras

Cloudflare Workers AI

Cohere

DeepSeek

Fake LLM

Google Gemini

Groq

MistralAI

Ollama

OpenAI

Perplexity

xAI

Fireworks

IBM watsonx.ai

Together

If you’d like to contribute an integration, see Contributing integrations.