Self-Hosted GPU, UI at the Edge: How I Deployed a WhisperX App
My speech-to-text side project, stt.yusypenko.com, transcribes audio, video and links with WhisperX, splits the text by speaker, and lets you summarise or chat with a recording. A rented cloud GPU running around the clock costs more than a side project earns, so the GPU work runs on a self-hosted server with an RTX 3060. Only the UI lives in the cloud.
How a transcript gets made
Every transcription is a BullMQ job. The Express API stores the upload and queues it. The worker sends the file to a FastAPI service that wraps the WhisperX CLI (large-v3 by default, with word alignment and pyannote diarization). That service answers 202 with a job id and runs WhisperX in a worker thread. The API polls its status every 5 s, for up to an hour, so no HTTP request stays open for the length of a transcription.
What you can do with a transcript
When a job finishes, the app sends an in-app notification (and an email, if you turned that on), and the transcript opens with every line labelled by speaker. From there you can:
- Name the speakers. Click a label like
SPEAKER_00and rename it; the names are saved with the job. - Export it as TXT, DOCX, PDF or JSON. Exports run on their own queue and expire after 24 hours.
- Summarise it. One click each for a summary, action items or key points, and you can save the results you want to keep next to the transcript.
- Run your own prompts from a prompt library (below), and save the answers next to the transcript too.
- Chat with it. Open a chat on a recording and ask questions; answers stream in as they are generated. Very long transcripts are trimmed to fit the model's context, with a note telling the model they were cut.
Prompt management
Summaries are just prompts, so prompts get their own page. Each prompt has a name, a description, a category (summary, analysis, extraction or custom) and a template, where {{transcription}} is replaced with the transcript text when it runs.
- Built-in prompts. Summary, Action Items, Key Points and Questions ship with the app. Everyone sees them, and they can't be edited.
- Your own prompts. Create, edit and delete prompts for the questions you ask every time: decisions made in a meeting, quotes from an interview, a draft follow-up email.
- Shared prompts. Mark a prompt public and every account on the app can use it.
- Let the model write it. Describe what you want and the model drafts the name, description and template; or paste an existing template and ask it to improve it.
- Most-used first. Every run is counted, and the list shows built-in prompts first, then the rest by how often they're used.
A self-hosted LLM next to WhisperX
All of those AI features run on gemma4 (the 26B model) served by Ollama, on a second GPU next to the one WhisperX uses. While the local model is up, transcripts don't leave the server for summaries or chat. The backend talks to it through the OpenAI-compatible API, so the same client falls back to OpenAI (gpt-4o-mini) when the local model isn't available.
One gotcha: gemma4 "thinks" before it answers by default, and that thinking could use up the whole token budget and return an empty reply. Setting reasoning_effort to none fixed it and made answers faster.
How it's deployed
The UI is a static export of the Next.js 14 app, served by a Cloudflare Worker. OpenNext dropped Next 14, so every page renders on the client. Dynamic routes like /transcriptions/:id export one placeholder page, and the page reads the real id from the URL.
Everything under /api/* is proxied by the Worker through a Workers VPC service into a Cloudflare Tunnel. The tunnel has no public hostname, and the server has no open ports. Two things bit me here:
- The tunnel can't resolve Docker Compose service names, so the backend gets a fixed IP on the tunnel's network.
expect: 100-continuemade the VPC proxy answer520, so the Worker strips hop-by-hop headers before forwarding.
What I learned
Split the system by what each part costs to keep running, not by what's tidy. The UI is cheap and needs to be always up, so it sits at the edge. The GPU is expensive and can be offline, so it runs on its own server behind a queue that waits. The work then goes into the seam between them: the Worker, the VPC service and the tunnel that connect the two.

Oleksandr Yusypenko
Senior Full-Stack + AI Engineer. Building in public — AI agents, LangGraph, production systems.
Related Posts
Jul 8, 2026
The Prompt Cache That Silently Did Nothing
We shipped Anthropic prompt caching with green unit tests — and it did nothing in production. The culprit: model-specific cache floors and per-day content ahead of the breakpoint. Here's the diagnosis and the fix.
Jul 8, 2026
We Gave Our Agent a Third Tool. Then We Deleted It.
Melio's meal-plan agent runs on exactly two tools. We eval-tested a third — a deterministic self-check — and it tripled cost per plan and made accuracy worse. Here's the data that got it deleted.
Jul 5, 2026
Query-based CDC over WAL: keeping a CQRS Postgres → ClickHouse read model fresh
Query-based CDC vs log-based (WAL) for a CQRS Postgres→ClickHouse read model: watermark polling, ReplacingMergeTree, reconcile-by-key-diff, and freshness-lag alerts.
Claude Code config is a team asset, not a personal file