llama-index llms langchain integration
Project Links
Meta
Author: Your Name
Requires Python: <4.0,>=3.10
Classifiers
LlamaIndex Llms Integration: Langchain
Installation
-
Install the required Python packages:
%pip install llama-index-llms-langchain
Usage
Import Required Libraries
from langchain.llms import OpenAI
from llama_index.llms.langchain import LangChainLLM
Initialize LangChain LLM
To create an instance of LangChainLLM with OpenAI:
llm = LangChainLLM(llm=OpenAI())
Generate Streaming Response
To generate a streaming response, use the following code:
response_gen = llm.stream_complete("Hi this is")
for delta in response_gen:
print(delta.delta, end="")
LLM Implementation example
https://docs.llamaindex.ai/en/stable/examples/llm/langchain/
0.8.0
Mar 12, 2026
0.7.2
Feb 19, 2026
0.7.1
Sep 08, 2025
0.7.0
Jul 30, 2025
0.6.1
Mar 18, 2025
0.6.0
Feb 11, 2025
0.5.1
Jan 20, 2025
0.5.0
Nov 18, 2024
0.4.2
Oct 08, 2024
0.4.1
Aug 22, 2024
0.4.0
Aug 22, 2024
0.3.0
Jul 23, 2024
0.1.4
May 31, 2024
0.1.3
Feb 21, 2024
0.1.2
Feb 20, 2024
0.1.1
Feb 12, 2024
0.1.0
Feb 10, 2024
0.0.1
Feb 03, 2024