Transcribe an audio file privately
Use the publisher’s Transformers path for Voxtral Mini Realtime to transcribe a local recording, check the words against the audio, and keep the file off hosted APIs.
Before you begin
- Difficulty
- Intermediate
- Software
- Python, PyTorch, Transformers, mistral-common
- Hardware
- Mistral documents a 16 GB GPU minimum for its vLLM streaming path. The Transformers file path below has no separate measured minimum; begin on a CUDA GPU with ample memory or a suitable rented GPU.
Sources and files
Publisher Voxtral model card and Python example Publisher-supported vLLM streaming routeChoose a model for this task
The steps below use the recommended model. Alternatives have their own package and command; open their model pages before switching.
The workflow
Prepare a private GPU environment
Use a local Linux CUDA machine or a rented Linux GPU with access limited to you. Place a short recording you are allowed to process at sample.mp3. The model download needs additional disk space; this workflow sends the recording only to your local Python process.
Install the documented audio dependencies
Create a fresh Python environment with a compatible PyTorch installation, then install the publisher-listed Transformers and audio packages.
pip install --upgrade "transformers>=5.2.0" "mistral-common[audio]"Save the transcription script
Save this publisher-derived example as transcribe.py beside sample.mp3. It loads the official weights, resamples the recording for the processor, and prints the decoded transcript.
from transformers import VoxtralRealtimeForConditionalGeneration, AutoProcessor
from mistral_common.tokens.tokenizers.audio import Audio
repo_id = "mistralai/Voxtral-Mini-4B-Realtime-2602"
processor = AutoProcessor.from_pretrained(repo_id)
model = VoxtralRealtimeForConditionalGeneration.from_pretrained(repo_id, device_map="auto")
audio = Audio.from_file("sample.mp3", strict=False)
audio.resample(processor.feature_extractor.sampling_rate)
inputs = processor(audio.audio_array, return_tensors="pt")
inputs = inputs.to(model.device, dtype=model.dtype)
outputs = model.generate(**inputs)
print(processor.batch_decode(outputs, skip_special_tokens=True)[0])Run a short transcription
Start with a short, clear recording before a long meeting. The first run downloads the weights. A printed transcript without a model-load or audio-decoding error is the technical success check.
python transcribe.pyCheck the transcript against the recording
Listen to the source while reading the text. Verify names, numbers, and any words that matter. The publisher reports strong multilingual recognition, but the output is not guaranteed to be exact.
Scale up carefully
For live subtitles, switch to the publisher’s vLLM realtime route and its linked streaming client. Check latency and GPU memory on your exact system before using it for longer sessions.
When it doesn’t go to plan
Confirm sample.mp3 exists beside the script and install the audio extras from the publisher instructions. Try a short standard MP3 or WAV that plays locally.
Use a larger CUDA GPU or rented GPU. The documented 16 GB minimum applies to vLLM; this Transformers example has no separately published memory minimum.
Check the source recording manually, use clearer input where possible, and review names and numbers before relying on the transcript.
The model behind this workflow
Voxtral Mini · 4B RealtimeWill it run on your machine?
Save your machine to see a personalized rating and its reasoning.
Add my hardwareKeep exploring
Set up a private AI chat assistant
Install a local runtime, run Qwen3.5 9B, confirm responses, and know when to choose the smaller 4B package.
Build a private local coding assistant
Connect an open coding-capable model in Ollama to Cline, run a small repository task, and review the result locally.
Generate images on your own GPU
Use the official FLUX.2 Klein 4B ComfyUI template with exact model files, a first prompt, and an output check.