Skip to main content

Privacy-first QA dataset generator for RAG evaluation and fine-tuning. Works with local LLMs (Ollama, vLLM) or cloud providers.

Project description

RAGScore Logo

PyPI version Python 3.9+ License Ollama Supported

Generate high-quality QA datasets to evaluate your RAG systems

๐Ÿ”’ Privacy-First โ€ข โšก Lightweight โ€ข ๐Ÿค– Multi-Provider โ€ข ๐Ÿ  Local LLM Support

English | ไธญๆ–‡ | ๆ—ฅๆœฌ่ชž


๐ŸŒŸ 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)

  1. Download LM Studio
  2. Load a model (llama-3.1, qwen-2.5, etc.)
  3. Start local server
  4. 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

Sign Up for Waitlist โ†’


๐Ÿงช 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragscore-0.4.7.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

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

ragscore-0.4.7-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file ragscore-0.4.7.tar.gz.

File metadata

  • Download URL: ragscore-0.4.7.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ragscore-0.4.7.tar.gz
Algorithm Hash digest
SHA256 eaa9ae9943452e5ec9559cc38c64e437c2fef7cd322e08ff5e3aeec747ce02f1
MD5 d685a70954d6b9b1e6bb7fc2e8ed6508
BLAKE2b-256 5d33bf1fcc462d366fa4623cf217db6bbfdcf853e0f6d589f3accdce18c58d63

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragscore-0.4.7.tar.gz:

Publisher: ci.yml on HZYAI/RagScore

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

File details

Details for the file ragscore-0.4.7-py3-none-any.whl.

File metadata

  • Download URL: ragscore-0.4.7-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ragscore-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e4b500c8c772c600486ad7eb48d16d1fb5350789f66c7479c862eb17d00c0dbf
MD5 085a757e1a992185dbb1c0dcae75f1bc
BLAKE2b-256 d42a1ef1b84b48475aa2761c589832ee30b453ea4e5273ddb53ae17b954fb8ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragscore-0.4.7-py3-none-any.whl:

Publisher: ci.yml on HZYAI/RagScore

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