Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Heuristic:Vibrantlabsai Ragas Warning Deprecated Legacy LLM Wrappers

From Leeroopedia
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

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment