from llama_index import ServiceContext, set_global_service_context from llama_index.llms import LangChainLLM llm = LangChainLLM(<lc_llm_here>) service_context = ServiceContext.from_defaults(llm=llm) set_global_service_context(service_context)