How gbrlpzz/scribe works
Project type and purpose
• This is an open-source, command-line transcription tool written in Python.
• It provides two modes:
• A “local” version (scribe.py) that uses the Whisper ASR model locally, then generates a PDF via ReportLab.
• A “diet” version (diet-scribe.py) that uses the OpenAI API for transcription and emits a plain text file.
High-level architectural overview
Both scripts implement a linear data-pipeline pattern. The core stages are:
1. CLI Interface & Input Validation
2. Audio Format Conversion (using pydub/moviepy)
3. Speech-to-Text (Whisper locally or OpenAI API)
4. (Local only) Title Generation via OpenAI GPT-3.5-turbo
5. Output Generation (PDF with ReportLab or TXT)
Main components and interactions
• CLI Layer (scribe.py / diet-scribe.py)
– Parses command-line arguments and validates input file.
– Orchestrates the pipeline stages in sequence.
• Audio Converter
– Uses pydub (or moviepy for MP4) to transcode MP3/M4A/MP4 → WAV.
• ASR Engine
– Local: OpenAI Whisper (imported module).
– API: OpenAI’s Whisper endpoint or chat completions for transcription.
• LLM Title Generator (local version only)
– Calls OpenAI’s chat.completions endpoint (model=gpt-3.5-turbo) to produce a document title.
• Document Renderer
– PDF: Uses ReportLab to lay out title & transcript on A4 pages.
– TXT: Writes raw transcript to .txt file.
• External Services
– OpenAI API (for transcription in diet version and title generation in local version).