- ChatLiteLLM: The main LangChain chat wrapper for LiteLLM.
- ChatLiteLLMRouter: A
ChatLiteLLMwrapper that leverages LiteLLM’s Router for load balancing and fallbacks.
Overview
Integration details
| Class | Package | Serializable | JS support | Downloads | Version |
|---|---|---|---|---|---|
| ChatLiteLLM | langchain-litellm | ❌ | ❌ | ||
| ChatLiteLLMRouter | langchain-litellm | ❌ | ❌ |
Model features
| Tool calling | Structured output | Image input | Audio input | Video input | Token-level streaming | Native async | Token usage | Logprobs |
|---|---|---|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
Setup
To accessChatLiteLLM and ChatLiteLLMRouter models, you’ll need to install the langchain-litellm package and create an OpenAI, Anthropic, Azure, Replicate, OpenRouter, Hugging Face, Together AI, or Cohere account. Then, you have to get an API key and export it as an environment variable.
Credentials
You have to choose the LLM provider you want and sign up with them to get their API key.Example - Anthropic
Head to the Claude console to sign up and generate a Claude API key. Once you’ve done this set theANTHROPIC_API_KEY environment variable:
Example - OpenAI
Head to platform.openai.com/api-keys to sign up for OpenAI and generate an API key. Once you’ve done this, set the OPENAI_API_KEY environment variable.Installation
The LangChain LiteLLM integration is available in thelangchain-litellm package:
Instantiation
ChatLiteLLM
You can instantiate aChatLiteLLM model by providing a model name supported by LiteLLM.
ChatLiteLLMRouter
You can also leverage LiteLLM’s routing capabilities by defining your model list as specified in the LiteLLM routing documentation.Invocation
Whether you’ve instantiated aChatLiteLLM or a ChatLiteLLMRouter, you can now use the ChatModel through LangChain’s API.
Async and streaming functionality
ChatLiteLLM and ChatLiteLLMRouter also support async and streaming functionality:
Advanced features
Vertex AI grounding (Google Search)
Use Google Search grounding with Vertex AI models (e.g.,gemini-3.5-flash). Citations and metadata are returned in response_metadata (batch) or additional_kwargs (streaming).
Setup
API reference
For detailed documentation of allChatLiteLLM and ChatLiteLLMRouter features and configurations, see the langchain-litellm API reference.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

