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 8 |
---
|
| 9 |
|
| 10 |
+
# OpenScriptura
|
| 11 |
+
|
| 12 |
+
> **Open LLMs for Protestant Theology β any tradition, any language, built to last.**
|
| 13 |
+
|
| 14 |
+
[](https://opensource.org/licenses/Apache-2.0)
|
| 15 |
+
[](https://huggingface.co/openscriptura)
|
| 16 |
+
[](https://cefe.ai)
|
| 17 |
+
[](https://python.org)
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
## What is OpenScriptura
|
| 22 |
+
|
| 23 |
+
OpenScriptura is an open-source applied research project that fine-tunes open LLMs with Protestant theological corpus β across **all Protestant traditions** and **all languages**.
|
| 24 |
+
|
| 25 |
+
**The problem:** Existing language models treat questions of faith with excessive neutrality or simply ignore the religious dimension. The CEFEAI benchmark demonstrated that all 27 frontier models tested in 2026 produce **0% predominantly religious responses** to everyday ethical questions, with even the best model (Grok 4.20) ignoring religious perspective 70% of the time.
|
| 26 |
+
|
| 27 |
+
**The solution:** Tradition-specific fine-tuning with high-quality confessional corpus, a three-layer validation pipeline, and scientifically comparable evaluation via CEFEAI.
|
| 28 |
+
|
| 29 |
+
**The scope:** OpenScriptura serves the full breadth of Protestant Christianity β Reformed, Lutheran, Anglican, Baptist, Methodist, Pentecostal, and beyond. Each tradition has its own confessional standards, its own dataset, and its own model variant. We start with Reformed theology in Brazilian Portuguese because that is where we started β not because that is where we end.
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## Scientific Motivation
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
Base models β CEFEAI Religious Representation (May 2026, 150 questions):
|
| 37 |
+
|
| 38 |
+
Grok 4.20 ββββββββββββββββββββ 29.3% Any Representation
|
| 39 |
+
Mistral Large ββββββββββββββββββββ 23.3%
|
| 40 |
+
GPT-5.4 ββββββββββββββββββββ 17.3%
|
| 41 |
+
Qwen3-8B base ββββββββββββββββββββ ~6.0% β our starting point
|
| 42 |
+
Claude Opus 4.7 ββββββββββββββββββββ 4.0%
|
| 43 |
+
Llama 4 Scout ββββββββββββββββββββ 3.3%
|
| 44 |
+
|
| 45 |
+
Predominantly Religious: 0% across all 27 models tested.
|
| 46 |
+
|
| 47 |
+
OpenScriptura v0.1 target: ββββββββββββββββββββ > 60%
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## Protestant Traditions
|
| 53 |
+
|
| 54 |
+
OpenScriptura is designed to serve the full breadth of Protestant Christianity. Each tradition is treated with fidelity to its own confessional standards β there is no attempt to blend incompatible doctrines.
|
| 55 |
+
|
| 56 |
+
| Tradition | Primary Confessional Standards | Status |
|
| 57 |
+
|---|---|---|
|
| 58 |
+
| **Reformed / Calvinist** | Westminster Confession of Faith, Canons of Dort, Heidelberg Catechism, London Baptist Confession 1689 | π **v0.1 β first release** |
|
| 59 |
+
| **Lutheran** | Augsburg Confession (1530), Luther's Small & Large Catechisms, Formula of Concord | π Planned |
|
| 60 |
+
| **Anglican / Episcopal** | Thirty-Nine Articles (1571), Book of Common Prayer | π Planned |
|
| 61 |
+
| **Baptist (Traditional)** | Second London Confession (1689), New Hampshire Confession (1833), Baptist Faith & Message | π Planned |
|
| 62 |
+
| **Methodist / Wesleyan** | Wesley's Articles of Religion, Methodist Discipline | π Planned |
|
| 63 |
+
| **Pentecostal** | Assemblies of God Statement of Fundamental Truths | π Planned |
|
| 64 |
+
| **Congregationalist** | Savoy Declaration (1658) | π Planned |
|
| 65 |
+
| **Other Protestant** | Community contributions welcome | π Open |
|
| 66 |
+
|
| 67 |
+
> **Note on tradition boundaries:** Models are labeled clearly by tradition. A Reformed model will not speak as a Lutheran, and vice versa. Where traditions share common ground (e.g. justification by faith), datasets naturally overlap. Where they diverge (e.g. baptism, Lord's Supper, church governance), each tradition's dataset reflects its own confessional position.
|
| 68 |
+
|
| 69 |
+
---
|
| 70 |
+
|
| 71 |
+
## Published Models
|
| 72 |
+
|
| 73 |
+
| Model | Base | Tradition | Language | CEFEAI RR | Download |
|
| 74 |
+
|---|---|---|---|---|---|
|
| 75 |
+
| `qwen3-8b-reformed-pt-br-v0.1` | Qwen3-8B | Reformed | PT-BR | π pending | [HF Hub](https://huggingface.co/openscriptura/qwen3-8b-reformed-pt-br-v0.1) |
|
| 76 |
+
| `qwen3-8b-lutheran-en-v0.1` | Qwen3-8B | Lutheran | EN | π planned | β |
|
| 77 |
+
| `gpt-oss-20b-v1.0` | GPT-OSS 20B | Multi-tradition | Multilingual | π planned | β |
|
| 78 |
+
|
| 79 |
+
Model naming convention: `openscriptura/{base}-{tradition}-{lang}-{version}`
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
|
| 83 |
+
## Repository Structure
|
| 84 |
+
|
| 85 |
+
```
|
| 86 |
+
openscriptura/
|
| 87 |
+
βββ README.md
|
| 88 |
+
βββ CONTRIBUTING.md
|
| 89 |
+
βββ LICENSE # Apache 2.0
|
| 90 |
+
βββ requirements.txt
|
| 91 |
+
β
|
| 92 |
+
βββ traditions/ # One folder per tradition
|
| 93 |
+
β βββ reformed/
|
| 94 |
+
β β βββ data/
|
| 95 |
+
β οΏ½οΏ½ β βββ tier_c/ # Native Q&A β catechisms
|
| 96 |
+
β β β β βββ westminster_sc.jsonl
|
| 97 |
+
β β β β βββ westminster_lc.jsonl
|
| 98 |
+
β β β β βββ heidelberg.jsonl
|
| 99 |
+
β β β β βββ canons_dort.jsonl
|
| 100 |
+
β β β βββ tier_b/ # Sermons and texts
|
| 101 |
+
β β β βββ tier_a/ # Structured doctrinal topics
|
| 102 |
+
β β βββ configs/
|
| 103 |
+
β β βββ confessions.yaml # WCF, Dort, LCF references
|
| 104 |
+
β βββ lutheran/
|
| 105 |
+
β β βββ data/
|
| 106 |
+
β β βββ configs/
|
| 107 |
+
β β βββ confessions.yaml # Augsburg, Book of Concord
|
| 108 |
+
β βββ anglican/
|
| 109 |
+
β βββ baptist/
|
| 110 |
+
β βββ methodist/
|
| 111 |
+
β βββ pentecostal/
|
| 112 |
+
β
|
| 113 |
+
βββ data/
|
| 114 |
+
β βββ processed/
|
| 115 |
+
β βββ reformed-pt-br-v1.0/
|
| 116 |
+
β β βββ train.jsonl # 4,800 examples (seed=42)
|
| 117 |
+
β β βββ eval.jsonl # 600 examples
|
| 118 |
+
β β βββ test.jsonl # 600 examples (holdout)
|
| 119 |
+
β β βββ manifest.json # SHA-256 per split
|
| 120 |
+
β βββ lutheran-en-v1.0/
|
| 121 |
+
β
|
| 122 |
+
βββ scripts/
|
| 123 |
+
β βββ 00_cefeai_baseline.py
|
| 124 |
+
β βββ 01_extract_tier_c.py
|
| 125 |
+
β βββ 02_extract_tier_b.py
|
| 126 |
+
β βββ 03_confessional_judge.py # Tradition-aware judge
|
| 127 |
+
β βββ 04_merge_dataset.py
|
| 128 |
+
β βββ 05_train.py
|
| 129 |
+
β βββ 06_evaluate.py
|
| 130 |
+
β βββ 07_cefeai_eval.py
|
| 131 |
+
β
|
| 132 |
+
βββ configs/
|
| 133 |
+
β βββ exp_a.yaml # LR=2e-4, rank=32
|
| 134 |
+
β βββ exp_b.yaml # LR=2e-4, rank=64
|
| 135 |
+
β βββ exp_c.yaml # LR=1e-4, rank=32
|
| 136 |
+
β βββ exp_d.yaml # LR=1e-4, rank=64 (default)
|
| 137 |
+
β
|
| 138 |
+
βββ notebooks/
|
| 139 |
+
β βββ 01_baseline_analysis.ipynb
|
| 140 |
+
β βββ 02_dataset_eda.ipynb
|
| 141 |
+
β βββ 03_results_comparison.ipynb
|
| 142 |
+
β
|
| 143 |
+
βββ docs/
|
| 144 |
+
βββ METHODOLOGY.md
|
| 145 |
+
βββ THEOLOGICAL_STATEMENT.md
|
| 146 |
+
βββ ADDING_A_TRADITION.md # Guide: how to add a new tradition
|
| 147 |
+
βββ ADDING_A_LANGUAGE.md # Guide: how to add a new language
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
## Quick Start
|
| 153 |
+
|
| 154 |
+
### Requirements
|
| 155 |
+
|
| 156 |
+
```bash
|
| 157 |
+
Python 3.11+
|
| 158 |
+
CUDA 12.4+
|
| 159 |
+
GPU: RTX 4090 (24GB) minimum for experiments
|
| 160 |
+
A100 80GB recommended for final run
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
### Installation
|
| 164 |
+
|
| 165 |
+
```bash
|
| 166 |
+
git clone https://github.com/openscriptura/openscriptura
|
| 167 |
+
cd openscriptura
|
| 168 |
+
pip install -r requirements.txt --break-system-packages
|
| 169 |
+
cp .env.example .env
|
| 170 |
+
# Edit .env with API keys (OpenRouter, HuggingFace)
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
### Run CEFEAI baseline
|
| 174 |
+
|
| 175 |
+
```bash
|
| 176 |
+
# Cost: ~$0.29 | Time: ~2h
|
| 177 |
+
python scripts/00_cefeai_baseline.py --model qwen/qwen3-8b --benchmark rr
|
| 178 |
+
python scripts/00_cefeai_baseline.py --model qwen/qwen3-8b --benchmark cb
|
| 179 |
+
```
|
| 180 |
+
|
| 181 |
+
### Build the dataset (Reformed PT-BR v0.1)
|
| 182 |
+
|
| 183 |
+
```bash
|
| 184 |
+
python scripts/01_extract_tier_c.py --tradition reformed
|
| 185 |
+
python scripts/02_extract_tier_b.py --tradition reformed --lang pt-BR
|
| 186 |
+
python scripts/03_confessional_judge.py --tradition reformed
|
| 187 |
+
python scripts/04_merge_dataset.py --tradition reformed --seed 42
|
| 188 |
+
```
|
| 189 |
+
|
| 190 |
+
### Fine-tuning
|
| 191 |
+
|
| 192 |
+
```bash
|
| 193 |
+
# Free validation on Kaggle
|
| 194 |
+
python scripts/05_train.py --config configs/exp_d.yaml --tradition reformed --samples 500
|
| 195 |
+
|
| 196 |
+
# Full run β RunPod Secure A100
|
| 197 |
+
python scripts/05_train.py --config configs/exp_d.yaml --tradition reformed --full
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
---
|
| 201 |
+
|
| 202 |
+
## Dataset Schema (v1.0)
|
| 203 |
+
|
| 204 |
+
`tradition` and `language` are first-class fields. The same schema works for any Protestant tradition in any language:
|
| 205 |
+
|
| 206 |
+
```json
|
| 207 |
+
{
|
| 208 |
+
"id": "os_reformed_c_wsc_001",
|
| 209 |
+
"instruction": "What is justification by faith alone?",
|
| 210 |
+
"input": "",
|
| 211 |
+
"output": "Justification is the forensic act by which God declares the sinner righteous...",
|
| 212 |
+
"source": "westminster_sc_q033",
|
| 213 |
+
"tier": "C",
|
| 214 |
+
"tradition": "reformed",
|
| 215 |
+
"confessional_ref": "WCF_11.1",
|
| 216 |
+
"language": "pt-BR",
|
| 217 |
+
"difficulty": "intermediate",
|
| 218 |
+
"annotation_model": "deepseek-v4-flash",
|
| 219 |
+
"validated_by": "gemini-flash-2",
|
| 220 |
+
"confidence": 0.94,
|
| 221 |
+
"confessional_score": 0.91,
|
| 222 |
+
"dataset_version": "v1.0",
|
| 223 |
+
"created_at": "2026-06-07"
|
| 224 |
+
}
|
| 225 |
+
```
|
| 226 |
+
|
| 227 |
+
`tradition` values: `reformed` Β· `lutheran` Β· `anglican` Β· `baptist` Β· `methodist` Β· `pentecostal` Β· `congregationalist`
|
| 228 |
+
|
| 229 |
+
`language` follows BCP 47: `pt-BR` Β· `en` Β· `es` Β· `de` Β· `fr` Β· etc.
|
| 230 |
+
|
| 231 |
+
---
|
| 232 |
+
|
| 233 |
+
## Fine-tuning Configuration
|
| 234 |
+
|
| 235 |
+
```yaml
|
| 236 |
+
# configs/exp_d.yaml β default (OpenMed config D)
|
| 237 |
+
model:
|
| 238 |
+
name: Qwen/Qwen3-8B
|
| 239 |
+
load_in_4bit: true
|
| 240 |
+
bnb_4bit_quant_type: nf4
|
| 241 |
+
bnb_4bit_use_double_quant: true
|
| 242 |
+
|
| 243 |
+
lora:
|
| 244 |
+
r: 64
|
| 245 |
+
lora_alpha: 64
|
| 246 |
+
lora_dropout: 0.05
|
| 247 |
+
target_modules: [q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj]
|
| 248 |
+
|
| 249 |
+
training:
|
| 250 |
+
per_device_train_batch_size: 4
|
| 251 |
+
gradient_accumulation_steps: 4
|
| 252 |
+
num_train_epochs: 3
|
| 253 |
+
learning_rate: 1e-4
|
| 254 |
+
lr_scheduler_type: cosine
|
| 255 |
+
warmup_ratio: 0.05
|
| 256 |
+
bf16: true
|
| 257 |
+
max_seq_length: 2048
|
| 258 |
+
seed: 42
|
| 259 |
+
```
|
| 260 |
+
|
| 261 |
+
**Cost per model variant:** ~$11β17 total (dataset generation + fine-tuning + evaluation).
|
| 262 |
+
|
| 263 |
+
---
|
| 264 |
+
|
| 265 |
+
## Roadmap
|
| 266 |
+
|
| 267 |
+
```
|
| 268 |
+
Phase 1 β Reformed Foundation
|
| 269 |
+
v0.1 Qwen3-8B Β· Reformed Β· PT-BR β we are here
|
| 270 |
+
v0.2 GPT-OSS 20B Β· Reformed Β· PT-BR+EN
|
| 271 |
+
v0.3 Gemma 4 31B Β· Reformed Β· multilingual
|
| 272 |
+
|
| 273 |
+
Phase 2 β Tradition Expansion
|
| 274 |
+
v1.0 Lutheran Β· EN (Book of Concord corpus)
|
| 275 |
+
v1.1 Anglican Β· EN (39 Articles + BCP)
|
| 276 |
+
v1.2 Baptist Β· EN + PT-BR
|
| 277 |
+
|
| 278 |
+
Phase 3 β Community-Driven
|
| 279 |
+
v2.x Methodist, Pentecostal, Congregationalist
|
| 280 |
+
v2.x Spanish, German, indigenous languages
|
| 281 |
+
v3.0 Multi-tradition unified benchmark paper
|
| 282 |
+
```
|
| 283 |
+
|
| 284 |
+
---
|
| 285 |
+
|
| 286 |
+
## Contributing
|
| 287 |
+
|
| 288 |
+
We welcome contributions across all Protestant traditions and languages.
|
| 289 |
+
|
| 290 |
+
**New tradition:** see [`docs/ADDING_A_TRADITION.md`](docs/ADDING_A_TRADITION.md). You need: primary confessional standards, a seed corpus of at least 200 examples, and one person willing to do pastoral review.
|
| 291 |
+
|
| 292 |
+
**New language:** see [`docs/ADDING_A_LANGUAGE.md`](docs/ADDING_A_LANGUAGE.md).
|
| 293 |
+
|
| 294 |
+
**Dataset examples:** open an issue with theological Q&A in any tradition and language. Include the confessional reference.
|
| 295 |
+
|
| 296 |
+
**Doctrinal corrections:** open an issue with the problematic example and the correct reference.
|
| 297 |
+
|
| 298 |
+
**Code:** issues labeled `good first issue`.
|
| 299 |
+
|
| 300 |
+
---
|
| 301 |
+
|
| 302 |
+
## Citation
|
| 303 |
+
|
| 304 |
+
```bibtex
|
| 305 |
+
@misc{openscriptura2026,
|
| 306 |
+
title = {OpenScriptura: Open LLMs for Protestant Theology},
|
| 307 |
+
author = {OpenScriptura Contributors},
|
| 308 |
+
year = {2026},
|
| 309 |
+
howpublished = {\url{https://github.com/openscriptura/openscriptura}},
|
| 310 |
+
note = {Apache 2.0. Multi-tradition, language-agnostic pipeline.
|
| 311 |
+
Benchmarked against CEFEAI AllFaith Benchmark.}
|
| 312 |
+
}
|
| 313 |
+
```
|
| 314 |
+
|
| 315 |
+
---
|
| 316 |
+
|
| 317 |
+
## License
|
| 318 |
+
|
| 319 |
+
Apache 2.0 β see [`LICENSE`](LICENSE). Free use including commercial. Attribution required.
|
| 320 |
+
|
| 321 |
+
---
|
| 322 |
+
|
| 323 |
+
<div align="center">
|
| 324 |
+
|
| 325 |
+
**Soli Deo Gloria**
|
| 326 |
+
|
| 327 |
+
*For the glory of God and the good of the Church β in every tradition and every language.*
|
| 328 |
+
|
| 329 |
+
[HuggingFace](https://huggingface.co/openscriptura) Β· [CEFEAI](https://cefe.ai) Β· [Issues](https://github.com/openscriptura/openscriptura/issues)
|
| 330 |
+
|
| 331 |
+
</div>
|