--- id: llama-index-llms-langchain version: "0.8.0" license: MIT license_treatment: permissive maintenance: active --- # llama-index-llms-langchain — llama-index llms langchain integration License: permissive · Maintenance: active · Downloads: 151.7K/mo ## What it is and what it does This package provides a wrapper that lets you use any LangChain-compatible language model as a LlamaIndex LLM. It acts as an adapter layer, translating between LlamaIndex's LLM interface and LangChain's model implementations. You instantiate a LangChain model (such as OpenAI) and wrap it with LangChainLLM, then use it directly in LlamaIndex workflows for indexing, querying, and response generation. The integration supports both standard completion and streaming responses. It depends on langchain and llama-index-core. This is useful when you want to leverage LlamaIndex's retrieval and indexing capabilities while using a specific LangChain provider or model that may not have a direct LlamaIndex integration. Use it for: - Use LangChain's OpenAI wrapper within LlamaIndex to build RAG pipelines with specific model configurations - Integrate a custom or lesser-known LangChain LLM provider into LlamaIndex without writing your own adapter - Stream responses from LangChain models through LlamaIndex's completion API for real-time output - Combine LlamaIndex's document indexing with a LangChain LLM you already have configured in another project ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Bridges LlamaIndex with LangChain LLM providers, allowing you to use any LangChain-compatible language model within LlamaIndex's indexing and retrieval framework. Yes, if you are already using both LlamaIndex and LangChain and want to use a LangChain LLM provider within LlamaIndex. The low install friction, active maintenance, MIT license, and zero known vulnerabilities make it a straightforward choice. Install it only if you have a specific LangChain provider you need to integrate; if LlamaIndex has a direct integration for your model, that is likely simpler. ## Install pip install llama-index-llms-langchain uv add llama-index-llms-langchain poetry add llama-index-llms-langchain ## Installing llama-index-llms-langchain Before you install: Low friction installation with only two runtime dependencies. The package is actively maintained with a recent release. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: pip install llama-index-llms-langchain from langchain.llms import OpenAI from llama_index.llms.langchain import LangChainLLM llm = LangChainLLM(llm=OpenAI()) response_gen = llm.stream_complete("Hi this is") for delta in response_gen: print(delta.delta, end="") Requires Python 3.10 or later Verify before relying: - Whether all LangChain LLM implementations are fully compatible with LlamaIndex's streaming and completion interfaces - Performance characteristics when using LangChain providers compared to native LlamaIndex integrations ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 151.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags llama index langchain integration, use langchain llms with llamaindex, langchain llm adapter, llamaindex llm provider, langchain integration llamaindex, bridge langchain and llamaindex, llm-integration, rag-framework [View on SkillFed](https://skillfed.io/packages/llama-index-llms-langchain) · [View on PyPI](https://pypi.org/project/llama-index-llms-langchain/)