Streamlit application for transcription and translation using IBM Granite Speech on Apple Silicon with MLX.
Transcription + French translation of a sample clip, shown in the light and dark themes.
- Pipeline processing — run multiple transcription and translation tasks on the same audio (Transcribe + one translation runs as a single inference per segment via chain-of-thought prompting)
- Transcription — English, French, German, Spanish, Portuguese, Japanese
- Translation — English ↔ French, German, Spanish, Portuguese, Italian, Japanese, Mandarin Chinese (Italian and Mandarin: English source only)
- Keywords — bias recognition toward up to 15 user-provided terms (proper nouns, acronyms, jargon)
- VAD segmentation — automatic speech detection with timestamped per-segment output (togglable; disable to process whole audio in one pass; auto-required for audio over 5 minutes)
- Toxicity check — togglable (on by default); surfaces the worst per-segment toxicity score on English output (transcription or translation to English) via Granite Guardian HAP 125m
- Source language — pick once; valid tasks update accordingly
- Audio input — upload audio (WAV, FLAC, M4A, MP3, OGG, AAC) or video (MP4, MOV, WebM, MKV — audio track is extracted) or record from microphone
- Side-by-side results — compare outputs in a column grid (up to 3 columns)
- Themed UI — cohesive IBM Carbon-inspired theme with automatic light and dark modes
- Deferred loading — models load on first pipeline run for instant page startup
- Export — download per-task transcriptions and translations as text
Three models run as a pipeline, loaded on first run and cached thereafter:
| Model | Role | Runs on |
|---|---|---|
| Granite 4.0 1B Speech (8-bit, MLX) | Transcription and translation | Apple GPU (MLX) |
| Silero VAD | Splits audio into speech segments | CPU |
| Granite Guardian HAP 125m | English toxicity detection | CPU |
Audio is loaded and resampled to 16 kHz mono, optionally segmented with VAD, then transcribed and translated segment-by-segment on the GPU. English output (English-source transcription or translation into English) is scored for toxicity. Transcribe plus a single translation runs as one chain-of-thought inference per segment rather than two passes.
- Apple Silicon Mac (M1/M2/M3/M4)
- Python 3.12+
- uv — Python package manager (
curl -LsSf https://astral.sh/uv/install.sh | sh) - FFmpeg —
brew install ffmpeg(required:torchcodecloads FFmpeg's shared libraries at import time, so the app won't start without it)
brew install ffmpeg # required at runtime by torchcodec
uv sync
uv run streamlit run streamlit_app.pyFirst run downloads the Granite Speech model (~2.9 GB) plus the VAD and guardian models, then caches them; inference runs on the Apple Silicon GPU.
New here? Try it with the bundled sample clip:
tests/data/audio/sample_10s.wav.
- Upload an audio or video file, or record from your microphone
- Pick the source language of your audio
- Pick tasks (transcribe, translate to a language)
- Optionally toggle VAD segmentation (on by default)
- Optionally add Keywords (proper nouns, acronyms, jargon)
- Optionally toggle Toxicity check (on by default)
- Click Transcribe to process all selected tasks
- View side-by-side results and download as text
- Apple Silicon only — inference uses MLX; there's no CUDA or CPU-only fallback.
- Translation pivots through English — English ↔ X only; no direct X → Y (e.g. French → German).
- Toxicity detection is English-only (Granite Guardian HAP).
- Upload limit 500 MB; with VAD off, clips are capped at 5 minutes (the model's context window).
uv run ruff check . # lint
uv run ruff format . # format
uv run ty check # type-check
uv run pytest # run tests- IBM Granite — Speech and Guardian models
- Silero VAD — voice activity detection
- Apple MLX and mlx-audio — on-device inference
- Streamlit — web UI
Licensed under the Apache License 2.0. See NOTICE for third-party attributions.

