Run a Transcription Model on Your Own Server
A worked llama.cpp walkthrough for private transcription, plus the concurrency arithmetic that tells you how many live streams one GPU can really carry.
To run a transcription model on your own server you need three things: a machine with a GPU, a server binary that exposes an HTTP endpoint, and a model file. The setup takes under an hour. What takes longer is working out how many simultaneous audio streams that machine can actually handle, which is the number that decides whether self-hosting holds up or quietly falls over the first busy afternoon.
This walkthrough uses llama.cpp, because its v0.8.0 release added realtime transcription and text-to-speech endpoints that speak a protocol existing clients already understand, which means you can point an app at a local server without rewriting the client.
Why you would run a transcription model on your own server at all
Two reasons hold up, and one does not.
Data handling holds up. Call recordings, medical dictation, legal audio and HR conversations are the material that makes a privacy review take six weeks. If the audio never leaves your infrastructure, that review gets considerably shorter.
Latency holds up. The network round trip to a hosted endpoint is a floor. If you are building anything conversational, that floor may already be most of your budget.
Saving money usually does not hold up, at least not at the volumes most products have. A rented GPU costs the same idle as busy, so the saving only appears at sustained load. Work through whether self-hosting is actually cheaper before you justify this on cost, because the honest answer is often no.
What you need
A GPU with at least 8GB of VRAM for a small streaming model. Transcription models are far smaller than chat models, so this is the rare local AI task a modest card handles.
llama.cpp built at v0.8.0 or later. The audio endpoints do not exist in earlier versions, and the failure mode is a confusing 404 rather than a clear error.
A model in GGUF format. Start with a small streaming-capable one; you can swap later.
Somewhere to put the audio. Even if you are not storing recordings, you need a staging path for batch jobs.
Build and start the server
Build with GPU support enabled, then start the server with your model:
# build with CUDA support
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release -j
# start the server
./build/bin/llama-server \
--model ./models/your-asr-model.gguf \
--host 0.0.0.0 \
--port 8080 \
--n-gpu-layers 99--n-gpu-layers 99 pushes every layer onto the GPU. If you run out of VRAM, lower it; the model then splits across GPU and CPU and gets slower rather than failing outright. Confirm the server is up before going further:
curl -s http://localhost:8080/healthTranscribe a file first
Get batch working before you touch streaming. It is the simpler path and it proves your build has functioning audio support:
curl -s http://localhost:8080/v1/audio/transcriptions \
-F file=@sample.wav \
-F response_format=jsonIf that returns text, the hard part is done. If it returns a 404, you are on a build older than v0.8.0. If it returns empty text, check your audio is 16kHz mono PCM, which is what most speech models expect. Resample first:
ffmpeg -i input.m4a -ar 16000 -ac 1 -c:a pcm_s16le sample.wavThat resampling step accounts for a surprising share of "the model returned nothing" reports. A 44.1kHz stereo file does not error, it just transcribes badly or not at all.
Then wire up streaming
The /v1/realtime endpoint implements the OpenAI realtime protocol for conversation and transcription, so a client library written against that protocol works against your server with a URL change. Do not write a new client; point an existing one at it.
One detail from the release notes that will save you an afternoon: the server sends response.done after the committed audio has drained. If your client waits for a different signal, or closes the socket as soon as it stops sending audio, you will lose the tail of the transcript and conclude the model is dropping words. It is not. You closed early.
The concurrency arithmetic that actually decides this
Here is the number nobody tells you. A GPU transcribing a live stream is not doing it "instantly"; it processes faster than real time by some factor. Call it the realtime factor. If your model and card process audio 10 times faster than real time, one GPU can in principle keep up with about 10 concurrent streams. In practice you get fewer, because streaming work arrives in small chunks and the per-chunk overhead eats into that headroom.
Measure it. Transcribe a 10-minute file and time it. Ten minutes of audio in 60 seconds is a realtime factor of 10.
Halve it for streaming overhead. That gives you roughly 5 safe concurrent streams.
Compare that against your actual peak concurrency, not your average. Averages hide the Monday morning spike.
If peak exceeds the safe number, you need a second GPU, a queue, or a hosted fallback for overflow.
The failure mode when you get this wrong is nasty and worth naming. Streams do not fail cleanly; they degrade. Latency climbs, transcripts arrive late, and in a conversational product the whole thing feels broken while every dashboard reports the server as healthy. This is exactly the shape of problem our notes on setting timeouts exist to catch, and a transcription server deserves a timeout and a queue depth limit from day one rather than after the first bad day.
Running it in production without regretting it
Cap concurrency explicitly. Reject or queue past your measured safe number instead of accepting work the GPU cannot do.
Keep a hosted fallback. Overflow to an API during spikes. Self-hosting does not have to be all or nothing.
Pin the version. If you build against the experimental
mtmd_audio_streamC API, pin it. The release labels it experimental and the signature can move.Monitor realtime factor, not just uptime. A server that is up but running at 1.2 times realtime is already failing.
On the safety question people reasonably ask about pulling model weights onto their own box, the considerations in is it safe to run an AI model locally apply here unchanged. And if you have not yet settled on which model to serve, the decision path in how to choose a speech to text model comes before this walkthrough rather than after it.
Handling files longer than a few minutes
Speech models have an audio context limit the same way text models have a token limit, and a 90-minute recording will not go in as one piece. You chunk it. The naive version of chunking is also the version that produces mangled transcripts, so it is worth doing properly the first time.
Split on silence, not on fixed durations. A cut at 30.0 seconds lands mid-word; a cut at the nearest pause does not.
Overlap the chunks by a second or two and stitch on the overlap. This gives you a seam you can reconcile instead of a hard join.
Keep a running offset so timestamps stay correct across the whole file. Per-chunk timestamps that all start at zero are the most common bug here.
Process chunks in parallel only up to your measured concurrency limit. A long file is a burst of load, and it will happily saturate the GPU you also need for live streams.
ffmpeg can do silence-aware splitting directly, which saves writing the detection yourself:
ffmpeg -i long-recording.wav \
-af silencedetect=noise=-30dB:d=0.5 \
-f null - 2> silence.logRead the timestamps out of silence.log and cut there. For a batch pipeline this is usually enough; it is not worth reaching for a dedicated library until the simple version fails on real audio.
What to log, and what not to
A self-hosted transcription server is a place where logging discipline matters more than usual, because the thing passing through it is often the exact data you self-hosted in order to protect.
Log request duration, audio duration, the ratio between them, queue depth and any rejections. That is your realtime factor over time, which is the health signal that matters.
Do not log transcript text or audio paths in anything that leaves the box. A debug log full of call transcripts recreates the problem self-hosting was meant to solve.
Log model and build version on every request. When output quality changes after an upgrade, this is the field that tells you why in seconds rather than hours.
Common questions
Do I need a GPU to run a transcription model?
For batch work on short files, no. CPU transcription works and is simply slower, which is fine if nobody is waiting. For live streaming you need a GPU, because you have to stay ahead of real time.
How much VRAM does a transcription model need?
Far less than a chat model. Small streaming speech models are often under a billion parameters, so 8GB is comfortable and some run in much less. This is the local AI task least likely to be blocked by hardware.
Can I run transcription and a chat model on the same GPU?
Technically yes, but they compete for the same memory and compute, and the transcription stream is the one that degrades visibly. If the audio path is latency-sensitive, give it its own card.
How did this land?
About the author

Developer Advocate
Steve builds something with Swarmz every week and writes up what worked, what broke, and what he'd do differently. Tutorials and hands-on guides are his lane.


