Heuristic:Vibrantlabsai Ragas Warning Deprecated Legacy LLM Wrappers
| Knowledge Sources | |
|---|---|
| Domains | Deprecation, Migration, LLM_Integration |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
DEPRECATION WARNING: The legacy framework wrapper classes LangchainLLMWrapper, LlamaIndexLLMWrapper, LangchainEmbeddingsWrapper, and LlamaIndexEmbeddingsWrapper are deprecated. Users should migrate to llm_factory() and modern embedding providers.
Description
Ragas originally used wrapper classes to bridge LangChain and LlamaIndex LLM/embedding interfaces into its own abstraction. These wrappers are now deprecated in favor of:
- llm_factory() with direct OpenAI/provider clients for LLMs
- Modern embedding providers (OpenAIEmbeddings, GoogleEmbeddings, HuggingFaceEmbeddings, LiteLLMEmbeddings) for embeddings
Additionally, the evaluate() and aevaluate() functions are deprecated in favor of the @experiment decorator pattern.
Usage
Apply this heuristic when encountering any of the deprecated wrapper classes or the legacy evaluate functions. Migrate to the modern API.
The Insight (Rule of Thumb)
- Action (LLMs): Replace LangchainLLMWrapper(chat_model) with llm_factory("openai:gpt-4o") or llm_factory(model="model_name", provider="provider")
- Action (Embeddings): Replace LangchainEmbeddingsWrapper(embedder) with OpenAIEmbeddings() or other modern providers
- Action (Evaluation): Replace evaluate(dataset, metrics) with the @experiment decorator pattern
- Trade-off: Modern API requires explicit provider selection rather than wrapping existing framework objects; may require refactoring initialization code
Reasoning
The wrapper approach added unnecessary indirection and made it harder to support structured outputs and advanced LLM features. The llm_factory() approach uses instructor for structured output generation, providing more reliable JSON parsing and type-safe responses. Modern embedding providers implement BaseRagasEmbeddings directly, offering better control over batching, caching, and async behavior.
Related Pages
- Implementation:Vibrantlabsai_Ragas_Llm_Factory
- Implementation:Vibrantlabsai_Ragas_HaystackLLMWrapper
- Implementation:Vibrantlabsai_Ragas_LiteLLM
- Implementation:Vibrantlabsai_Ragas_OpenAIEmbeddings
- Implementation:Vibrantlabsai_Ragas_HuggingFaceEmbeddings
- Implementation:Vibrantlabsai_Ragas_LiteLLMEmbeddings
- Implementation:Vibrantlabsai_Ragas_HaystackEmbeddings
- Implementation:Vibrantlabsai_Ragas_LangChainEvaluatorChain