Skip to content

JochenYang/shiyu

Repository files navigation

Shiyu Logo

Shiyu Subtitle

An ultra-fast, lightweight, and 100% offline local AI subtitle assistant powered by Tauri, Vue 3, and SenseVoice-Small.

简体中文 | English


Application Preview

Shiyu Subtitle Preview


Shiyu Subtitle is an ultra-fast, lightweight, and 100% offline local AI subtitle assistant designed for creators, developers, and power users. By combining the high-performance speech recognition of SenseVoice-Small with the modern, efficient Tauri + Vue 3 desktop framework, Shiyu delivers a premium, distraction-free subtitle generation and editing experience directly on your local machine.

Key Features

  • 100% Local & Private: No cloud API keys, no network required. Your audio, video, and transcripts never leave your machine.
  • SenseVoice-Small Powered: Ultra-fast voice-to-text inference utilizing optimized ONNX Runtime. Compresses 1 hour of audio transcription into less than 1 minute.
  • Smart Speech Segmentation: Advanced bilingual segmenting algorithms for natural, human-readable line breaks, bypassing model-native limitations.
  • Temporal Offset Compensation: Integrated -150ms latency compensation, perfectly aligning subtitles to the audio waveform and correcting SenseVoice CTC peak delays.
  • Modern & Sleek UI: A premium dark-mode glassmorphism interface featuring smooth micro-animations, synchronized wave previews, and seamless timing navigation.
  • Silent Daemon Management: Seamless, headless backend process lifecycle control. The Python API starts and terminates invisibly alongside the Tauri GUI—no annoying command prompt windows.
  • CI/CD Ready: Ready-to-go GitHub Actions configuration for automated multi-platform compilation (Windows, macOS, and Linux) with platform-native Python packaging.

System Architecture

graph TD
    A[Tauri GUI - Vue 3 / Vite] <-->|Local Localhost API| B[Python Daemon - FastAPI]
    B -->|ONNX Runtime Inference| C[SenseVoice-Small Model]
    A -->|Tauri Command| D[Silent Process Controller]
    D -->|Spawns / Terminates| B
Loading
  • Frontend: Vue 3, Vite, Naive UI, Lucide Icons, Web Audio API
  • Tauri Core: Rust (System windowing, silent process daemonization, registry isolation)
  • Backend: FastAPI, Uvicorn, Python 3.10, ONNX Runtime (SenseVoice inference)

Quick Start (Local Development)

Prerequisites

  • Node.js (v18+) & npm
  • Rust (stable toolchain)
  • Python (3.10.x recommended)

1. Setup Backend

  1. Clone the repository and navigate to the backend folder:
    cd backend
  2. Create a virtual environment and activate it:
    python -m venv venv
    # On Windows:
    .\venv\Scripts\activate
    # On macOS/Linux:
    source venv/bin/activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Download the SenseVoice-Small model (~230 MB) and place it in models/sensevoice-small/:
    # From HuggingFace
    huggingface-cli download SenseVoiceSmall/model-onnx --local-dir models/sensevoice-small/
    
    # Or download the ONNX model directly:
    # Download URL: https://huggingface.co/SenseVoiceSmall/model-onnx/resolve/main/model.onnx
    # Save to: models/sensevoice-small/model.onnx

    ⚠️ The model file is ~230 MB and is not included in the Git repository — download it separately.

2. Setup Frontend & Run Dev

  1. Navigate to the frontend directory:
    cd ../frontend
  2. Install Node dependencies:
    npm install
  3. Run the application in development mode:
    npm run tauri dev

Packaging and Releasing

This repository includes a professional GitHub Actions workflow located at .github/workflows/release.yml.

To compile and package installers for Windows (.msi/.exe), macOS (.dmg), and Linux (.deb) simultaneously:

  1. Push your code to GitHub.
  2. Create and push a version tag:
    git tag v1.0.0
    git push origin v1.0.0
  3. The runner will download the model from HuggingFace, compile Rust code, bundle native Python environments, and publish draft installers to your GitHub Releases.

License

This project is licensed under the MIT License.

About

时语 Shiyu Subtitle - 基于 Tauri + Vue 3 + SenseVoice-Small 的极速、轻量级 100% 离线本地 AI 字幕助手。支持高精度断句与 -150ms 智能时值对齐。Ultra-fast, lightweight & 100% offline local AI subtitle generator.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors