Provider Overview
LiteLLM (Recommended)
LiteLLM provides a unified interface to 100+ LLM providers. It is the recommended default.LLM
Embedder
OpenRouter
OpenRouter aggregates models from multiple providers behind a single API.LLM
Embedder
LLMInterface ABC
To integrate a provider not covered by LiteLLM or OpenRouter, subclassLLMInterface.
Required Method
Optional Overrides
ainvoke_messages() is called by completion() when conversation history is provided. Override it to pass messages natively to your LLM’s chat API for proper multi-turn handling:
Constructor Parameters
Embedder ABC
Required Methods
model_name property is used by the graph config node to validate that the same embedding model is used for ingestion and retrieval.
Optional Overrides
Batch Embedding
Theembed_documents() and aembed_documents() methods are critical for performance. The ingestion pipeline calls them with hundreds or thousands of texts. If your provider supports batch embedding, always override these methods:
Environment Variables
For convenience, you can configure providers via environment variables instead of passing parameters directly. LiteLLM respects standard environment variables:
See the LiteLLM documentation for the full list of supported providers and their environment variables.