Skip to main content
LiteLLM is a library that simplifies calling Anthropic, Azure, Huggingface, Replicate, and many other LLM providers through a single unified interface.

Installation and setup

Chat models

See the LiteLLM chat guide for full usage details, including streaming, tool calling, structured output, and Vertex AI Grounding.

Embeddings

LiteLLMEmbeddings embeds text across 100+ providers with a single consistent interface. All configuration is explicit, with no environment variables required.
Switch providers by changing model. The interface stays the same:
For load-balancing across multiple deployments of the same model, use LiteLLMEmbeddingsRouter:

Document loaders

LiteLLMOCRLoader loads documents via a LiteLLM proxy’s OCR endpoint (e.g. Azure Document Intelligence). The proxy handles all provider-specific authentication and configuration.
Async loading is also supported:

API reference

For detailed documentation of all classes and configurations, see the langchain-litellm API reference.