Privacy-first QA dataset generator for RAG evaluation. Works with local LLMs (Ollama, vLLM) or cloud providers.
Project description
Generate high-quality QA datasets to evaluate your RAG systems
๐ Privacy-First โข โก Lightweight โข ๐ค Multi-Provider โข ๐ Local LLM Support
๐ Why RAGScore?
Privacy-First Architecture
- ๐ No embeddings - Your documents never leave your machine
- ๐ Local LLM support - Use Ollama, vLLM, or any local model
- ๐ GDPR/HIPAA compliant - Perfect for sensitive data
- โ Zero external API calls during document processing
Lightweight & Fast
- โก 50 MB install - 90% smaller than alternatives (500MB+)
- ๐ No heavy ML dependencies - No PyTorch, no TensorFlow
- ๐จ Quick startup - Ready in seconds, not minutes
True Multi-Provider
- ๐ค Auto-detection - Just set API key, we handle the rest
- ๐ Switch instantly - Change providers without code changes
- ๐ Works with everything - OpenAI, Anthropic, Groq, Ollama, vLLM, and more
Developer-Friendly
- ๐ File or directory - Process single files, multiple files, or folders
- ๐ฏ Zero configuration - No config files, no setup scripts
๐ Local LLMs: 100% Private, 100% Free
Perfect for:
- ๐ข Enterprises with sensitive data (financial, medical, legal)
- ๐ฌ Researchers processing confidential papers
- ๐ฐ Cost-conscious users who want zero API fees
- ๐ Offline environments without internet access
Option 1: Ollama (Recommended - Easiest)
# 1. Install Ollama
brew install ollama # or visit https://ollama.ai
# 2. Pull a model
ollama pull llama3.1 # 4.7 GB, great quality
# or
ollama pull qwen2.5:7b # 4.7 GB, excellent for QA
# or
ollama pull llama3.1:70b # 40 GB, best quality
# 3. Start Ollama
ollama serve
# 4. Use RAGScore (auto-detects Ollama!)
ragscore generate paper.pdf
That's it! No API keys, no configuration, 100% private.
Option 2: vLLM (For Production)
# 1. Install vLLM
pip install vllm
# 2. Start server with your model
vllm serve meta-llama/Llama-3.1-8B-Instruct \
--host 0.0.0.0 \
--port 8000
# 3. Point RAGScore to it
export LLM_BASE_URL="http://localhost:8000/v1"
ragscore generate paper.pdf
Option 3: LM Studio (GUI)
- Download LM Studio
- Load a model (llama-3.1, qwen-2.5, etc.)
- Start local server
- Use with RAGScore (auto-detected!)
๐ Quick Start
Cloud LLMs (Fast, Requires API Key)
# 1. Install
pip install "ragscore[openai]" # or [anthropic], [dashscope]
# 2. Set API key
export OPENAI_API_KEY="sk-..."
# 3. Generate QA pairs
ragscore generate paper.pdf
Local LLMs (Private, No API Key)
# 1. Install
pip install ragscore
# 2. Start Ollama
ollama pull llama3.1 && ollama serve
# 3. Generate QA pairs (100% private!)
ragscore generate paper.pdf
๐ Usage Examples
Single File
ragscore generate paper.pdf
Multiple Files
ragscore generate paper.pdf report.txt notes.md
Glob Patterns
ragscore generate *.pdf
ragscore generate docs/**/*.md
Directory
ragscore generate ./my_documents/
Mix Everything
ragscore generate paper.pdf ./more_docs/ *.txt
๐ Supported Providers
Cloud Providers
| Provider | Setup | Notes |
|---|---|---|
| OpenAI | export OPENAI_API_KEY="sk-..." |
Best quality, widely used |
| Anthropic | export ANTHROPIC_API_KEY="sk-ant-..." |
Long context (200K tokens) |
| DashScope | export DASHSCOPE_API_KEY="..." |
Qwen models |
See each provider's website for current pricing and features.
Local Providers (Private & Free!)
| Provider | Setup | Notes |
|---|---|---|
| Ollama | ollama serve |
Easiest setup, great for getting started |
| vLLM | vllm serve model |
Production-grade, high performance |
| LM Studio | GUI app | User-friendly interface |
| llama.cpp | ./server -m model.gguf |
Lightweight, runs on CPU |
| LocalAI | Docker container | OpenAI-compatible API |
Switch Providers Instantly
# Monday: Use OpenAI
export OPENAI_API_KEY="sk-..."
ragscore generate paper.pdf
# Tuesday: Switch to local (more private!)
unset OPENAI_API_KEY
ollama serve
ragscore generate paper.pdf # Same command!
# Wednesday: Try Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."
ragscore generate paper.pdf # Still same command!
๐ฏ Use Cases
Privacy-Sensitive Industries
Perfect for organizations handling confidential data:
- ๐ฅ Healthcare - Process medical documents locally
- โ๏ธ Legal - Analyze case files without cloud exposure
- ๐ฆ Finance - Generate QA from internal reports
- ๐ฌ Research - Work with unpublished papers
- ๐ข Enterprise - Handle proprietary documentation
General Applications
- ๐ RAG Evaluation - Generate test datasets for your RAG system
- ๐ Documentation - Create QA pairs from technical docs
- ๐ค Fine-tuning - Generate training data for model fine-tuning
- ๐ Knowledge Management - Extract Q&A from company knowledge bases
All use cases work with both cloud and local LLMs!
# Example: Process documents locally for privacy
ollama pull llama3.1
ragscore generate confidential_docs/*.pdf
# โ
Data never leaves your infrastructure
# Example: Use cloud LLM for best quality
export OPENAI_API_KEY="sk-..."
ragscore generate research_papers/*.pdf
# โ
High-quality QA generation
๐ Output Format
{
"id": "abc123",
"question": "What is RAG?",
"answer": "RAG (Retrieval-Augmented Generation) combines...",
"rationale": "This is explicitly stated in the introduction...",
"support_span": "RAG systems retrieve relevant documents...",
"difficulty": "easy",
"doc_id": "xyz789",
"source_path": "docs/rag_intro.pdf"
}
๐ From Generation to Audit (RAGScore Pro)
You've generated 1,000 QA pairs. Now what?
Generating the data is Step 1. Step 2 is proving to your auditors that your RAG system is safe.
RAGScore Pro (Enterprise) connects to your generated dataset to provide:
- ๐ต๏ธ Hallucination Detection - Did your RAG make things up?
- ๐ Regression Testing - Did your latest prompt change break 20% of your answers?
- ๐ข Team Dashboards - Share accuracy reports with stakeholders
- ๐ Multi-dimensional Scoring - Accuracy, relevance, completeness
- โก CI/CD Integration - Automated evaluation in your pipeline
๐งช Python API
from ragscore import run_pipeline, generate_qa_for_chunk
from ragscore.providers import get_provider
# Simple usage
run_pipeline(paths=["paper.pdf", "report.txt"])
# Use local Ollama
provider = get_provider("ollama", model="llama3.1")
qas = generate_qa_for_chunk(
chunk_text="Your text here...",
difficulty="hard",
n=5,
provider=provider
)
# Use local vLLM
provider = get_provider(
"openai", # vLLM is OpenAI-compatible
base_url="http://localhost:8000/v1",
api_key="not-needed"
)
qas = generate_qa_for_chunk(
chunk_text="Your text here...",
difficulty="medium",
n=3,
provider=provider
)
โ๏ธ Configuration
RAGScore works with zero configuration, but you can customize:
# Optional: Customize chunk size
export RAGSCORE_CHUNK_SIZE=512
# Optional: Questions per chunk
export RAGSCORE_QUESTIONS_PER_CHUNK=5
# Optional: Working directory
export RAGSCORE_WORK_DIR=/path/to/workspace
๐ Privacy & Security
What Data Stays Local?
- โ Your documents - Never sent to embedding APIs
- โ Document chunks - Processed locally
- โ File metadata - Stays on your machine
What Data is Sent to LLM?
- โ ๏ธ Text chunks only - Sent to LLM for QA generation
- โ With local LLMs - Even this stays on your machine!
Compliance
- โ GDPR compliant - No data sent to third parties (with local LLMs)
- โ HIPAA friendly - Use local LLMs for PHI
- โ SOC 2 ready - Full data control with local deployment
๐งช Development
# Clone repository
git clone https://github.com/HZYAI/RagScore.git
cd RagScore
# Install with dev dependencies
pip install -e ".[dev,all]"
# Run tests
pytest
# Run linting
ruff check src/
black --check src/
๐ค Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
๐ License
Apache 2.0 License - see LICENSE for details.
๐ Links
โญ Star us on GitHub if RAGScore helps you!
Made with โค๏ธ for the RAG community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ragscore-0.4.4.tar.gz.
File metadata
- Download URL: ragscore-0.4.4.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e1ec9f4526a00fc21c8431a19109df3691d22c243ca063c99f50a437640d86c
|
|
| MD5 |
00a60d221593527122045625ce04c471
|
|
| BLAKE2b-256 |
21e0ec87291902010c3fd1bc60b756f640724e15d72f9db7f851f146d4168b9e
|
Provenance
The following attestation bundles were made for ragscore-0.4.4.tar.gz:
Publisher:
ci.yml on HZYAI/RagScore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ragscore-0.4.4.tar.gz -
Subject digest:
9e1ec9f4526a00fc21c8431a19109df3691d22c243ca063c99f50a437640d86c - Sigstore transparency entry: 789634016
- Sigstore integration time:
-
Permalink:
HZYAI/RagScore@da751e65f64f5c67c7362a27babad28e6bf80737 -
Branch / Tag:
refs/tags/v0.4.4 - Owner: https://github.com/HZYAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@da751e65f64f5c67c7362a27babad28e6bf80737 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ragscore-0.4.4-py3-none-any.whl.
File metadata
- Download URL: ragscore-0.4.4-py3-none-any.whl
- Upload date:
- Size: 34.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70bf599afaf888314d1305863a67b119314dc3e5faf6d80934dd88a2f5341e84
|
|
| MD5 |
adf275ed07a222447bde1b2cf8fb196a
|
|
| BLAKE2b-256 |
28150ad5d4e1bc7462296f6e27a67761989c161b2537dedf41fac822b5c5b74f
|
Provenance
The following attestation bundles were made for ragscore-0.4.4-py3-none-any.whl:
Publisher:
ci.yml on HZYAI/RagScore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ragscore-0.4.4-py3-none-any.whl -
Subject digest:
70bf599afaf888314d1305863a67b119314dc3e5faf6d80934dd88a2f5341e84 - Sigstore transparency entry: 789634017
- Sigstore integration time:
-
Permalink:
HZYAI/RagScore@da751e65f64f5c67c7362a27babad28e6bf80737 -
Branch / Tag:
refs/tags/v0.4.4 - Owner: https://github.com/HZYAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@da751e65f64f5c67c7362a27babad28e6bf80737 -
Trigger Event:
push
-
Statement type: