antirez/voxtral.c
Native C Voxtral 4B inference for local streaming speech-to-text
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
voxtral.c is a native inference engine for Mistral Voxtral Realtime 4B, not a general model runner. Audio is normalized to 16 kHz and passed through mel feature extraction, a convolutional stem, and a 32-layer causal transformer encoder with a 750-position attention window. After 4× downsampling, a 5120→3072→3072 adapter with GELU feeds a 26-layer Ministral-3-based decoder. The decoder uses grouped-query attention with 32 query heads and 8 KV heads; the Tekken vocabulary has 131,072 entries.
The source separates audio processing, encoder, decoder, kernels, safetensors loading, and tokenization into dedicated C modules. Apple acceleration lives in voxtral_metal.m and voxtral_shaders.metal; the BLAS build uses Accelerate on macOS or OpenBLAS on Linux. BF16 weights are memory-mapped from safetensors. main.c provides the CLI, while voxtral.h exposes an in-process streaming API that feeds audio, queues decoded text, and finalizes pending input. There is no packaged network service.
Key Capabilities & Differentiators
The CLI accepts 16-bit PCM WAV and resamples it to 16 kHz. --stdin distinguishes RIFF WAV from raw signed 16-bit little-endian, 16 kHz mono PCM, so ffmpeg can act as a format bridge without becoming an inference dependency. On macOS, --from-mic captures from the default input via AudioQueue Services and strips detected silence. The model covers 13 languages, including English, Mandarin Chinese, Japanese, Hindi, and Arabic. Output arrives incrementally, with transcript text on stdout and diagnostics on stderr.
Overlapping encoder chunks bound audio-encoding state, while a rolling decoder KV cache caps history at 8,192 positions. This allows streams to continue beyond the context window without retaining all preceding context. --monitor exposes encoder passes, invalid or control-only token streaks, watchdog timeouts, and resets, which help distinguish a stalled decode from an encoder that is simply waiting for more audio.
Trade-offs & Limitations
Compared with a hosted Whisper API, voxtral.c keeps audio and inference local and offers direct access to incremental text. In exchange, you provision the hardware, stage the model, and build any service layer yourself. The M3 Max measurements show how much backend choice matters: for 3.6 seconds of audio, the encoder took 284 ms on Metal versus roughly 8 seconds on BLAS; short-sequence decode was 23.5 ms per step versus 335 ms. Metal reuses cached FP16 weights, while BLAS repeatedly converts BF16 weights to FP32. These are hardware-specific measurements, not a head-to-head benchmark against Whisper.
For live input, the default 2-second encoder interval is a throughput compromise: reducing -I can make text arrive sooner, but each encoder call adds roughly 50 ms of fixed overhead in the measured setup. Offline file transcription does not use this interval. Testing has covered only a few samples, and microphone input may skip audio when processing falls behind. Before adopting it for continuous capture, test cache rollover, transcript continuity across resets, and whether target hardware keeps up without dropping input.
Hardware & Deployment Guide
Stage the model with ./download_model.sh, which populates voxtral-model/ with consolidated.safetensors (about 8.9 GB), tekken.json, and params.json. On Apple Silicon, build with make mps; use make blas with Accelerate on Intel macOS or OpenBLAS on Linux. A file smoke test is ./voxtral -d voxtral-model -i samples/test_speech.wav. Once the assets are staged, native inference runs offline without Python, CUDA, or vLLM. The separate Python reference uses PyTorch, safetensors, soundfile, and soxr.
Size Apple Silicon deployments for the roughly 8.4 GB FP16 Metal weight cache, up to roughly 1.8 GB of decoder KV cache, and about 200 MB of working buffers, plus headroom for mapped BF16 pages and the rest of the system. Memory mapping makes weights available without reading them all up front; it does not remove their runtime memory cost. No tagged release is listed. Pin a tested commit and validate the build, sustained memory use, and long-stream behavior on the hardware you intend to deploy.
vox_stream_t accepts incremental audio and queues text for retrieval; the CLI keeps transcript output on stdout and diagnostics on stderr.s16le; live microphone capture is macOS-only.-I trades responsiveness for encoder batching, while --monitor exposes decode stalls, watchdog timeouts, and resets.Local captions, privacy-sensitive transcription prototypes, and native applications that need incremental text on Apple Silicon.
You need an out-of-the-box hosted endpoint, dependable real-time throughput on a CPU-only Linux deployment, or unattended long-running capture without first validating drop and reset behavior.
Quick Start & Installation
pip install torch safetensors soundfile soxr python python_simple_implementation.py voxtral-model audio.wav
Comparison vs. Top Voice, Vision & Video Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| voxtral.c ★ | 1.8k | — | C | MIT | Native C Voxtral 4B inference for local streaming speech-to-text |
| whisperX | 26.5k | +677 | Python | BSD-2-Clause | Batched Whisper with forced alignment for word timings and optional speaker labe |
| sherpa-onnx | 16.4k | +136 | C++ | Apache-2.0 | C++ and ONNX Runtime SDK for offline speech and real-time transcription |
| moonshine | 11.7k | +48 | C++ | — | On-device C++ SDK for live transcription, intent recognition, and speech synthes |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/antirez/voxtral.c.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about voxtral.c
How do I integrate streaming transcription into an application?
vox_load, create a vox_stream_t with vox_stream_init, feed audio with vox_stream_feed, and drain pending text with vox_stream_get. Call vox_stream_finish at end of input, then drain once more. Returned token strings remain valid until vox_stream_free. This is an in-process API, not an HTTP endpoint; for a subprocess integration, send audio over stdin and read transcripts from stdout.How much memory should I budget, and is CPU inference practical?
Can I use it commercially and keep audio on premises?
When is this a better choice than a hosted Whisper API?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy