OpenAILike
to connect to the llama-cpp serverfrom llama_index.llms import OpenAILike from llama_index import ServiceContext, set_global_service_context llm = OpenAILike(model="..", api_base="http://127.0.0.1:8000/api/v1", api_key="fake", context_window=4096, is_chat_model=False) service_context = ServiceContext.from_defaults(llm=llm, embed_model=...) set_global_service_context(service_context)
embed_model="local"
or configure whatever embedding you needembed_model="local:BAAI/bge-base-en-v1.5"
and it will automatically cache itfrom llama_index.embeddings import HuggingFaceEmbedding embed_model = HuggingFaceEmbedding(modal_name="<path_to_my_model>")
embed_model = HuggingFaceEmbedding(modal_name="BAAI/bge-base-en-v1.5")
will download the model at cache it for yougit lfs install git clone https://huggingface.co/BAAI/bge-base-en-v1.5