Architecture advice: Real-time pipeline for YouTube Audio -> Whisper -> LLM -> SSE (Sub-10s latency) [D]

· Source: Machine Learning · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Intermediate, quick

Summary

A user is seeking architectural advice to transform a slow, waterfall-style backend pipeline for analyzing long YouTube videos into a real-time, streaming system with sub-10s latency. The current process involves downloading full audio, transcribing with Whisper, processing with an LLM, and then returning results, leading to long user waits for 30-minute videos. The desired pipeline aims to chunk audio on the fly, process with Whisper and an LLM, and stream results to a UI via Server-Sent Events (SSE). Key challenges identified are effective audio chunking without losing LLM context and choosing between `asyncio` in FastAPI or dedicated workers like Celery/Redis for managing overlapping tasks. Community responses emphasize using Voice Activity Detection (VAD) for natural breaks and suggest 30-60 second audio chunks with 5-10 second overlaps for Whisper processing.

Key takeaway

For AI Engineers building real-time audio analysis pipelines, prioritize streaming chunking and parallel processing over sequential workflows. You should implement 30-60 second audio chunks with overlaps and leverage `asyncio` for task orchestration to achieve sub-10s latency, rather than immediately opting for complex queueing systems like Celery/Redis.

Key insights

Real-time LLM analysis of long audio requires streaming chunking and parallel processing to minimize latency.

Principles

Method

Split audio into 30-60 second segments with 5-10 second overlaps. Run Whisper on chunks in parallel. Stream transcripts incrementally to an LLM. Push results via SSE.

In practice

Topics

Best for: AI Engineer, Machine Learning Engineer, MLOps Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Machine Learning.