kailasnath2255/stt-tts

Python

0

0 commits

updated Apr 26, 2026

See the code

README

🎤 STT-TTS Premium Voice Agent v3.3

Premium, low-latency multilingual voice agent pipeline with high-fidelity support for English, Hindi, and Hinglish. Optimized for real-time conversational AI.


🌟 Key Features

  • 🚀 Sub-Second Latency: Optimized for real-time interaction with perceived response times under 2 seconds.
  • 🗣️ Trilingual Mastery: Seamless switching between pure English, pure Hindi (Devanagari), and natural Hinglish (mix).
  • 🔄 Streaming Pipeline: Parallel LLM-to-TTS processing allows audio to start playing while text is still being generated.
  • 🧠 Advanced Reasoning: Dual-model LLM architecture using Gemma-3 and Qwen-2.5 for superior context understanding.
  • 🎙️ Voice Consistency: RNG locking and specialized TTS design for a consistent, natural-sounding persona.
  • 📉 Bandwidth Optimized: Opus/Ogg encoding for audio uploads and Brotli/Zlib for streaming responses.

🛠️ Technology Stack

ComponentModel / ToolOptimization
STTfaster-whisper (Turbo)CUDA float16, Background Queue
LLM (EN/HI)Gemma-3-1B-ITGGUF Q4_K_M (llama-cpp)
LLM (Mix)Qwen2.5-3B-InstructGGUF Q4_K_M (llama-cpp)
TTS (Primary)OmniVoice (bf16)8-step Diffusion, RNG Locked
TTS (Fallback)Kokoro TTSLightweight English Fallback
BackendFastAPIAsynchronous Streaming

📋 Requirements

  • OS: Windows (tested) or Linux (Vast.ai optimized).
  • Python: 3.10+
  • GPU: NVIDIA GPU with 12GB+ VRAM (RTX 3060/3080/3090).
  • RAM: 16GB+
  • Disk: 40GB+ (for model weights).

🚀 Quick Start

1. Setup Environment

python -m venv venv
# Windows
venv\Scripts\activate
# Linux
source venv/bin/activate

pip install -r requirements.txt

2. Start the Server

The server will automatically download necessary model weights on the first run.

python SERVER_UPGRADED_PREMIUM.py

Note: Ensure CUDA drivers are properly configured for llama-cpp-python and torch.

3. Start the Client

Run the interactive client in a separate terminal.

python client.py

Features: Interactive menu, VAD-based recording, and real-time streaming playback.


📊 System Architecture

graph LR
    A[Client Microphone] -->|VAD + Opus| B(FastAPI Server)
    B --> C[Whisper Turbo STT]
    C -->|Text + Lang| D{Language Router}
    D -->|EN/HI| E[Gemma-3-1B]
    D -->|Hinglish| F[Qwen2.5-3B]
    E & F -->|Streaming Text| G[OmniVoice TTS]
    G -->|Interleaved Chunks| H(Client Playback)

⚡ Performance Benchmarks (RTX 3090)

Turn StageLatencyOptimization
Upload0.9 - 1.2sOpus compression
STT0.4 - 1.0sfaster-whisper turbo
LLM90 - 180msGGUF llama-cpp
TTS0.3 - 0.7s8-step diffusion
Total perceived~1.5 - 2.0sPipelining

📂 Project Structure

  • SERVER_UPGRADED_PREMIUM.py: High-performance FastAPI server with trilingual routing.
  • client.py: Advanced CLI client with VAD and streaming playback.
  • PROJECT_GUIDE.md: Detailed technical documentation and architectural deep-dive.
  • requirements.txt: Standardized dependency list.

🔧 Troubleshooting

  • VRAM Issues: If you run out of memory, try lowering n_ctx in the LLM loading section of the server code.
  • CUDA Errors: Ensure LD_LIBRARY_PATH (Linux) or PATH (Windows) includes your CUDA/cuDNN bin directories.
  • Audio Lag: Ensure sounddevice and pyaudio are properly installed. pip install sounddevice soundfile pyaudio.

📝 License

MIT License.

