introduce configurable smart sentence splitting with persisted state, UI toggle, and EPUB/PDF contexts that send continuation metadata. enhance TTS pipeline to merge cross-page sentences, manage carryover, and trigger visual page changes during playback for smoother narration. update README with kokoro quick-start guidance, remove the legacy issues mapping doc, and add deterministic TTS mocks plus sample audio for Playwright tests. |
||
|---|---|---|
| .github | ||
| examples | ||
| public | ||
| src | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| Dockerfile | ||
| empty-module.ts | ||
| eslint.config.mjs | ||
| LICENSE | ||
| next.config.ts | ||
| package.json | ||
| playwright.config.ts | ||
| pnpm-lock.yaml | ||
| postcss.config.mjs | ||
| README.md | ||
| tailwind.config.ts | ||
| template.env | ||
| tsconfig.json | ||
OpenReader WebUI 📄🔊
OpenReader WebUI is a document reader with Text-to-Speech capabilities, offering a TTS read along experience with narration for EPUB, PDF, TXT, MD, and DOCX documents. It supports multiple TTS providers including OpenAI, Deepinfra, and custom OpenAI-compatible endpoints like Kokoro-FastAPI and Orpheus-FastAPI
- 🎯 Multi-Provider TTS Support:
- OpenAI: tts-1, tts-1-hd, gpt-4o-mini-tts models with voices (alloy, echo, fable, onyx, nova, shimmer)
- Deepinfra: Kokoro-82M, Orpheus-3B, Sesame-1B models with extensive voice libraries
- Custom OpenAI-Compatible: Any OpenAI-compatible endpoint with custom voice sets
- 💾 Local-First Architecture: Uses IndexedDB browser storage for documents
- 🛜 Optional Server-side documents: Manually upload documents to the next backend for all users to download
- 📖 Read Along Experience: Follow along with highlighted text as the TTS narrates
- 📄 Document formats: EPUB, PDF, TXT, MD, DOCX (with libreoffice installed)
- 🎧 Audiobook Creation: Create and export audiobooks from PDF and ePub files (in m4b format with ffmpeg and aac TTS output)
- 🎨 Customizable Experience:
- 🔑 Select TTS provider (OpenAI, Deepinfra, or Custom OpenAI-compatible)
- 🔐 Set TTS API base URL and optional API key
- 🎨 Multiple app theme options
- And more...
🛠️ Work in progress
- Native .docx support (currently requires libreoffice)
- Accessibility Improvements
🐳 Docker Quick Start
Prerequisites
- Recent version of Docker installed on your machine
- A TTS API server (Kokoro-FastAPI, Orpheus-FastAPI, Deepinfra, OpenAI, etc.) running and accessible
Note: If you have good hardware, you can run Kokoro-FastAPI with Docker locally (see below).
1. 🐳 Start the Docker container:
docker run --name openreader-webui \
--restart unless-stopped \
-p 3003:3003 \
-v openreader_docstore:/app/docstore \
ghcr.io/richardr1126/openreader-webui:latest
(Optionally): Set the TTS API_BASE URL and/or API_KEY to be default for all devices
docker run --name openreader-webui \
--restart unless-stopped \
-e API_KEY=none \
-e API_BASE=http://host.docker.internal:8880/v1 \
-p 3003:3003 \
-v openreader_docstore:/app/docstore \
ghcr.io/richardr1126/openreader-webui:latest
Note: Requesting audio from the TTS API happens on the Next.js server not the client. So the base URL for the TTS API should be accessible and relative to the Next.js server. If it is in a Docker you may need to use
host.docker.internalto access the host machine, instead oflocalhost.
Visit http://localhost:3003 to run the app and set your settings.
Note: The
openreader_docstorevolume is used to store server-side documents. You can mount a local directory instead. Or remove it if you don't need server-side documents.
2. ⚙️ Configure the app settings in the UI:
- Set the TTS Provider and Model in the Settings modal
- Set the TTS API Base URL and API Key if needed (more secure to set in env vars)
- Select your model's voice from the dropdown (voices try to be fetched from TTS Provider API)
3. ⬆️ Updating Docker Image
docker stop openreader-webui && \
docker rm openreader-webui && \
docker pull ghcr.io/richardr1126/openreader-webui:latest
🗣️ Local Kokoro-FastAPI Quick-start (CPU or GPU)
You can run the Kokoro TTS API server directly with Docker. We are not responsible for issues with Kokoro-FastAPI. For best performance, use an NVIDIA GPU (for GPU version) or Apple Silicon (for CPU version).
Note: When using these, set the
API_BASEenv var tohttp://host.docker.internal:8880/v1orhttp://kokoro-tts:8880/v1. You can also use the exampledocker-compose.ymlinexamples/docker-compose.ymlif you prefer Docker Compose.
CPU Version:
docker run -d \
--name kokoro-tts \
--restart unless-stopped \
-p 8880:8880 \
-e ONNX_NUM_THREADS=8 \
-e ONNX_INTER_OP_THREADS=4 \
-e ONNX_EXECUTION_MODE=parallel \
-e ONNX_OPTIMIZATION_LEVEL=all \
-e ONNX_MEMORY_PATTERN=true \
-e ONNX_ARENA_EXTEND_STRATEGY=kNextPowerOfTwo \
-e API_LOG_LEVEL=DEBUG \
ghcr.io/remsky/kokoro-fastapi-cpu:v0.2.4
GPU Version:
docker run -d \
--name kokoro-tts \
--gpus all \
--user 1001:1001 \
--restart unless-stopped \
-p 8880:8880 \
-e USE_GPU=true \
-e PYTHONUNBUFFERED=1 \
-e API_LOG_LEVEL=DEBUG \
ghcr.io/remsky/kokoro-fastapi-gpu:v0.2.4
Note:
- These commands are for running the Kokoro TTS API server only. For issues or support, see the Kokoro-FastAPI repository.
- The GPU version requires NVIDIA Docker support and works best with NVIDIA GPUs. The CPU version works best on Apple Silicon or modern x86 CPUs.
- Adjust environment variables as needed for your hardware and use case.
Dev Installation
Prerequisites
- Node.js & npm or pnpm (recommended: use nvm for Node.js) Optionally required for different features:
- FFmpeg (required for audiobook m4b creation only)
- On Linux:
sudo apt install ffmpeg - On MacOS:
brew install ffmpeg
- On Linux:
- libreoffice (required for DOCX files)
- On Linux:
sudo apt install libreoffice - On MacOS:
brew install libreoffice
- On Linux:
Steps
-
Clone the repository:
git clone https://github.com/richardr1126/OpenReader-WebUI.git cd OpenReader-WebUI -
Install dependencies:
With pnpm (recommended):
pnpm installOr with npm:
npm install -
Configure the environment:
cp template.env .env # Edit .env with your configuration settingsNote: The base URL for the TTS API should be accessible and relative to the Next.js server
-
Start the development server:
With pnpm (recommended):
pnpm devOr with npm:
npm run devor build and run the production server:
With pnpm:
pnpm build pnpm startOr with npm:
npm run build npm startVisit http://localhost:3003 to run the app.
💡 Feature requests
For feature requests or ideas you have for the project, please use the Discussions tab.
🙋♂️ Support and issues
If you encounter issues, please open an issue on GitHub following the template (which is very light).
👥 Contributing
Contributions are welcome! Fork the repository and submit a pull request with your changes.
❤️ Acknowledgements
This project would not be possible without standing on the shoulders of these giants:
- Kokoro-82M model
- Orpheus-TTS model
- Kokoro-FastAPI
- Orpheus-FastAPI
- react-pdf npm package
- react-reader npm package
Docker Supported Architectures
- linux/amd64 (x86_64)
- linux/arm64 (Apple Silicon, Raspberry Pi, SBCs, etc.)
Stack
- Framework: Next.js (React)
- Containerization: Docker
- Storage: IndexedDB (in browser db store)
- PDF:
- EPUB:
- Markdown/Text:
- UI:
- TTS: (tested on)
- Deepinfra API (Kokoro-82M, Orpheus-3B, Sesame-1B)
- Kokoro FastAPI TTS
- Orpheus FastAPI TTS
- NLP: compromise NLP library for sentence splitting
License
This project is licensed under the MIT License.