ScholarVerse is a self-hosted academic research platform for literature, linguistics, and humanities work. The stack in this repo is built around evidence-first retrieval, citation traceability, asynchronous document intelligence, and open-source inference endpoints instead of proprietary hosted AI APIs.
scholarverse-web/Next.js 16 App Router frontend and server routes.migrations/InsForge/PostgreSQL schema with pgvector-backed RAG tables, policies, and retrieval SQL.services/ingestion-worker/FastAPI + Redis Queue ingestion service for OCR, metadata extraction, chunking, and callback delivery.docker-compose.ymlLocal orchestration for the web app, Redis, vLLM, optional Ollama, and the ingestion services.docs/architecture.mdProduction deployment notes and system flow.scholarverse-web/training/Fine-tuning dataset export and supervised training helpers.
scholarverse-webhandles the research workspace, streaming responses, admin surface, and upload entrypoint.- InsForge owns authentication, PostgreSQL, pgvector persistence, storage buckets, and chat/document metadata once the project is linked.
- A self-hosted OpenAI-compatible endpoint, preferably vLLM, serves the primary research model and embedding model.
- The ingestion worker performs OCR, parsing, semantic segmentation, duplicate detection, and callback delivery asynchronously through Redis-backed jobs.
- Retrieval happens before generation. The app is designed to pass page-scoped source excerpts into the generation step and surface citations back to the user interface.
-
Copy
.env.exampleto.envand fill the InsForge and model settings. -
Install the web app dependencies:
cd scholarverse-web npm install -
Run the web app:
npm run dev
-
Start the worker stack when you want document ingestion or self-hosted inference:
docker compose up redis vllm ingestion-api ingestion-worker
-
Apply the database schema to your linked InsForge project:
npx @insforge/cli whoami --json npx @insforge/cli current --json npx @insforge/cli db migrations up --all
ScholarVerse now includes a practical prompt-to-training path:
-
Export grounded chat examples from the live corpus and saved conversations:
cd scholarverse-web npm run finetune:export -- --output training/datasets/scholarverse-sft.jsonl -
Train a ScholarVerse-specific model adapter:
uv run training/train_scholarverse_sft.py \ --dataset training/datasets/scholarverse-sft.jsonl \ --model Qwen/Qwen2.5-32B-Instruct \ --output-dir training/output/scholarverse-qwen-sft
-
Serve the tuned checkpoint from infrastructure you control and point
SELF_HOSTED_CHAT_MODELat it.
- Frontend: Vercel or InsForge-managed frontend deployment from
scholarverse-web/ - Backend primitives: InsForge
- Self-hosted inference: dedicated GPU server running vLLM
- Async ingestion: containerized FastAPI + RQ worker on a compute service
- Redis: managed or self-hosted Redis for queueing
The web app runs in a demo-backed mode until you provide real InsForge and self-hosted AI environment variables. That fallback is deliberate: it keeps the interface operable while you wire the actual infrastructure.