Overview
The LLM module provides the foundational interfaces and base classes for integrating language models in LlamaIndex.TS. All LLM providers (OpenAI, Anthropic, etc.) extend these base classes.BaseLLM
Abstract base class that all LLM implementations extend.Methods
Get a chat response from the LLMStreaming:Non-streaming:
Get a prompt completion from the LLMStreaming:Non-streaming:
Execute LLM with tool calling and structured output support
Types
ChatMessage
ChatResponse
LLMMetadata
Multi-modal Support
LLMs support multi-modal content throughMessageContentDetail:
Example: Image Input
Tool Calling
LLMs support function calling through thetools parameter: