~/projects/summarizer
GitLab ->
pythondockerkafka
Transcribe and summarize audio files using OpenAI’s Whisper and GPT-4.
Architecture
The application uses a microservices architecture with Kafka for message passing:
┌──────────┐ ┌───────────────┐ ┌──────────────┐ ┌────────────┐
│ Frontend │───▶│ Transcriber │ │ Summarizer │───▶│ Response │
│ (FastAPI)│ │ (Whisper API) │ │ (GPT-4) │ │ │
└──────────┘ └───────────────┘ └──────────────┘ └────────────┘
▲ ▲
└────── Kafka ───────┘
- Frontend: FastAPI web server accepting audio file uploads
- Transcriber: Converts audio to text using OpenAI Whisper
- Summarizer: Generates summaries using GPT-4 Turbo
Setup
-
Create an
openai.envfile in the project root:OPENAI_API_KEY=your_api_key_here -
Ensure
kafka.envexists (already provided in the repo).
Running
docker compose up --build
Navigate to http://localhost:8000 to upload an audio file.
API
GET /
Returns an HTML form for file upload.
POST /
Upload an audio file. Returns JSON with transcription and summary:
{
"text": "Full transcription...",
"summary": "Summarized content..."
}
Services
| Service | Port | Description |
|---|---|---|
| frontend | 8000 | Web interface |
| kafka | 9092 | Message broker |
| zookeeper | 2181 | Kafka coordination |