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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a54aea7cce91ccaba772e071d6805d5fde73ee31bb9ab3f7310719e49674e5c |
|
MD5 | b3ca2adb1e5746b922361450f892b888 |
|
BLAKE2b-256 | c7aaf617ea1bf565a282a942f36279c4cf4721d03a156d3ebfbd507d857c071c |
Hashes for llama_index_packs_rag_cli_local-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a237e52de734e1f567c2abae1820c9a2dae931c23e957124a66841fd80992c4e |
|
MD5 | f7a1976cb3903cdfcdabdc532569abd0 |
|
BLAKE2b-256 | 49d22958db13474e209523aae9c480e7ff9428d65fb9365565359a5658e9852e |