• Python 97.9%
  • Dockerfile 1.8%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Thomas dd9d27219a
Feature/basel place names (#78)
* fix: regenerate uv.lock emptied by renovate in #73

* feat: correct Basel place names against the official register

The post-processing LLM lists local place names as location keywords; each
one is fuzzy-matched (rapidfuzz) against the Basel street and object name
lists and snapped onto the official spelling. Opt-in per request via
correct_place_names, off by default.

Corrections are now matched across segment joins, since Whisper cuts on
timing and can split a name ("Schulhaus St." | "Albern").

Street names are refreshed from data.bs.ch with `mise run gazetteer:update`.

* feat: add management summary type

One-page summary for decision-makers who were not in the meeting: key message, decisions, risks and next steps with owners and dates.

* chore: bump faster-whisper to v2.0.3

* chore: release 2.1.0

* fix: leave GPU memory for whisper diarization

vllm shares GPU 1 with faster-whisper; at 0.85 diarization runs out of memory. 0.75 leaves ~7 GB for it.

* feat: fetch Basel street names live from open data

Refresh daily from data.bs.ch dataset 100189; bundled list stays as
fallback until the first download succeeds. Replaces the manual
gazetteer:update script.
2026-10-15 16:39:08 +02:00
.github chore: update renovate config and bump CI workflow ref (#72) 2026-09-08 14:55:11 +02:00
.mise-tasks chore(ci): pin ci-workflows to hash d64a5d5 and unify on ci.yml (#63) 2026-08-26 17:50:10 +02:00
.vscode Update pre-commit configuration, VSCode settings, and improve error message in config 2025-02-28 15:01:09 +01:00
scripts added varlock (#46) 2026-04-08 17:53:38 +02:00
src/transcribo_backend Feature/basel place names (#78) 2026-10-15 16:39:08 +02:00
tests Feature/basel place names (#78) 2026-10-15 16:39:08 +02:00
.dockerignore Use shared mise base image and split dev env schema (#68) 2026-08-28 16:51:04 +02:00
.env.dev.schema Use shared mise base image and split dev env schema (#68) 2026-08-28 16:51:04 +02:00
.env.example Feature/use faster whisper 1 6 0 (#57) 2026-08-03 09:39:01 +02:00
.env.schema chore: standardise huggingface env vars and varlock docker:up (#76) 2026-10-02 14:24:46 +02:00
.gitignore Update CI workflow for improved test coverage reporting and add VSCode settings 2025-02-27 09:27:10 +01:00
.pre-commit-config.yaml Update pre-commit configuration, VSCode settings, and improve error message in config 2025-02-28 15:01:09 +01:00
codecov.yaml init commit 2025-02-27 09:12:18 +01:00
docker-compose.yml Feature/basel place names (#78) 2026-10-15 16:39:08 +02:00
Dockerfile Use shared mise base image and split dev env schema (#68) 2026-08-28 16:51:04 +02:00
LICENSE init commit 2025-02-27 09:12:18 +01:00
mise.toml chore: standardise huggingface env vars and varlock docker:up (#76) 2026-10-02 14:24:46 +02:00
mkdocs.yml Add initial backend configuration and models for audio processing 2025-02-27 18:03:01 +01:00
publiccode.yml Added isBasedOn in public code yml (#69) 2026-09-08 15:16:21 +02:00
pyproject.toml Feature/basel place names (#78) 2026-10-15 16:39:08 +02:00
README.md Feature/use faster whisper 1 6 0 (#57) 2026-08-03 09:39:01 +02:00
renovate.json chore: update renovate config and bump CI workflow ref (#72) 2026-09-08 14:55:11 +02:00
tox.ini init commit 2025-02-27 09:12:18 +01:00
uv.lock Feature/basel place names (#78) 2026-10-15 16:39:08 +02:00

Transcribo Backend

Transcribo Backend is a powerful Python FastAPI service that provides advanced audio and video transcription capabilities with speaker diarization and AI-powered text summarization. This backend service enables high-quality transcription using OpenAI's Whisper API and intelligent summarization using large language models.

Ruff License


DCC Documentation & Guidelines | DCC Website


Features

  • Audio & Video Transcription: High-quality transcription of audio and video files using OpenAI's Whisper API
  • Speaker Diarization: Identify and separate different speakers in recordings
  • Language Detection: Automatic language detection or specify the source language
  • AI Summarization: Generate intelligent summaries of transcribed text using LLMs
  • Speaker Inference: Infer the speaker names from the context of the transcription
  • Title Inference: Generate intelligent titles from the context of the transcription
  • Asynchronous Processing: Task-based processing with status tracking for long-running transcriptions
  • Multi-format Support: Handle various audio formats (MP3, WAV, etc.) and video files
  • Audio Conversion: Automatic conversion to MP3 format for optimal processing
  • Privacy-Focused: Pseudonymized user tracking for usage analytics

Technology Stack

  • Framework: FastAPI with Python 3.12+
  • Package Manager: uv
  • Transcription: OpenAI Whisper API integration
  • AI Models: LLM integration for text summarization
  • Audio Processing: Audio format conversion with audioop
  • Logging: Structured logging with structlog
  • Containerization: Docker and Docker Compose

Setup

Prerequisites

  • Python 3.12+
  • uv package manager
  • Docker and Docker Compose (for containerized deployment)
  • Access to OpenAI Whisper API or compatible service
  • LLM API access for summarization features

Environment Configuration

Create a .env file in the project root with the required environment variables:

# Whisper API Configuration
WHISPER_API=http://localhost:8001
WHISPER_API_KEY=your_whisper_api_key_here

# LLM API Configuration
LLM_API=http://localhost:8002
LLM_API_KEY=your_llm_api_key_here

# Security
HMAC_SECRET=your_secret_key_here

# Client Configuration (optional)
CLIENT_PORT=3000
CLIENT_URL=http://localhost:${CLIENT_PORT}

Note: Configure the Whisper API and LLM API endpoints to match your deployment setup.

Install Dependencies

Install dependencies using uv:

make install

This will:

  • Create a virtual environment using uv
  • Install all dependencies
  • Install pre-commit hooks

Development

Start the Development Server

uv run fastapi dev ./src/transcribo_backend/app.py

Or use the provided task:

make dev

Code Quality Tools

Run code quality checks:

# Run all quality checks
make check

# Format code with ruff
uv run ruff format .

# Run linting
uv run ruff check .

# Run type checking
uv run pyrefly check

Production

Run the production server:

make run

Docker Deployment

The application includes a Dockerfile and Docker Compose configuration for easy deployment:

Using Docker Compose

# Start all services with Docker Compose
docker compose up -d

# Build and start all services
docker compose up --build -d

# View logs
docker compose logs -f

Using Dockerfile Only

# Build the Docker image
docker build -t transcribo-backend .

# Run the container
docker run --rm --env-file .env -p 8000:8000 transcribo-backend

Testing & Development Tools

Run tests with pytest:

# Run tests
make test

# Run tests with pytest directly
uv run pytest

API Endpoints

Transcription

  • POST /transcribe: Submit an audio or video file for transcription

    • Parameters:
      • audio_file: The audio/video file to transcribe
      • num_speakers (optional): Number of speakers for diarization
      • language (optional): Source language code
    • Returns: Task status with task ID for tracking
  • GET /task/{task_id}/status: Get the status of a transcription task

    • Returns: Current task status (pending, processing, completed, failed)
  • GET /task/{task_id}/result: Get the transcription result

    • Returns: Transcription response with text and metadata

Summarization

  • POST /summarize: Generate an AI summary of transcribed text
    • Body: SummaryRequest with transcript text
    • Returns: Generated summary

Health Checks

  • GET /health/liveness: Liveness probe for Kubernetes deployments
    • Returns: Application status and uptime

Project Architecture

src/transcribo_backend/
├── app.py                      # FastAPI application entry point
├── config.py                   # Configuration management
├── helpers/                    # Helper utilities
│   └── file_type.py           # File type detection
├── models/                     # Data models and schemas
│   ├── progress.py            # Progress tracking models
│   ├── response_format.py     # Response format definitions
│   ├── summary.py             # Summary models
│   ├── task_status.py         # Task status models
│   └── transcription_response.py  # Transcription response models
├── services/                   # Business logic services
│   ├── audio_converter.py     # Audio format conversion
│   ├── summary_service.py     # Text summarization service
│   └── whisper_service.py     # Whisper API integration
└── utils/                      # Utility functions
    ├── logger.py              # Logging configuration
    └── usage_tracking.py      # Privacy-focused usage analytics

Acknowledgments

This application is based on Transcribo from the Statistical Office of the Canton of Zurich. We have rewritten the functionality of the original application to fit into a modular and modern web application that separates frontend, backend and AI models.

License

MIT © Data Competence Center Basel-Stadt


DCC Logo

Datenwissenschaften und KI Developed with ❤️ by DCC - Data Competence Center