No description
Find a file
Richard Roberson b21bdb3a21 feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints
Add comprehensive multi-provider TTS support enabling users to choose between OpenAI, Deepinfra, and custom OpenAI-compatible endpoints. Implement provider-specific voice management with automatic voice restoration per provider-model combination, and migrate package manager to pnpm for improved dependency handling.

Key changes:
- Add TTS provider selection (OpenAI, Deepinfra, custom-openai) in settings UI
- Implement provider-specific model and voice lists with dynamic fetching
- Add voice persistence per provider-model combination in savedVoices
- Support Deepinfra models: Kokoro-82M, Orpheus-3B, Sesame-1B with their voice libraries
- Migrate to pnpm with frozen lockfile for reproducible builds
- Update Docker configuration to use pnpm and Deepinfra API defaults
- Add migration logic for existing users to infer provider from stored baseUrl
- Update test helpers and Playwright configuration for Deepinfra API
- Add example docker-compose.yml with Kokoro-FastAPI integration

BREAKING CHANGE: Voice selection is now provider-model specific. Previously saved voices will be migrated to the new savedVoices structure, but users may need to reselect voices if switching providers.
2025-11-09 15:47:17 -07:00
.github feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
examples feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
public add DOCX support (requires libreoffice) + upload test 2025-03-04 22:47:37 -07:00
src feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
tests feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
.gitattributes Fix check mark in SettingsModal 2025-02-11 21:31:11 -07:00
.gitignore Add editable page number in PDF navigator view, to make it much easier to jump to specific pages 2025-06-20 08:32:53 +02:00
.npmrc feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
Dockerfile feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
empty-module.ts First push 2025-01-18 04:58:57 -07:00
eslint.config.mjs First push 2025-01-18 04:58:57 -07:00
LICENSE Initial commit 2025-01-18 00:36:14 -07:00
next.config.ts Change go to page + add Vercel Analytics integration 2025-06-30 12:10:56 -06:00
package.json feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
playwright.config.ts implement retry logic for TTS API calls and clean up code 2025-03-03 23:03:52 -07:00
pnpm-lock.yaml feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
postcss.config.mjs First push 2025-01-18 04:58:57 -07:00
README.md feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints 2025-11-09 15:47:17 -07:00
tailwind.config.ts Fix mardown viewer text color 2025-04-15 11:41:26 -06:00
template.env Rely on TTS API for splitting 2025-02-25 00:58:32 -07:00
tsconfig.json First push 2025-01-18 04:58:57 -07:00

GitHub Stars GitHub Forks GitHub Watchers GitHub Issues GitHub Last Commit GitHub Release

Discussions

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
    • Provider-specific voice management with automatic voice restoration per provider-model combination
  • 💾 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

1. 🐳 Start the Docker container:

docker run --name openreader-webui \
  -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 \
  -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.internal to access the host machine, instead of localhost.

Visit http://localhost:3003 to run the app and set your settings.

Note: The openreader_docstore volume 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

(Alternate) 🐳 Configuration with Docker Compose and Kokoro-FastAPI

A complete example docker-compose file with Kokoro-FastAPI and OpenReader WebUI is available in examples/docker-compose.yml. You can download and use it:

mkdir -p openreader-compose
cd openreader-compose
curl -O https://raw.githubusercontent.com/richardr1126/OpenReader-WebUI/main/examples/docker-compose.yml
docker compose up -d

Or add OpenReader WebUI to your existing docker-compose.yml:

services:
  openreader-webui:
    container_name: openreader-webui
    image: ghcr.io/richardr1126/openreader-webui:latest
    environment:
      - API_BASE=http://host.docker.internal:8880/v1
    ports:
      - "3003:3003"
    volumes:
      - docstore:/app/docstore
    restart: unless-stopped

volumes:
  docstore:

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
  • libreoffice (required for DOCX files)
    • On Linux: sudo apt install libreoffice
    • On MacOS: brew install libreoffice

Steps

  1. Clone the repository:

    git clone https://github.com/richardr1126/OpenReader-WebUI.git
    cd OpenReader-WebUI
    
  2. Install dependencies:

    With pnpm (recommended):

    pnpm install
    

    Or with npm:

    npm install
    
  3. Configure the environment:

    cp template.env .env
    # Edit .env with your configuration settings
    

    Note: The base URL for the TTS API should be accessible and relative to the Next.js server

  4. Start the development server:

    With pnpm (recommended):

    pnpm dev
    

    Or with npm:

    npm run dev
    

    or build and run the production server:

    With pnpm:

    pnpm build
    pnpm start
    

    Or with npm:

    npm run build
    npm start
    

    Visit 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:

Docker Supported Architectures

  • linux/amd64 (x86_64)
  • linux/arm64 (Apple Silicon, Raspberry Pi, SBCs, etc.)

Stack

License

This project is licensed under the MIT License.