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.core.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
File details
Details for the file llama_index_packs_rag_cli_local-0.2.0.tar.gz
.
File metadata
- Download URL: llama_index_packs_rag_cli_local-0.2.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f9536b20d5e5b074cb15219e54be9e549bf153775fd1a681f5651e22d4284f |
|
MD5 | 8fe69f989ff96183ef569126e5d41a40 |
|
BLAKE2b-256 | 8cf0d2842469b8bbde6bf7bd4940808d5f792ce13884d2b38ff04b260fd84084 |
File details
Details for the file llama_index_packs_rag_cli_local-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_packs_rag_cli_local-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09e23d1537a9515aa29ae5779e850ff4b81e3d6f7ac9217a7870fd89c53318e7 |
|
MD5 | 0043166a2cd174c625bf01cc05e99b42 |
|
BLAKE2b-256 | 35ac8647e3b33f971fe97948b38292657bb902370d4510aaffcc07368fd56b77 |