skillfed

llama-index-llms-langchain

llama-index llms langchain integration

llama-index-llms-langchain v0.8.0 151.7K downloads/30d#10,924 on PyPI
Permissive license MIT Active released

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 on this page — 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

llama-index-llms-langchain on PyPI

pip

pip install llama-index-llms-langchain

uv

uv add llama-index-llms-langchain

poetry

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 the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — langchain, llama-index-core
Maintenance actively maintained — 155 days since the last release
First released
Downloads 151,694/month — #10,924 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: llama_index_llms_langchain-0.8.0-py3-none-any.whl

Tags

llama index langchain integrationuse langchain llms with llamaindexlangchain llm adapterllamaindex llm providerlangchain integration llamaindexbridge langchain and llamaindex
llm-integrationrag-framework

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

llama-index-embeddings-langchain

Integrates Langchain embedding models with…

permissive · top 15,000 on PyPI

llama-index-llms-litellm

Integrates LiteLLM with LlamaIndex to provide…

permissive · top 15,000 on PyPI

llama-index-llms-openai-like

Provides a thin wrapper to use…

permissive · top 15,000 on PyPI

llama-index-llms-gemini

Integrates Google's Gemini LLM with LlamaIndex,…

permissive · top 15,000 on PyPI

llama-cpp-python

Python bindings for llama.cpp that enable…

permissive · top 15,000 on PyPI

llama-index-llms-openai

Integrates OpenAI's language models into…

permissive · top 1,000 on PyPI

llama-index-llms-azure-openai

Integrates Azure OpenAI language models into…

permissive · top 15,000 on PyPI

llama-index-agent-openai

Integrates OpenAI language models with…

permissive · top 5,000 on PyPI

llama-index-llms-vertex

Integrates Google Vertex AI's LLM capabilities…

permissive · top 15,000 on PyPI

llama-index-llms-bedrock

Integrates AWS Bedrock LLMs into LlamaIndex,…

permissive · top 15,000 on PyPI