
# OpenPrism
### OpenPrism โ Vibe Writing for Academia
[](https://nodejs.org/)
[](LICENSE)
[](https://github.com/OpenDCAI/OpenPrism/stargazers)
[](https://github.com/OpenDCAI/OpenPrism/network/members)
[](https://github.com/OpenDCAI/OpenPrism/issues)
[](https://github.com/OpenDCAI/OpenPrism/pulls)
[ไธญๆ](README_ZH.md) | [English](/)
---
### โจ Highlights
| ๐ค AI Assistant | โ๏ธ Compile & Preview | ๐ Templates |
|:---:|:---:|:---:|
| Chat / Agent history
Tools multi-step edits | TexLive / Tectonic / Auto
PDF preview & download | ACL / CVPR / NeurIPS / ICML
One-click conversion |
| ๐ Template Transfer | | |
|:---:|:---:|:---:|
| Legacy (LaTeXโLaTeX) / MinerU (PDFโMDโLaTeX)
LLM-powered migration + auto compile fix + VLM layout check | | |
| ๐ง Advanced Editing | ๐๏ธ Project Management | โ๏ธ Configuration |
|:---:|:---:|:---:|
| AI autocomplete / Diff / diagnose | Multi-project + file tree + upload | OpenAI-compatible endpoint
Local-first privacy |
| ๐ Search | ๐ Charting | ๐ง Recognition |
|:---:|:---:|:---:|
| WebSearch / PaperSearch | Chart from tables | Formula/Chart recognition |
| ๐ฅ Collaboration | ๐ Peer Review | |
|:---:|:---:|:---:|
| Multi-user real-time editing
Cursor sync & online management | AI Review Report / Consistency
Missing Citations / Compile Summary | |
---
๐ข News
[!WARNING]
๐ง Template Transfer is under testing
The Template Transfer feature is currently in beta and may contain known or unknown bugs. If you encounter any issues, please report them via Issues.
[!TIP]
๐ 2025-02 ยท Template Transfer (Dual Mode)
Two transfer modes are now available: Legacy mode (LaTeXโLaTeX direct migration) and MinerU mode (PDFโMarkdownโLaTeX via MinerU API). Both modes feature LLM-powered content migration, automatic compile error fixing, and optional VLM-based layout checking.
[!TIP]
๐ 2025-02 ยท Real-time Collaboration
Multi-user simultaneous editing is now available, powered by CRDT with automatic conflict resolution and cursor sync. Current version requires a server with a public IP; invite remote collaborators via token-based links.
โจ Home preview: three-panel workspace + editor + preview
โจ Core Features
OpenPrism is a local-first LaTeX + AI workspace for academic writing, optimized for fast editing, controlled changes, and privacy.
๐ค AI Assistant
- Chat mode: read-only Q&A
- Agent mode: generate diffs for confirmation
- Tools mode: multi-step tools + multi-file edits
- Tasks: polish, rewrite, restructure, translate, custom
- Autocomplete: Option/Alt + / or Cmd/Ctrl + Space, Tab to accept
โ๏ธ Compile & Preview
- Engines: TexLive / Tectonic / Auto fallback
- Preview toolbar: zoom, fit width, 100%, download PDF
- Compile log: error parsing + one-click diagnose + jump to error
- Views: PDF / Figures / Diff
๐ Template System
- Built-ins: ACL / CVPR / NeurIPS / ICML
- Conversion: one-click template switch with content preserved
๐ Template Transfer
- Dual mode: Legacy (LaTeXโLaTeX) and MinerU (PDFโMarkdownโLaTeX)
- MinerU integration: parse PDF via MinerU API, extract Markdown + images, then fill into target template
- LLM-powered migration: AI analyzes source/target structure, drafts transfer plan, and applies content mapping
- Auto compile fix: automatically detect and fix LaTeX compilation errors with retry loop
- VLM layout check: optional visual layout validation using VLM to detect overflow, overlap, and spacing issues
- Asset handling: automatic copy of images, bib files, and style files from source to target
๐๏ธ Project Management
- Projects panel: manage multiple projects
- File tree: create/rename/delete/upload/drag
- BibTeX: quick create
references.bib
โ๏ธ Configuration
- LLM Endpoint: OpenAI-compatible, supports custom base_url
- Local storage: settings saved to browser localStorage
- TexLive config: customizable TexLive resources
- Language switch: toggle ไธญๆ/English in the top bar
๐ Search & Reading
- WebSearch: online search with summaries
- PaperSearch: academic paper search with citation info
๐ Charts & Recognition
- Table-to-chart: generate charts directly from tables
- Smart recognition: formulas and charts auto-detected
๐ Peer Review
- AI Quality Check: automated paper quality assessment
- Full Review Report: generate detailed reviewer-style review comments
- Consistency Check: terminology and symbol consistency detection
- Missing Citations: find statements that need citations
- Compile Log Summary: summarize compile errors and fix suggestions
๐ฅ Real-time Collaboration
- Multi-user editing: multiple users edit the same document simultaneously with real-time sync
- Cursor & selection sync: each userโs cursor displayed in a distinct color, visible in real time
- Online user list: collaboration panel shows currently connected users and their status
- Invite to collaborate: invite others via link or token to join the editing session
๐จ Showcase
๐ฅ๏ธ Three-Panel Workspace
โจ AI Assistant | LaTeX Editor | PDF Preview
โ๏ธ Editor View
โจ Synchronized editing and preview
๐ค Agent Mode
โจ Generate diff suggestions for review
๐งช One-Click Diagnose
โจ Parse compile errors and jump to locations
๐ WebSearch
โจ Online search with concise summaries
๐ PaperSearch
โจ Academic search and citation info
๐ Table-to-Chart
โจ Turn tables into charts in one step
โจ Recognize structures for editable outputs
๐ง AI Autocomplete
โจ Option/Alt + / to trigger, Tab to accept
๐ Peer Review
โจ AI Quality Check: Review Report / Consistency Check / Missing Citations / Compile Summary
๐ฅ Real-time Collaboration
โจ Multi-user real-time collaborative editing with cursor sync and online user management
๐ Quick Start
๐ Requirements
Basic Environment
- Node.js >= 18.0.0
- npm >= 9.0.0
- OS: Windows / macOS / Linux
LaTeX Compilation Environment (Required)
OpenPrism requires a LaTeX engine to generate PDFs. Choose one of the following options based on your OS:
Option 1: TexLive (Recommended)
- Linux (Ubuntu/Debian):
sudo apt-get update
sudo apt-get install texlive-full
- Linux (CentOS/RHEL):
sudo yum install texlive texlive-*
- macOS:
brew install --cask mactex
- Windows: Download TexLive installer
Option 2: Tectonic (Lightweight)
- Linux/macOS:
curl --proto '=https' --tlsv1.2 -fsSL https://drop-sh.fullyjustified.net | sh
- Windows: Download Tectonic installer
Note: TexLive full installation is ~5-7GB, Tectonic is lighter but with fewer features. TexLive is recommended for Linux servers.
๐ฆ Install & Run
Development Deployment
# 1. Clone repository
git clone https://github.com/OpenDCAI/OpenPrism.git
cd OpenPrism
# 2. Install dependencies
npm install
# 3. Start dev server (frontend + backend)
npm run dev
Access:
- Frontend: http://localhost:5173
- Backend: http://localhost:8787
Production Deployment
# 1. Build frontend and backend
npm run build
# 2. Start production server
npm start
Complete Linux Server Deployment Example
# 1. Install Node.js (Ubuntu example)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# 2. Install TexLive
sudo apt-get update
sudo apt-get install -y texlive-full
# 3. Verify installation
node --version # Should show >= 18.0.0
pdflatex --version # Should show TexLive version
# 4. Clone and deploy project
git clone https://github.com/OpenDCAI/OpenPrism.git
cd OpenPrism
npm install
npm run build
# 5. Configure environment variables (optional)
cat > .env << EOF
OPENPRISM_LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
OPENPRISM_LLM_API_KEY=your-api-key
OPENPRISM_LLM_MODEL=gpt-4o-mini
OPENPRISM_DATA_DIR=/var/openprism/data
PORT=8787
EOF
# 6. Start service
npm start
# 7. Use PM2 for process management (recommended)
sudo npm install -g pm2
pm2 start npm --name "openprism" -- start
pm2 save
pm2 startup
โ๏ธ Configuration
Environment Variables
Create a .env file in the project root (optional):
# LLM Configuration
OPENPRISM_LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
OPENPRISM_LLM_API_KEY=your-api-key
OPENPRISM_LLM_MODEL=gpt-4o-mini
# Data storage path
OPENPRISM_DATA_DIR=./data
# Backend service port
PORT=8787
# MinerU API Configuration (for PDFโMDโLaTeX transfer)
OPENPRISM_MINERU_API_BASE=https://mineru.net/api/v4
OPENPRISM_MINERU_TOKEN=your-mineru-token
LLM Configuration
OpenPrism supports any OpenAI-compatible endpoint, including custom base_url:
Method 1: Environment Variables
# .env file
OPENPRISM_LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
OPENPRISM_LLM_API_KEY=sk-your-api-key
OPENPRISM_LLM_MODEL=gpt-4o-mini
Method 2: Frontend Settings Panel
- Click the โSettingsโ button in the frontend interface
- Fill in API Endpoint, API Key, and Model
- Configuration is automatically saved to browser localStorage
โจ LLM Configuration Settings Panel
Supported Third-party Services:
- OpenAI:
https://api.openai.com/v1
- Azure OpenAI:
https://your-resource.openai.azure.com/openai/deployments/your-deployment
- Other compatible services:
https://api.apiyi.com/v1
LaTeX Compilation Configuration
Supported Compilation Engines:
pdflatex - Standard LaTeX engine
xelatex - Supports Unicode and Chinese
lualatex - Supports Lua scripting
latexmk - Automated build tool
tectonic - Modern lightweight engine
Configuration Method:
- Select compilation engine in frontend โSettingsโ panel
- Set to โAutoโ for automatic fallback to available engines
- Customize TexLive resource path
Data Storage Configuration
Default data storage is in ./data directory, can be modified via environment variable:
# Custom data directory
OPENPRISM_DATA_DIR=/var/openprism/data
Directory Structure:
data/
โโโ projects/ # User projects
โ โโโ project-1/
โ โ โโโ main.tex
โ โ โโโ references.bib
โ โโโ project-2/
โโโ templates/ # Template cache
๐ฅ Collaboration Guide
OpenPrism includes a built-in real-time collaboration system based on CRDT (Yjs) + WebSocket, allowing multiple users to edit the same document simultaneously without any third-party service.
Collaboration Environment Variables
Add the following to your .env file:
# Token signing secret (must change for production)
OPENPRISM_COLLAB_TOKEN_SECRET=your-secure-random-string
# Require token for collaboration (default: true, set false for local dev)
OPENPRISM_COLLAB_REQUIRE_TOKEN=true
# Token TTL in seconds (default: 86400 = 24 hours)
OPENPRISM_COLLAB_TOKEN_TTL=86400
How to Use
- Deploy: Deploy OpenPrism to a server with a public IP, configure a domain and HTTPS
- Generate invite: Click โGenerate Invite Linkโ in the collaboration panel on the editor page
- Share link: Send the generated link to your collaborator
- Join: Collaborator opens the link, token is verified automatically, and they enter the editor
- Edit together: Multiple cursors visible in real time, edits sync automatically, conflicts resolved by CRDT
Nginx Reverse Proxy (Recommended, For Public Servers)
Collaboration requires WebSocket. Nginx must be configured with upgrade headers:
```nginx
server {
listen 443 ssl;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:8787;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}
```
> **Tip**: Local access (127.0.0.1) bypasses token verification by default, suitable for local development.
No Public Server? Use Tunnel (ngrok)
You can collaborate remotely without a public server. OpenPrism has built-in tunnel support โ one command exposes your local service to the internet.
#### Quick Start (ngrok, Recommended)
1. Sign up for a free [ngrok](https://dashboard.ngrok.com/get-started/your-authtoken) account and get your authtoken
2. Run the following commands:
```bash
export NGROK_AUTHTOKEN=your_token_here
npm run tunnel:ngrok
```
3. On startup, the terminal prints a public URL. Share it with your collaborator:
```
OpenPrism started at http://localhost:8787
Tunnel active (ngrok):
Public URL: https://xxxx.ngrok-free.app
Share this URL to collaborate remotely!
```
4. Your collaborator opens the URL in their browser and starts editing in real-time
#### Other Tunnel Options
| Option | Command | Notes |
|--------|---------|-------|
| localtunnel | `npm run tunnel` | Zero-config, but may be unstable |
| Cloudflare Tunnel | `npm run tunnel:cf` | Requires [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/) installed |
> **Note**: Tunnel is off by default. Regular `npm start` does not create a tunnel. You can also set it via env var: `OPENPRISM_TUNNEL=ngrok npm start`
๐ฏ Usage Guide (Quick)
- Create Project: Create new project in Projects panel and select template
- Write Paper: Edit LaTeX in Files tree
- AI Edits: Switch to Agent / Tools, generate diff and confirm
- Compile & Preview: Click โCompile PDFโ, preview on right side
- Export PDF: Click โDownload PDFโ in preview toolbar
๐ Project Structure
OpenPrism/
โโโ apps/
โ โโโ frontend/ # React + Vite frontend
โ โ โโโ src/
โ โ โ โโโ app/App.tsx # Main application logic
โ โ โ โโโ app/TransferPanel.tsx # Template transfer UI
โ โ โ โโโ api/client.ts # API calls
โ โ โ โโโ latex/ # TexLive integration
โ โโโ backend/ # Fastify backend
โ โโโ src/
โ โโโ index.js # API / compile / LLM proxy
โ โโโ routes/transfer.js # Transfer API endpoints
โ โโโ services/
โ โโโ mineruService.js # MinerU API integration
โ โโโ transferAgent/ # LangGraph transfer workflows
โ โโโ graph.js # Legacy transfer graph
โ โโโ graphMineru.js # MinerU transfer graph
โ โโโ state.js # Transfer state schema
โ โโโ nodes/ # Workflow nodes
โโโ templates/ # LaTeX templates (ACL/CVPR/NeurIPS/ICML)
โโโ data/ # Project storage directory (default)
โโโ README.md
๐บ๏ธ Roadmap
| Feature |
Status |
Description |
| ๐ฅ Real-time Collaboration |
 |
Multi-user real-time editing with cursor sync and online user management (currently requires a server with public IP) |
| ๐ Serverless Collaboration |
 |
Local collaboration without a public server: โ built-in tunnel integration (ngrok / Cloudflare Tunnel) to expose local services in one click; โก WebRTC-based P2P direct connection without third-party relay |
| ๐ Enhanced WebSearch |
 |
Integrate third-party Search APIs (e.g. Google / Baidu / SerpAPI) for improved search quality and coverage |
| ๐ Template Transfer (Dual Mode) |
 |
Legacy (LaTeXโLaTeX) and MinerU (PDFโMDโLaTeX) dual-mode template transfer with LLM-powered migration, auto compile fix, and VLM layout check |
| ๐ธ Version Snapshots & Rollback |
 |
Project version management with snapshot saving and one-click rollback |
| ๐ Citation Search Assistant |
 |
Auto-search related papers and generate BibTeX citations |
๐ค Contributing
Welcome to submit Issues or PRs:
- Fork the repository
- Create a new branch
- Commit your changes
- Submit a PR
Development commands:
npm run dev
npm run dev:frontend
npm run dev:backend
npm run build
๐ License
MIT License. See LICENSE.
๐ Acknowledgments
- Tectonic
- CodeMirror
- PDF.js
- LangChain
- React / Fastify
**If this project helps you, please give us a โญ๏ธ Star!**
[](https://github.com/OpenDCAI/OpenPrism/stargazers)
[](https://github.com/OpenDCAI/OpenPrism/network/members)
Scan to join the community WeChat group
Made with โค๏ธ by OpenPrism Team