A Chrome extension that captures audio from the current tab, transcribes it using a self-hosted Whisper API, and optionally formats the text using a self-hosted Starcoder2 model.
- High-Quality Audio Capture: Records tab audio at 48kHz using
AudioWorklet. - Dual Audio Routing: Allows you to hear the audio while it's being recorded.
- Self-Hosted Transcription: Uses OpenAI's Whisper model running on your own server for privacy and control.
- AI Text Formatting:
- Raw: Verbatim transcription.
- General: Fixes punctuation, capitalization, and removes filler words.
- Appen: Strict formatting rules for professional transcription.
- Dedicated Transcript View: Opens a separate tab to display results, play back audio, and download transcripts.
- Manifest V3: Modern extension architecture.
- Offscreen Document: Handles audio capture and processing to keep the extension responsive.
- AudioWorklet: Efficiently processes raw audio samples (PCM) and encodes them to WAV.
- Popup UI: Simple interface to control recording and settings.
The extension communicates with a backend hosted on https://xnet-ai.xnet.ngo (or your own domain).
- Caddy: Reverse proxy handling HTTPS and routing.
- Whisper: FastAPI service running OpenAI's Whisper model (Port 8001).
- Starcoder2: FastAPI service running BigCode's Starcoder2 model for text formatting (Port 8003).
- Coqui TTS: (Optional) Text-to-Speech service (Port 8000).
- Clone this repository.
- Open Chrome and navigate to
chrome://extensions/. - Enable Developer mode in the top right corner.
- Click Load unpacked.
- Select the
extensionfolder from this repository.
You need a server with a GPU (NVIDIA T4 or better recommended) and Docker installed.
-
Network Setup:
docker network create xnet-bridge
-
Run Whisper Container:
docker run -d --name whisper --network xnet-bridge -p 8001:8001 --gpus all whisper-image
Note: Ensure
ffmpegis installed in the container. -
Run Starcoder2 Container (For Formatting):
# Ensure main_code.py is configured for FP16 and low_cpu_mem_usage if on 16GB RAM docker run -d --name starcoder2 --network xnet-bridge -p 8003:8003 --gpus all starcoder2-image -
Configure Caddy: Update your
Caddyfileto route traffic:xnet-ai.xnet.ngo { route /transcribe* { reverse_proxy http://whisper:8001 } route /generate-code* { reverse_proxy http://starcoder2:8003 } }
- Open the Extension: Click the Whisper icon in your toolbar.
- Initialize: Click "Initialize (Open Tab)" to open the dedicated transcript view.
- Select Formatting: Choose "General", "Appen", or "None".
- Start Recording: Click "Start Recording". The audio from the active tab will be captured.
- Stop Recording: Click "Stop".
- View Results: The transcript will appear in the dedicated tab. You can play back the recorded audio or download the text.
- 502 Bad Gateway: Check if the Docker containers are running and connected to the
xnet-bridgenetwork. - Formatting Failed (500 Error): The Starcoder model might be crashing due to memory issues. Ensure it is loading in FP16 mode (
torch_dtype=torch.float16) andlow_cpu_mem_usage=True. - No Audio: Ensure the tab is playing audio before you start recording.