Skip to main content

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

llama_index_packs_rag_cli_local-0.4.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_packs_rag_cli_local-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_rag_cli_local-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8fa023a32ff10327e2b7ac218f3383d560012059e1db60a5aa8de00e969a4130
MD5 c9ef60ec991fab39fe51c7f2ca39355f
BLAKE2b-256 8c8d4c9d49aef4b644d493c28ae5a72dd1907f01979bdee2887463b5c2edfec7

See more details on using hashes here.

File details

Details for the file llama_index_packs_rag_cli_local-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_rag_cli_local-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfc6d96943b4af3fb5a76635347bb9e39f9aed84e66752750c969bad68a95b08
MD5 c72ca0c2bb3e61e7451b77bb9e89ae77
BLAKE2b-256 3ada2498237873a8644e7332d1465130025681d5281f9c00ee25a4d0fdafb5d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page