Skip to main content

CLI Projects of On-Premise RAG. You can use your own LLM and vector DB. Or just add remote LLM servers and vector DB.

Project description

pirag: pilot-onpremise-rag

๐ŸŒฑ LLM+RAG CLI project operating in On-Premise environment

Python CLI LLM LangChain Milvus MinIO

PyPI - Version Build Status

๐Ÿš€ Introduction

pilot-onpremise-rag is a CLI tool that implements a knowledge-based RAG (Retrieval-Augmented Generation) system with LLM. It provides powerful document retrieval and generation capabilities while ensuring data privacy.

๐Ÿ”ง Setup

Install pirag from PyPI

pip install pirag

Install pirag from source

git clone https://github.com/jyje/pilot-onpremise-rag
cd pilot-onpremise-rag

pip install --upgrade -e .

(Optional) Setup External Dependencies

git clone https://github.com/jyje/pilot-onpremise-rag
cd pilot-onpremise-rag

docker compose -f docker/compose.yaml up

๐Ÿ“š Usage

Basic Commands

# View help
pirag --help

# Train documents
pirag train --source ./documents

# Ask a question
pirag ask "Give me a joke for Cat-holic."

๐Ÿ—๏ธ Project Structure

pilot-onpremise-rag/
โ”œโ”€โ”€ app/                        # Main application directory
โ”‚   โ”œโ”€โ”€ main.py                 # CLI main entry point
โ”‚   โ”œโ”€โ”€ setup.py                # Package setup configuration
โ”‚   โ”œโ”€โ”€ pyproject.toml          # PEP 517/518 build configuration
โ”‚   โ”œโ”€โ”€ requirements.txt        # Dependencies
โ”‚   โ”œโ”€โ”€ logs/                   # Application logs
โ”‚   โ””โ”€โ”€ rag/                    # RAG implementation
โ”‚       โ”œโ”€โ”€ config.py           # Configuration settings
โ”‚       โ”œโ”€โ”€ agent.py            # Agent implementation
โ”‚       โ”œโ”€โ”€ ask/                # Query handling module
โ”‚       โ”œโ”€โ”€ train/              # Document training module
โ”‚       โ”œโ”€โ”€ test/               # Testing module
โ”‚       โ””โ”€โ”€ doctor/             # Diagnostic tools
โ”œโ”€โ”€ VERSION                     # Project version
โ”œโ”€โ”€ docker/                     # Docker configuration
โ”œโ”€โ”€ assets/                     # Static assets (Files are not included)
โ””โ”€โ”€ LICENSE                     # License information

๐Ÿ”„ How It Works

  1. Document Training: Process local documents and store in vector database
  2. Search Engine: Find document chunks related to user queries
  3. Context Generation: Create LLM prompts from retrieved documents
  4. Response Generation: Provide accurate responses via local LLM

๐Ÿ’ก Key Features

  • Privacy Guaranteed: All data and processing occurs locally
  • Multiple Document Support: Support for PDF, Markdown, TXT, DOCX, and other formats
  • Custom LLM: Compatible with various local LLM models
  • Vector Database: Vector DB integration for efficient document retrieval

๐Ÿงช Performance Optimization

Configuration Memory Usage Response Speed Suitable Use Cases
Light Model 4-6GB Fast Simple queries, low-spec hardware
Medium Model 8-12GB Medium General use, most queries
Large Model 16GB+ Slow Complex document analysis, expert answers

๐Ÿ”— References

Contributing

Any contributions are welcome!

Current Maintainers

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

pirag-0.2.2.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pirag-0.2.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file pirag-0.2.2.tar.gz.

File metadata

  • Download URL: pirag-0.2.2.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pirag-0.2.2.tar.gz
Algorithm Hash digest
SHA256 69a07a2359549243c7d826c4828e32de449774ccae40a1e5877f10f4b319f58c
MD5 b669f083050d419b1bdce1444d4f406b
BLAKE2b-256 1413efd62cdee4172f76c9057eda381bdef4267795be843d87e3713d60ef3bfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pirag-0.2.2.tar.gz:

Publisher: build-and-publish.yml on jyje/pilot-onpremise-rag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pirag-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pirag-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pirag-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a031f055ed32cbff9236388e79446f4962f6bbbf871fedb7e8fe8bcbcfe1ca4e
MD5 d301bfc0bb40e8bba09b847c0a816c58
BLAKE2b-256 30f0c885764e59613cf119f3459cd8989377dd916a78aa9fa970a40c99d549e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pirag-0.2.2-py3-none-any.whl:

Publisher: build-and-publish.yml on jyje/pilot-onpremise-rag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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