kailasnath2255/stt-tts

Python

0

0 commits

updated Apr 26, 2026

See the code

README

🎤 STT-TTS Premium Voice Agent v3.3

Premium, low-latency multilingual voice agent pipeline with high-fidelity support for English, Hindi, and Hinglish. Optimized for real-time conversational AI.


🌟 Key Features

  • 🚀 Sub-Second Latency: Optimized for real-time interaction with perceived response times under 2 seconds.
  • 🗣️ Trilingual Mastery: Seamless switching between pure English, pure Hindi (Devanagari), and natural Hinglish (mix).
  • 🔄 Streaming Pipeline: Parallel LLM-to-TTS processing allows audio to start playing while text is still being generated.
  • 🧠 Advanced Reasoning: Dual-model LLM architecture using Gemma-3 and Qwen-2.5 for superior context understanding.
  • 🎙️ Voice Consistency: RNG locking and specialized TTS design for a consistent, natural-sounding persona.
  • 📉 Bandwidth Optimized: Opus/Ogg encoding for audio uploads and Brotli/Zlib for streaming responses.

🛠️ Technology Stack

ComponentModel / ToolOptimization
STTfaster-whisper (Turbo)CUDA float16, Background Queue
LLM (EN/HI)Gemma-3-1B-ITGGUF Q4_K_M (llama-cpp)
LLM (Mix)Qwen2.5-3B-InstructGGUF Q4_K_M (llama-cpp)
TTS (Primary)OmniVoice (bf16)8-step Diffusion, RNG Locked
TTS (Fallback)Kokoro TTSLightweight English Fallback
BackendFastAPIAsynchronous Streaming

📋 Requirements

  • OS: Windows (tested) or Linux (Vast.ai optimized).
  • Python: 3.10+
  • GPU: NVIDIA GPU with 12GB+ VRAM (RTX 3060/3080/3090).
  • RAM: 16GB+
  • Disk: 40GB+ (for model weights).

🚀 Quick Start

1. Setup Environment

python -m venv venv
# Windows
venv\Scripts\activate
# Linux
source venv/bin/activate

pip install -r requirements.txt

2. Start the Server

The server will automatically download necessary model weights on the first run.

python SERVER_UPGRADED_PREMIUM.py

Note: Ensure CUDA drivers are properly configured for llama-cpp-python and torch.

3. Start the Client

Run the interactive client in a separate terminal.

python client.py

Features: Interactive menu, VAD-based recording, and real-time streaming playback.


📊 System Architecture

graph LR
    A[Client Microphone] -->|VAD + Opus| B(FastAPI Server)
    B --> C[Whisper Turbo STT]
    C -->|Text + Lang| D{Language Router}
    D -->|EN/HI| E[Gemma-3-1B]
    D -->|Hinglish| F[Qwen2.5-3B]
    E & F -->|Streaming Text| G[OmniVoice TTS]
    G -->|Interleaved Chunks| H(Client Playback)

⚡ Performance Benchmarks (RTX 3090)

Turn StageLatencyOptimization
Upload0.9 - 1.2sOpus compression
STT0.4 - 1.0sfaster-whisper turbo
LLM90 - 180msGGUF llama-cpp
TTS0.3 - 0.7s8-step diffusion
Total perceived~1.5 - 2.0sPipelining

📂 Project Structure

  • SERVER_UPGRADED_PREMIUM.py: High-performance FastAPI server with trilingual routing.
  • client.py: Advanced CLI client with VAD and streaming playback.
  • PROJECT_GUIDE.md: Detailed technical documentation and architectural deep-dive.
  • requirements.txt: Standardized dependency list.

🔧 Troubleshooting

  • VRAM Issues: If you run out of memory, try lowering n_ctx in the LLM loading section of the server code.
  • CUDA Errors: Ensure LD_LIBRARY_PATH (Linux) or PATH (Windows) includes your CUDA/cuDNN bin directories.
  • Audio Lag: Ensure sounddevice and pyaudio are properly installed. pip install sounddevice soundfile pyaudio.

📝 License

MIT License.