llama-index packs rag cli local integration
Project description
RAG Local CLI Pack
This LlamaPack implements a fully local version of our RAG CLI, with Mistral (through Ollama) and BGE-M3.
CLI Usage
You can download llamapacks directly using llamaindex-cli
, which comes installed with the llama-index
python package:
llamaindex-cli download-llamapack LocalRAGCLIPack --download-dir ./local_rag_cli_pack
You can then inspect the files at ./local_rag_cli_pack
and use them as a template for your own project!
Code Usage
You can download the pack to a directory. NOTE: You must specify skip_load=True
- the pack contains multiple files,
which makes it hard to load directly.
We will show you how to import the agent from these files!
from llama_index.llama_pack import download_llama_pack
# download and install dependencies
download_llama_pack("LocalRAGCLIPack", "./local_rag_cli_pack", skip_load=True)
From here, you can use the pack. The most straightforward way is through the CLI. You can directly run base.py, or run the setup_cli.sh
script.
cd local_rag_cli_pack
# option 1
python base.py rag -h
# option 2 - you may need sudo
# default name is lcli_local
sudo sh setup_cli.sh
lcli_local rag -h
You can also directly get modules from the pack.
from local_rag_cli_pack.base import LocalRAGCLIPack
pack = LocalRAGCLIPack(
verbose=True, llm_model_name="mistral", embed_model_name="BAAI/bge-m3"
)
# will spin up the CLI
pack.run()
# get modules
rag_cli = pack.get_modules()["rag_cli"]
rag_cli.cli()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for llama_index_packs_rag_cli_local-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b852b10715ede007e57c2d0a06d1f15219ec311e9fd55bed9aac1aa2b3f77563 |
|
MD5 | 78ecfe574e0bd947337b9ae5fc40cbd6 |
|
BLAKE2b-256 | 19487d9974b26c01e2551c798d8201df70feb052fc96c61d245d6fed42703928 |
Hashes for llama_index_packs_rag_cli_local-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc6b1ae56f37db43b460104060f99f79402bdb2246f4c7c20b83f227053353d0 |
|
MD5 | 15141c7e171e6affc88232b66cbd7a33 |
|
BLAKE2b-256 | 95b7e36c0a69bbdd056649efea0604b7002886aaaf756dee93b497709d382e90 |