A PluMA plugin for local LLM-based summarization of multi-omics pipeline findings with domain-specific RAG (Retrieval-Augmented Generation) support.
This plugin uses locally-hosted large language models to:
- Generate natural language summaries of statistical results
- Interpret feature importance rankings in biological context
- Compare integration method performance
- Optionally contextualize findings with domain-specific literature (RAG)
Supports configurable research domains (Parkinson's, Alzheimer's, cancer, microbiome) with pre-built configurations and customizable RAG databases.
Key Features:
- 🔒 Privacy-first: All inference runs locally via Ollama
- 🧠 Smart model selection: Auto-detects hardware and selects optimal model
- 📚 RAG augmentation: Enhances summaries with relevant literature
- 🎯 Multi-domain: Pre-configured for multiple research areas
- 📦 Modular design: Clean separation of concerns
# Clone the repository
git clone https://github.com/quinnjr/LLMSummarizer.git
cd LLMSummarizer
# Install dependencies
pip install -r requirements.txt
# Install Ollama (required)
# See: https://ollama.com/download- Ollama must be installed: https://ollama.com
- The plugin will automatically:
- Start the Ollama server if not running
- Detect your hardware (CPU, RAM, GPU)
- Download an appropriate model if needed
- numpy
- pandas
- requests
- chromadb (for RAG features)
- psutil (for accurate RAM detection)
- ollama (Python client)
| Parameter | Description | Default |
|---|---|---|
feature_importance |
Path to SHAP feature importance CSV | Optional |
cv_results |
Path to cross-validation results CSV | Optional |
de_results |
Path to differential expression results CSV | Optional |
cluster_results |
Path to clustering results CSV | Optional |
model_metrics |
Path to model evaluation metrics CSV | Optional |
domain |
Research domain (see below) | generic |
model_name |
Ollama model or auto |
auto |
temperature |
Sampling temperature | 0.3 |
max_tokens |
Maximum tokens in response | 1024 |
use_rag |
Enable RAG augmentation | true |
literature_db |
Path to ChromaDB database | Domain default |
rag_auto_download |
Auto-download RAG database | true |
rag_repo |
GitHub repo for RAG database | Auto-detected |
| Domain | Description | RAG Collection |
|---|---|---|
parkinsons |
Parkinson's disease research | pd_findings |
alzheimers |
Alzheimer's disease research | ad_findings |
cancer |
Cancer genomics | cancer_findings |
microbiome |
Microbiome analysis | microbiome_findings |
generic |
General multi-omics | findings |
custom |
User-defined (see below) | Configurable |
# Input files
feature_importance CSV/shap_feature_importance.csv
cv_results CSV/cv_results.csv
# Domain configuration
domain parkinsons
# LLM settings (auto selects best model for your hardware)
model_name auto
temperature 0.3
max_tokens 1024
# RAG settings
use_rag true
rag_auto_download true
domain custom
custom_domain_name My Research Area
custom_domain_expert_role bioinformatics expert in my field
custom_domain_research_focus identifying biomarkers
custom_domain_feature_suffix my disease
custom_domain_collection my_findings
custom_domain_db_path data/my_literature_db
summary.txt- Plain text summarysummary.md- Markdown-formatted summary with tablessummary.json- Structured findings with metadata
LLMSummarizer/
├── __init__.py # Package exports
├── LLMSummarizer.py # Main plugin class
├── domains.py # Domain configurations
├── hardware.py # Hardware detection & model selection
├── ollama_client.py # Ollama client & server management
├── rag.py # RAG database management
├── scripts/
│ ├── build_rag_database.py # Build literature database
│ ├── query_rag_database.py # Query database CLI
│ ├── upload_rag_to_github.py # Upload to GitHub releases
│ └── release.py # Version management
└── tests/
The plugin automatically detects:
- CPU: Core count
- RAM: Total system memory
- GPU: NVIDIA (via nvidia-smi), AMD (via rocm-smi), Apple Silicon (Metal)
Based on detected hardware, it selects from:
| Model | Size | Min RAM | GPU Recommended |
|---|---|---|---|
| llama3.1:70b | 40GB | 48GB | Yes |
| llama3.1:8b | 4.7GB | 8GB | Yes |
| mistral:7b | 4.1GB | 8GB | Yes |
| phi3:medium | 7.9GB | 12GB | No |
| phi3:mini | 2.2GB | 4GB | No |
| gemma2:2b | 1.6GB | 4GB | No |
| tinyllama:1.1b | 0.6GB | 2GB | No |
# Build Parkinson's disease database
python scripts/build_rag_database.py \
--domain parkinsons \
--email your@email.com \
--max-papers 500
# Build for other domains
python scripts/build_rag_database.py --domain alzheimers --email your@email.com
python scripts/build_rag_database.py --domain cancer --email your@email.compython scripts/query_rag_database.py \
--db data/pd_literature_db \
--query "alpha-synuclein gut microbiome"python scripts/upload_rag_to_github.py \
--db data/pd_literature_db \
--repo quinnjr/LLMSummarizerfrom LLMSummarizer import LLMSummarizer
# Create plugin instance
plugin = LLMSummarizer()
# Load parameters
plugin.input("parameters.txt")
# Run summarization
plugin.run()
# Write outputs
plugin.output("output/summary")from LLMSummarizer import (
detect_hardware,
OllamaClient,
DOMAIN_CONFIGS,
query_literature_database,
)
# Detect hardware
hw = detect_hardware()
print(f"RAM: {hw.ram_gb:.1f}GB, GPU: {hw.gpu_name}")
# Use Ollama client directly
client = OllamaClient(model="llama3", temperature=0.3, max_tokens=1024)
response = client.generate("Summarize this analysis...")
# Query RAG database
findings = query_literature_database(
literature_db="data/pd_literature_db",
collection_name="pd_findings",
key_terms=["SNCA", "alpha-synuclein"],
)# Install test dependencies
pip install -r requirements-test.txt
# Run tests
pytest
# Run with coverage
pytest --cov=. --cov-report=html-
Touvron H, et al. (2023). LLaMA: Open and Efficient Foundation Language Models. arXiv:2302.13971
- Foundation for Llama models
-
Jiang AQ, et al. (2023). Mistral 7B. arXiv:2310.06825
- Mistral model architecture
-
Lewis P, et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. NeurIPS 2020. arXiv:2005.11401
- RAG methodology
-
Guu K, et al. (2020). REALM: Retrieval-Augmented Language Model Pre-Training. ICML 2020. arXiv:2002.08909
- Retrieval-augmented pre-training
- Johnson J, Douze M, Jégou H (2019). Billion-scale similarity search with GPUs. IEEE Transactions on Big Data. arXiv:1702.08734
- FAISS, foundation for vector search
-
Thirunavukarasu AJ, et al. (2023). Large language models in medicine. Nature Medicine, 29:1930-1940. doi:10.1038/s41591-023-02448-8
- LLMs in biomedical applications
-
Singhal K, et al. (2023). Large language models encode clinical knowledge. Nature, 620:172-180. doi:10.1038/s41586-023-06291-2
- Clinical knowledge in LLMs
MIT License
Joseph R. Quinn quinn.josephr@protonmail.com