Skip to main content

Large Language Models (LLMs)

Large Language Models (LLMs) are advanced machine learning models that excel in a wide range of language-related tasks such as text generation, translation, summarization, question answering, and more, without needing task-specific tuning for every scenario.

Chat Models​

Modern LLMs are typically exposed to users via a Chat Model interface. These models process sequences of messages as input and output messages.

Popular chat models support native tool calling capabilities, which allows building applications that can interact with external services, APIs, databases, extract structured information from unstructured text, and more.

Modern LLMs are not limited to processing natural language text. They can also process other types of data, such as images, audio, and video. This is known as multimodality. Please see the Chat Model Concept Guide page for more information.

Terminology​

In documentation, we will often use the terms "LLM" and "Chat Model" interchangeably. This is because most modern LLMs are exposed to users via a chat model interface.

However, users must know that there are two distinct interfaces for LLMs in LangChain:

  1. Modern LLMs implement the BaseChatModel interface. These are chat models that process sequences of messages as input and output messages. Such models will typically be named with a convention that prefixes "Chat" to their class names (e.g., ChatOllama, ChatAnthropic, ChatOpenAI, etc.).
  2. Older LLMs implement the BaseLLM interface. These are LLMs that take as input text strings and output text strings. Such models are typically named just using the provider's name (e.g., Ollama, Anthropic, OpenAI, etc.). Generally, users should not use these models.

Modern LLMs (aka Chat Models):

Text-in, text-out LLMs (older or lower-level models):

caution

Unless you have a specific use case that requires using these models, you should use the chat models instead.


Was this page helpful?


You can also leave detailed feedback on GitHub.