customrag
customrag is a customizable Retrieval-Augmented Generation (RAG) pipeline implemented as a Python library. It allows developers to quickly integrate RAG into their applications using a simple configuration system. With support for multiple LLM and embedding providers, customrag offers an easy way to experiment with various APIs and document formats.
Features
- Easy
pipinstallation:pip install customrag - YAML-based configuration for flexibility
- Works with
.txt,.pdf,.csv,.json,.docx, and.mdfiles - Embedding storage and retrieval using FAISS
- Supports Gemini SDK (Cloud Console) and LangChain-native providers
- CLI tool for quick config generation
Installation
pip install customrag
Quick Setup
Generate a default config.yaml in your project directory:
customrag-setup
Edit the file to include your API keys and desired models.
Sample config.yaml
embedding:
provider: gemini
model: models/embedding-001
llm:
provider: gemini
model: gemini-1.5-pro
api_keys:
gemini: your_gemini_api_key_here
gemini_studio: your_gemini_studio_api_key_here
openai: your_openai_api_key_here
huggingface: your_huggingface_token_here
xai: your_xai_api_key_here
How to Use
Step 1: Initialize the RAG pipeline
from customrag import RAGPipeline
pipeline = RAGPipeline(config_path="config.yaml")
Step 2: Build a Vectorstore
pipeline.build_vectorstore("path_to_your_file.pdf")
This loads and chunks the document, embeds it, and stores it using FAISS.
Step 3: Ask Questions
answer = pipeline.query("What is this document about?")
print(answer)
The pipeline uses the configured LLM (via SDK or LangChain) to generate answers from the context.
Supported Providers
| Provider | Embeddings | LLM Chat | SDK Support |
|---|---|---|---|
| OpenAI | Yes | Yes | No |
| Gemini (Cloud Console) | Yes | No | Yes |
| Gemini Studio | Yes | Yes | No |
| HuggingFace Inference API | Yes | Yes | No |
| xAI | Yes | Yes | No |
| sentence-transformers (local) | Yes | No | No |
CLI Support
customrag-setup
This creates a starter config that can be modified per your needs.
License
MIT License
Copyright (c) [2024] [Anuj Goel]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Author
Developed by Anuj Goel. Contributions and feedback are welcome.
Metadata
Release files for customrag 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| customrag-0.1.2.tar.gz | 5.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| customrag-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / customrag-0.1.2.tar.gz
| Download URL | customrag-0.1.2.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c79b99df3443adaecfa4a4b881ee90e7877d0acd79d18595ee8f3176596e900
|
|
BLAKE2b-256 checksum How to use checksums |
0b582784dea7bb53076a62718c343ef1476b3bef80ac6a58204052acbfaf66eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Release files / customrag-0.1.2-py3-none-any.whl
| Download URL | customrag-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
548f97982a84e99e008f7f4f4fbc973499b0b19a0486661926470ef4c06b7f52
|
|
BLAKE2b-256 checksum How to use checksums |
bddaf3ac9218c168722e7d271f34f9f925beee3102729dcc6ee4de9a1eef4f51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Security for customrag 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.