Skip to main content

Krionis Pipeline - multimodal RAG pipeline for low-compute, local, real-world deployment

Project description

Krionis Pipeline (formerly RAG-LLM-API-Pipeline)

A fully local, GPU-poor, multimodal Retrieval-Augmented Generation (RAG) system powered by open-source local LLMs.
Designed for secure technology environments, (such as OT, secure, airgapped applications, edge) it provides AI-assisted access to technical knowledge, manuals, and historical data — securely, offline, and at minimal cost.

⚠️ Backward compatibility:

  • Existing imports (import rag_llm_api_pipeline) and CLI (rag-cli) still work.

✅ Key Features

🔍 Retrieval-Augmented Generation (RAG)

  • FAISS/HNSW vector indices
  • SentenceTransformers embeddings

🧠 Flexible LLM Integration

  • HuggingFace open-source models (Qwen, Mistral, LLaMA, etc.)
  • Mixed precision: fp32, fp16, bfloat16
  • Dynamic model/device/precision switching via YAML

🔧 1-line YAML Configuration

  • System-specific documents
  • Embedding & generation model selection
  • CPU/GPU inference toggle
  • Index rebuilding, token limits, chunking

📂 Multimodal Input Support

  • PDFs
  • Plain text
  • Images (OCR via Tesseract)
  • Audio (.wav)
  • Video (.mp4)

💻 Multiple Interfaces

  • CLI (rag-cli / krionis-cli) for single-line querying
  • FastAPI-powered REST API for local serving
  • Lightweight HTML Web UI for interactive search

🚀 Quickstart

⚙️ Required Setup

Before starting the orchestrator, always make sure your working directory contains:

  • config\system.yaml – the main configuration file used by both the orchestrator and the pipeline.
  • data\manual\ – a directory with manually curated data (shared by both the pipeline and orchestrator).

These must be present in the directory where you launch the CLI (pwd on Linux/macOS, current folder in Windows).

Install:

pip install krionis-pipeline


###🛠️ Per-system configuration via system.yaml for flexible deployments
###🔐 Fully local operation — no cloud dependencies required

###✅ Quickstart guide and prebuilt example included
###✅ Runs on CPU or GPU with smart memory management
###✅ Web UI + CLI + API, all in one package

---

## 📦 Installation

```bash
pip install krionis-pipeline

🛠️ Setup Instructions (Windows + Anaconda)

1. Create Python Environment

conda create -n rag_env python=3.10
conda activate rag_env

2. Install Dependencies

Via Conda (system-level tools):

conda install -c conda-forge ffmpeg pytesseract pyaudio

Via Pip (Python packages):

pip install -r requirements.txt

Ensure Tesseract is installed and in your system PATH. You can get it from https://github.com/tesseract-ocr/tesseract.


🚀 Usage

Please review the quickstart guide.


🐧 Setup Instructions (Linux)

1. Create Python Environment

python3 -m venv rag_env
source rag_env/bin/activate

Or with conda:

conda create -n rag_env python=3.10
conda activate rag_env

2. Install System Dependencies

sudo apt update
sudo apt install -y ffmpeg tesseract-ocr libpulse-dev portaudio19-dev

Optional: install language packs for OCR (e.g., tesseract-ocr-eng).

3. Install Python Packages

pip install -r requirements.txt

🔁 Running the Application on Linux

CLI

python cli/main.py --system TestSystem --question "What is the restart sequence for this machine?"

API Server

uvicorn rag_llm_api_pipeline.api.server:app --host 0.0.0.0 --port 8000

cURL Query

bash curl -X POST http://localhost:8000/query
-H "Content-Type: application/json"
-d '{"system": "TestSystem", "question": "What does error E204 indicate?"}'


## 📚 How it Works

1. **Index Building**:
   - Files are parsed using `loader.py`.
   - Text chunks are embedded with MiniLM.
   - FAISS index stores embeddings for fast similarity search.

2. **Query Execution**:
   - User provides a natural language question.
   - Relevant text chunks are retrieved from the index.
   - LLM generates an answer based on retrieved context.

---

## 🧠 Model Info

- All models are open-source and run offline.

> You can replace with any local-compatible Hugging Face model.

---

## 🔐 Security & Offline Use

- No cloud or external dependencies required after initial setup.
- Ideal for OT environments.
- All processing is local: embeddings, LLM inference, and data storage.

---

## 📜 License

MIT License

---

## 📧 Contact

For issues, improvements, or contributions, please open an issue or PR.

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

krionis_pipeline-0.9.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

krionis_pipeline-0.9.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file krionis_pipeline-0.9.0.tar.gz.

File metadata

  • Download URL: krionis_pipeline-0.9.0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for krionis_pipeline-0.9.0.tar.gz
Algorithm Hash digest
SHA256 761bf513ed83519252c1c06e3007db99fc35a3cf0da5fb0f6f1003172919fb61
MD5 bf83aa346f6d3398e4ac956f736ef5a3
BLAKE2b-256 7159f6c9119b289f28850849a92f612b58418892d0edcf88a26f94f3b9e473e7

See more details on using hashes here.

File details

Details for the file krionis_pipeline-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for krionis_pipeline-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2960d5e47f54f7da5f84f4259c1ce187fbee73f5be251f1e63058004e1bfb27e
MD5 316239de5a94c9a001954cfe6f2fb440
BLAKE2b-256 3240dadfe5aee92de49f25fe9e319591e0321122beb7bd7bf9324f637909861c

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