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

๐Ÿš€ 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

(Optional) Setup External Dependencies

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

docker compose -f docker/compose.yaml up -d

Install pirag

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

pip install --upgrade -e ./app

๐Ÿ“š 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.1.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distributions

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

pirag-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

pirag-0.1.0-1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pirag-0.1.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pirag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 01cbae8274d9ffd193184430865832783f21c910350a193861026de0d5c1c476
MD5 613822dc099273f511fc7c663eee250e
BLAKE2b-256 4eaf0d66b9d6d7c70c8d02d083a44b33c200da8d8b32b916af89881121a0f4ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pirag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pirag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2670f46633d75e8af4eea9accd17bac20ed664806caf7e49e417bbe7fcde5b89
MD5 ca08f2c361da27aa57d37a77a4ae01dd
BLAKE2b-256 c371632a293ac56014587b43fa7065d1ab19affbdb0de773ef8bd5e71bf176e4

See more details on using hashes here.

File details

Details for the file pirag-0.1.0-1-py3-none-any.whl.

File metadata

  • Download URL: pirag-0.1.0-1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pirag-0.1.0-1-py3-none-any.whl
Algorithm Hash digest
SHA256 7fb897c4427892ef640997232b07d6fb87dd489b1d4182d1f3ecf3b98da74f62
MD5 95b25adff460a084d7542e0760d3647f
BLAKE2b-256 e1f0b37d13b6cab83b98fb85c7bbc8ea02347ac43131a6fac2da08cd28219cdd

See more details on using hashes here.

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