from llama_index.embeddings import LangchainEmbedding from llama_index import ServiceContext, set_global_service_context llm = <setup langchain llm> embed_model = LangchainEmbedding(<setup langchain embeds>) service_context = ServiceContext.from_defaults(llm=llm, embed_model=embed_model) set_global_service_context(service_context)