Full-scale King James Bible app powered by the KJVA AI model — an 18M-param byte-level language model trained on KJV+Apocrypha (val_ppl=3.21).
Stack: Python FastAPI backend · React (Vite) frontend
Training workspace: Tokenless Models — do not mix training code here.
| Feature | Status | Notes |
|---|---|---|
| Verse browser | Live | All 66 books, 36,822 verses |
| Retrieval-augmented completion | Live | Direct ref + prefix match + RAG fallback (per ADR-0003) |
| AI verse completion | Live (Apple Silicon) | KJVA model, byte-level generation; gracefully degrades to retrieval-only when weights absent |
| Semantic search | Phase 2 | Requires embedding adapter |
| Q&A / commentary | Phase 3 | Requires SFT adapter |
| Cross-reference | Phase 4 | Requires embedding similarity index |
cp "<Tokenless Models>/KJVA/training/weights.safetensors" models/kjva/weights.safetensorscd backend
pip install -r requirements.txt
uvicorn main:app --reload --port 8001cd frontend
npm install
npm run dev # → http://localhost:5173Vite proxies /api to the backend at :8001. No CORS configuration needed in dev.
cd frontend && npm run build # outputs to frontend/dist/
cd ../backend && uvicorn main:app --port 8001
# FastAPI serves the React build from dist/ automatically| File | Description |
|---|---|
data/verses.jsonl |
36,822 verse records (book, chapter, verse, text, Strongs, footnotes) |
models/kjva/model_config.json |
Architecture config (8L × d384, 6 heads, vocab=259) |
models/kjva/byte_vocab.json |
Byte vocabulary spec (PAD=0, BOS=1, EOS=2, byte N → N+3) |
models/kjva/weights.safetensors |
Gitignored — copy from Tokenless Models |
models/kjva/provenance.json |
sha256 manifest for tracked model artifacts |
The three raw KJV corpus directories live in the Tokenless Models workspace
and are the canonical READ-ONLY sources. data/verses.jsonl is the
pre-processed structured output that this app consumes.
models/kjva/weights.safetensors— gitignored; sha256 tracked inprovenance.json- Training scripts, PEFT methods, checkpoints — live in Tokenless Models, not here
do_not_import_global_claude_codex_state: true— do not import.claude/.codexglobally
POST /api/complete resolves prompts in this order (see ADR-0003):
- Direct reference —
John 3:16,Numbers 15:37-41,Prov 31→ returns verse text,retrieved=true. - Text prefix / keyword match —
In the beginning God→ returns the rest of the matched verse. - RAG-augmented AI fallback — prose prompts get a corpus-context block, then the 18M model generates.
- Raw AI — fallthrough.
Retrieval branches do not require weights. The endpoint stays useful in CI, in Docker on linux/amd64, and any host without MLX. When retrieval misses and weights are absent, the endpoint returns a structured 503 {error, fix}.
cd backend && python -m pytest tests/ -v29 tests cover corpus retrieval, all /api/verse* routes, /api/complete retrieval branches, validation, and stub endpoints.
docker compose build backend
docker compose up -d backend
curl -fsS http://localhost:8000/api/healthBy default the container runs in retrieval-only mode. To enable AI fallback on an Apple Silicon host, uncomment the weights volume in docker-compose.yml.
MIT.