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.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 457159ecdf9660fdd51e41f4864df3bbe075abf40d68baed2261fbdbedb705c4 |
|
MD5 | e7d13d504bdef02f56a8dd1378414587 |
|
BLAKE2b-256 | faa22e1244e76c35b2f1384d7b9bcbee3372df768d5448dc9a362c030cb7c4a0 |
Hashes for llama_index_packs_rag_cli_local-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c2b826e2ecc18d323421fe9072fa84c25f5343656432e023303d387f9fd415a |
|
MD5 | 2c4dfc0f85c282fb483b10b4eac87031 |
|
BLAKE2b-256 | 1854b45139bd3422328b91619f65d713faf80d231ad9ff192bc83ae39a7621fb |