Advanced Speech-to-Text Microservices Architecture
The STT Pipeline is a robust, modular system designed for high-accuracy audio transcription, enhancement, and speaker diarization. It primarily processes Vietnamese audio but is extensible to other languages.
Before you begin, ensure your system meets the following requirements:
For detailed information about the system, please refer to the docs/ directory:
Follow these steps to set up and run the STT Pipeline:
Execute the quick setup script to initialize directories, create environment files, and check for dependencies.
./scripts/setup.sh
The setup script creates a .env file. You must edit this file to configure essential services.
nano .env
Critical Configuration:
HF_TOKEN: Required for Speaker Diarization. Get your token from Hugging Face and accept the user agreements for pyannote/speaker-diarization-3.1 and pyannote/segmentation-3.0.ENABLE_DIARIZATION: Optional (default: false). Set to true to enable speaker diarization and alignment. Note: requiring Hugging Face token and additional services.LLM_BASE_URL: Set this if you plan to use LLM for post-processing refinement (see Troubleshooting below).Download the AI models required for the pipeline.
./scripts/model-downloaders/download_models.sh
Build the Docker images and start the backend microservices.
docker compose build
docker compose up -d
Wait for the services to initialize. You can check the status with docker compose ps or view logs with docker compose logs -f.
Navigate to the frontend application directory and start the server using Bun.
cd frontend/app
bun install
bun start
The application will be accessible at: http://localhost:8107
The pipeline uses an OpenAI-compatible endpoint for text refinement. If the default configuration is not working or unreachable:
.env: Modify the LLM_BASE_URL, LLM_API_KEY, and LLM_MODEL variables to match your provider.Examples of Supported Providers:
LLM_BASE_URL=https://api.openai.com/v1/
LLM_API_KEY=sk-your-openai-key
LLM_MODEL=gpt-4o
LLM_BASE_URL=https://api.deepseek.com/v1/
LLM_API_KEY=sk-your-deepseek-key
LLM_MODEL=deepseek-chat
If the ASR service (Faster Whisper) fails to start, crashes, or gives Out Of Memory (OOM) errors:
Use Smaller Models:
The default model large-v3 requires significant VRAM (~10GB). You can switch to a smaller model size.
.env:
# Change to a smaller model
ASR_MODEL_SIZE=medium
# Or use int8 quantization
ASR_COMPUTE_TYPE=int8
Adjust Performance Settings:
ASR_NUM_WORKERS: Reduce the number of workers (e.g., set to 1).ASR_DEVICE: Switch to cpu if no GPU is available (slower).To expose the services to the internet for testing with the Input Client:
NGROK_AUTHTOKEN in .env.docker compose --profile ngrok up -d../scripts/ops/get_ngrok_url.sh.See Ngrok Deployment Guide for details.
Advanced Speech-to-Text Microservices Architecture
The STT Pipeline is a robust, modular system designed for high-accuracy audio transcription, enhancement, and speaker diarization. It primarily processes Vietnamese audio but is extensible to other languages.
Before you begin, ensure your system meets the following requirements:
For detailed information about the system, please refer to the docs/ directory:
Follow these steps to set up and run the STT Pipeline:
Execute the quick setup script to initialize directories, create environment files, and check for dependencies.
./scripts/setup.sh
The setup script creates a .env file. You must edit this file to configure essential services.
nano .env
Critical Configuration:
HF_TOKEN: Required for Speaker Diarization. Get your token from Hugging Face and accept the user agreements for pyannote/speaker-diarization-3.1 and pyannote/segmentation-3.0.ENABLE_DIARIZATION: Optional (default: false). Set to true to enable speaker diarization and alignment. Note: requiring Hugging Face token and additional services.LLM_BASE_URL: Set this if you plan to use LLM for post-processing refinement (see Troubleshooting below).Download the AI models required for the pipeline.
./scripts/model-downloaders/download_models.sh
Build the Docker images and start the backend microservices.
docker compose build
docker compose up -d
Wait for the services to initialize. You can check the status with docker compose ps or view logs with docker compose logs -f.
Navigate to the frontend application directory and start the server using Bun.
cd frontend/app
bun install
bun start
The application will be accessible at: http://localhost:8107
The pipeline uses an OpenAI-compatible endpoint for text refinement. If the default configuration is not working or unreachable:
.env: Modify the LLM_BASE_URL, LLM_API_KEY, and LLM_MODEL variables to match your provider.Examples of Supported Providers:
LLM_BASE_URL=https://api.openai.com/v1/
LLM_API_KEY=sk-your-openai-key
LLM_MODEL=gpt-4o
LLM_BASE_URL=https://api.deepseek.com/v1/
LLM_API_KEY=sk-your-deepseek-key
LLM_MODEL=deepseek-chat
If the ASR service (Faster Whisper) fails to start, crashes, or gives Out Of Memory (OOM) errors:
Use Smaller Models:
The default model large-v3 requires significant VRAM (~10GB). You can switch to a smaller model size.
.env:
# Change to a smaller model
ASR_MODEL_SIZE=medium
# Or use int8 quantization
ASR_COMPUTE_TYPE=int8
Adjust Performance Settings:
ASR_NUM_WORKERS: Reduce the number of workers (e.g., set to 1).ASR_DEVICE: Switch to cpu if no GPU is available (slower).To expose the services to the internet for testing with the Input Client:
NGROK_AUTHTOKEN in .env.docker compose --profile ngrok up -d../scripts/ops/get_ngrok_url.sh.See Ngrok Deployment Guide for details.