Skip to main content

Chat models

Features (natively supported)

All Chat models come with default implementations of all methods, ie. invoke, batch, stream. This gives all chat models basic support for invoking, streaming and batching, which by default is implemented as below:

  • Streaming support defaults to returning an AsyncIterator of a single value, the final result returned by the underlying model provider. Note that this doesn't give you token-by-token streaming, which requires native support from the model provider, but ensures your code that expects an iterator of tokens can work for any of our model integrations.
  • Batch support defaults to calling the underlying model in parallel for each input. You can control the concurrency with a maxConcurrency runtime param.

Additionally, some chat models support additional ways of guaranteeing structure in their outputs by allowing you to pass in a defined schema. Tool calling (tool calling) is one capability, and allows you to use the chat model as the LLM in certain types of agents. Some models in LangChain have also implemented a withStructuredOutput() method that unifies many of these different ways of constraining output to a schema.

The table shows, for each integration, which features have been implemented with native support. Yellow circles (🟡) indicates partial support - for example, if the model supports tool calling but not tool messages for agents.

ModelStreamJSON modeTool CallingwithStructuredOutput()Multimodal
BedrockChat🟡 (Bedrock Anthropic only)🟡 (Bedrock Anthropic only)🟡 (Bedrock Anthropic only)
ChatBedrockConverse
ChatAnthropic
ChatCloudflareWorkersAI
ChatCohere
ChatFireworks
ChatGoogleGenerativeAI
ChatVertexAI
ChatGroq
ChatMistralAI
ChatOllama
ChatOpenAI
ChatTogetherAI

All chat models

NameDescription
Alibaba TongyiLangChain.js supports the Alibaba qwen family of models.
AnthropicAnthropic is an AI safety and research
Azure OpenAIAzure OpenAI is a Microsoft Azure service that provides powerful
Baidu QianfanSetup
Amazon BedrockAmazon Bedrock is a fully managed
Amazon Bedrock Converse[Amazon Bedrock
Cloudflare Workers AIWorkers AI allows you
CohereCohere is a Canadian startup that provides
Deep InfraLangChain supports chat models hosted by Deep Infra through the ChatD...
Fake LLMLangChain provides a fake LLM chat model for testing purposes. This a...
FireworksFireworks AI is an AI inference platform to run
FriendliFriendli enhances AI application performance and optimizes cost savin...
Google GenAIGoogle AI offers a number of different chat
Google Vertex AIGoogle Vertex is a service that
GroqGroq is a company that offers fast AI inference,
Llama CPPOnly available on Node.js.
MinimaxMinimax is a Chinese startup that provides natural language processin...
MistralAIMistral AI is a platform that offers hosting for
MoonshotLangChain.js supports the Moonshot AI family of models.
OllamaOllama allows you to run open-source large
Ollama FunctionsThe LangChain Ollama integration package has official support for too...
OpenAIOpenAI is an artificial
PremAISetup
PromptLayer OpenAIYou can pass in the optional returnPromptLayerId boolean to get a pro...
Tencent HunyuanLangChain.js supports the Tencent Hunyuan family of models.
TogetherTogether AI offers an API to query [50+
WebLLMOnly available in web environments.
YandexGPTLangChain.js supports calling YandexGPT chat models.
ZhipuAILangChain.js supports the Zhipu AI family of models.

Was this page helpful?


You can also leave detailed feedback on GitHub.