Skip to content

About

An end-to-end, high-performance Nepali Voice Agent and Neural Text-to-Speech (TTS) system featuring voice cloning, automated speech recognition (STT), bilingual translation pipelines, and local LLM intelligence.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🇳🇵 Nepali Voice AI Assistant & Chatterbox TTS

An end-to-end, high-performance Nepali Voice Agent and Neural Text-to-Speech (TTS) system featuring voice cloning, automated speech recognition (STT), bilingual translation pipelines, and local LLM intelligence.


🌟 Overview & Architecture

The Nepali Voice Agent provides dual operating modes for natural conversational voice interaction:

1. Translation Pipeline (translate mode)

🎤 User (Nepali Speech)
   │
   ▼
[1. Speech Recognition (STT)] ──> aamoshdahal/whisper-small-nepali (Devanagari text)
   │
   ▼
[2. Machine Translation]      ──> IndicTrans2 (Nepali ➔ English)
   │
   ▼
[3. LLM Reasoning]           ──> Gemma 4 (via Ollama, concise English response)
   │
   ▼
[4. Machine Translation]      ──> IndicTrans2 (English ➔ Nepali)
   │
   ▼
[5. Neural TTS Engine]        ──> Chatterbox Nepali Edition (or Kala-TTS)
   │
   ▼
🔊 Output Speech (Synthesized Nepali Audio)

2. Direct Pipeline (direct mode)

🎤 User (Nepali Speech)
   │
   ▼
[1. Speech Recognition (STT)] ──> aamoshdahal/whisper-small-nepali (Devanagari text)
   │
   ▼
[2. LLM Reasoning in Nepali]  ──> Gemma 4 (via Ollama, direct Devanagari generation)
   │
   ▼
[3. Neural TTS Engine]        ──> Chatterbox Nepali Edition (or Kala-TTS)
   │
   ▼
🔊 Output Speech (Synthesized Nepali Audio)

✨ Features

  • 🎙️ Zero-Shot Voice Cloning: High-fidelity zero-shot speaker cloning using a 5–10 second reference audio clip with Chatterbox TTS.
  • 🇳🇵 Full Devanagari Support: Custom tokenizers and alignment analyzers adapted to prevent early cutoff on complex conjuncts and long Nepali vowels.
  • ⚡ Dual Engine Voice Synthesis:
    • Chatterbox Nepali Edition: State-of-the-art multi-speaker neural TTS fine-tuned on Nepali speech.
    • Kala-TTS: Fast, lightweight Nepali phoneme-based fallback.
  • 🌐 Modern Interactive Web Dashboard: Real-time microphone audio recording, voice selection, sample uploading, and instant playback.
  • 💻 CLI & Diagnostics: Command-line interactive assistant (nepali_assistant_v2.py) and STT diagnostics suite (diagnose_stt.py).
  • 🚀 GPU/CPU Optimization: Designed to run efficiently on consumer GPUs (e.g. RTX 40/50 series) and Apple Silicon (MPS).

📂 Project Structure

├── chatterbox-nepali-edition/  # Chatterbox TTS Nepali fork (models, tokenizer, trainer)
│   ├── src/chatterbox/        # TTS source modules (T3, S3Gen, S3Tokenizer, Voice Encoder)
│   ├── gradio_nepali.py       # Standalone Gradio interface for Nepali TTS
│   ├── test_nepali.py         # TTS benchmarking & generation script
│   └── pyproject.toml         # Package definition
├── static/                    # Frontend Web UI (HTML5, CSS3, Vanilla JS)
│   ├── index.html             # Web app interface
│   ├── style.css              # Custom styling
│   └── app.js                 # Audio recording & WebSocket/HTTP handling
├── checkpoints/               # Model weights directory (e.g., t3_nepali_epoch_20.pt)
├── samples/                   # Reference speaker samples (e.g., Achyut Ghimire)
├── server.py                  # FastAPI server & real-time REST/SSE endpoints
├── nepali_assistant_v2.py     # Terminal/CLI voice assistant interface
├── diagnose_stt.py            # STT testing and diagnostic script
├── requirements.txt           # Python package dependencies
└── .gitignore                 # Excludes caches, venv, audio files, and model weights

🛠️ Prerequisites & Installation

1. Clone the Repository

git clone https://github.com/Nishchal-ll/voice-agent.git
cd voice-agent

2. Set Up Python Environment

Python 3.10 or 3.11 is recommended.

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install --upgrade pip
pip install -r requirements.txt

# Install Chatterbox Nepali module in editable mode
pip install -e ./chatterbox-nepali-edition

3. Install & Start Ollama

Install Ollama and pull the LLM model:

ollama pull gemma4:e2b-it-qat

4. Model Checkpoints & Reference Audio

  • Download the Chatterbox Nepali checkpoint (t3_nepali_epoch_20.pt) from Hugging Face and place it under checkpoints/t3_nepali_epoch_20.pt.
  • Place reference audio files (e.g. achyut_ref_10s.wav) in samples/.

🚀 Running the Project

1. Launch the Web Assistant (FastAPI Server)

python3 server.py

Open your browser and navigate to http://localhost:8000 to interact with the voice assistant.

2. Run the CLI Voice Assistant

python3 nepali_assistant_v2.py

Press Enter to start recording from your microphone, and Enter again to submit.

3. Run Chatterbox Standalone Gradio Demo

cd chatterbox-nepali-edition
export PYTHONPATH=src
python3 gradio_nepali.py

4. Run STT Diagnostics

python3 diagnose_stt.py

📚 Citations & Acknowledgments

This project builds upon open-source research and community models:

  1. Whisper Small Nepali (STT)

  2. IndicTrans2 (Machine Translation)

    • Models: ai4bharat/indictrans2-indic-en-dist-200M, ai4bharat/indictrans2-en-indic-dist-200M
    • Repository: AI4Bharat IndicTrans2
    • Citation:
      @article{gala2023indictrans2,
        title={IndicTrans2: Towards High-Quality and Accessible Machine Translation Models for all 22 Scheduled Indian Languages},
        author={Gala, Jay and others},
        journal={Transactions on Machine Learning Research},
        year={2023}
      }
  3. Gemma (Language Model)

    • Provider: Google DeepMind
    • Serving: Ollama
  4. Chatterbox TTS & Resemble AI

    • Base Architecture: Resemble AI Chatterbox
    • Nepali Fine-tuning & Devanagari Patching: officialuser & contributors
  5. Kala TTS


📄 License

This repository is distributed under the MIT License. Check individual submodules and models for their respective licensing terms.

About

An end-to-end, high-performance Nepali Voice Agent and Neural Text-to-Speech (TTS) system featuring voice cloning, automated speech recognition (STT), bilingual translation pipelines, and local LLM intelligence.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages