Vosk Offline STT Integration for Speech Recognition

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1All 1564 services
Vosk Offline STT Integration for Speech Recognition
Simple
from 1 day to 3 days
Frequently Asked Questions

AI Development Areas

AI Solution Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1347
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1247
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    948
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1183
  • image_logo-advance_0.webp
    B2B Advance company logo design
    642
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    921

You are launching a voice assistant in a closed loop: no cloud access, data under NDA, hardware — Raspberry Pi 4. For successful Vosk integration targeting offline speech recognition (STT without internet) on edge devices, understanding Vosk Kaldi architecture is crucial—especially for Vosk Russian language support and private speech recognition with low Vosk latency and improved Vosk WER via Vosk fine-tuning using Kaldi nnet3. Vosk — the only production-ready toolkit based on Kaldi that works fully offline, takes up 50 MB disk space and gives latency 200 ms on streaming. No internet, no leaks. Vosk supports 20+ languages including Russian, but on every second project we faced higher WER than expected — the base model doesn't understand medical or legal terms. We deployed Vosk in medical dictaphones, voice assistants for "clean rooms", conveyor control systems. Every time we hit two limits: accuracy on domain-specific vocabulary and performance on weak CPUs. Below — how we overcome them. Meanwhile, cloud API costs can reach 300,000 rubles per month — switching to Vosk reduces expenses by 60–80%, saving up to 240,000 rubles monthly ($3,200 at current rate). For example, one medical center reduced their monthly speech recognition costs from 250,000 rubles ($3,400) to 50,000 rubles (~$680) after integrating Vosk.

For private speech recognition on edge devices, Vosk offers low latency and can be fine-tuned with Kaldi nnet3 to reduce WER. This combination makes Vosk integration ideal for offline STT without internet, especially for Russian language.

What are the main benefits of Vosk integration?

  1. High WER on domain vocabulary. The standard vosk-model-ru-0.42 achieves WER ~12% on news, but on medical terms — up to 30%. Solution: custom dictionary with weights and fine-tuning on 1–2 hours of target recordings. On one project we reduced WER from 25% to 14% in a day — that's a 1.8 times improvement.

  2. Latency on stream. Vosk emits partial results every 200 ms, but if CPU load is 100%, the framework starts lagging. We optimized the pipeline: moved decoding to a separate thread, added a 2-second buffer, used VAD to cut silence. As a result, p99 latency does not exceed 350 ms — Vosk is 2.5 times faster than Whisper's typical 500 ms latency.

  3. Need for a unique model. For Chinese, Vosk doesn't cover all accents. On one project with a French dialect, we trained an adapted model via Kaldi nnet3 — spent a week but got WER 8% versus baseline 22% — a 2.75 times reduction in word error rate.

How to adapt Vosk for domain-specific vocabulary?

The process includes four stages:

  • Collect acoustic recordings (1–2 hours)
  • Transcribe the recordings
  • Create custom lexicon with weights
  • Fine-tune the acoustic model using Kaldi nnet3 with a learning rate of 0.001, 10 epochs, and batch size 32 We also apply speaker adaptation using fMLLR transforms to improve accuracy across different voices. Additionally, we employ language model rescoring with n-gram models and apply acoustic model adaptation using MLLR transforms. On one project with a French dialect, we reduced WER from 22% to 8% in a week.

Edge device advantages of Vosk

Vosk uses 40 times less memory than Whisper-large and is 10 times faster on Raspberry Pi. Below is a comparison of available acoustic models for Russian (data from Vosk Model Zoo):

Model Size WER (clean speech) RAM (total) Ideal scenario
vosk-model-small-ru-0.22 45 MB ~20% ~80 MB Raspberry Pi Zero, microcontrollers
vosk-model-ru-0.42 1.5 GB ~12% ~1.6 GB Server, single-board computer with 2+ GB RAM
Custom (fine-tune) from 100 MB 8–15% ~500 MB Niche vocabulary (medicine, law)

Conclusion: for low-power edge — small model, for accuracy — full or custom.

Additional resource comparison (acoustic model + language model):

Resource Vosk (small) Whisper (tiny) Whisper (base)
RAM 80 MB 1 GB 2.5 GB
CPU load (RPi4) 15% 60% 90%
Latency 200 ms 500 ms 1.2 s

Medical dictaphone integration case study

One of our clients — a medical center — needed to record doctor appointments. Hardware: Intel NUC (i5, 8 GB RAM). We used vosk-model-ru-0.42 with a custom medical dictionary. Integration snippet:

from vosk import Model, KaldiRecognizer
import pyaudio

model = Model("vosk-model-medical")
rec = KaldiRecognizer(model, 16000)
rec.SetGrammar(grammar)  # medical terms

p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paInt16, channels=1, rate=16000,
                input=True, frames_per_buffer=4000)
while True:
    data = stream.read(4000, exception_on_overflow=False)
    if rec.AcceptWaveform(data):
        result = json.loads(rec.Result())
        print(result["text"])
    else:
        partial = json.loads(rec.PartialResult())
        # display intermediate text

First prototype — in 4 days. Another 3 days for dictionary calibration and stress testing. Outcome: WER 9% on real recordings — a 3 times improvement over the baseline model.

We used a technique of adding terms with weights: each word is assigned a coefficient from 0 to 1 that influences recognition probability. For example, word "диагноз" weight=1.5, "гипертония" weight=1.2. This boosts accuracy without increasing model size.

Scope of work

  1. Task audit and model selection.
  2. Vosk integration into your code (Python, Java, C#, Go, Node.js).
  3. Dictionary customization and/or model fine-tuning.
  4. Latency and memory optimization.
  5. Testing on your data (100+ recordings).
  6. Documentation and team training.
  7. 3-month technical support.

Cost is calculated individually, but on average replacing a cloud API with Vosk saves 60–80% of the recognition budget. Integration costs start at $3,000 for basic setup and can go up to $15,000 for custom fine-tuning.

Integration timelines

Basic integration — from 3 to 5 days. If a custom model or fine-tuning is required — 2–3 weeks. We help evaluate the project: just describe the task, and we'll send a plan within a day.

Benefits of choosing our integration

Experience — over 10 projects in voice technologies. We guarantee recognition quality (agreed WER) and support the code after delivery. You remain the owner of all models and scripts — no vendor lock.

Contact us and we'll send a test model for your task. Order a pilot and get a prototype in 5 days. This guide covers Vosk integration for offline speech recognition, providing STT without internet using Vosk, based on Kaldi. Vosk supports Russian language and ensures private speech recognition on edge devices. Vosk latency is low, and Vosk WER can be improved via Vosk fine-tuning with custom data using Kaldi nnet3 acoustic models. For STT edge device deployment, Vosk is the optimal choice.

Edge AI and Optimization: How to Deploy Models Without Cloud?

Imagine: your face recognition model has 4 seconds latency on Jetson Orin, the battery runs out in an hour, and the model crashes with OOM. We are a team of Edge AI engineers with 5+ years in production — we have optimized over 150 models for edge devices. Without profiling and proper choice of quantization or distillation, the project is doomed. The gap between research code and edge deployment is a separate engineering discipline; we help you master it in 2–16 weeks turnkey. Edge AI and model optimization services are not just export, but systematic work with hardware.


Why Simply Exporting a Model Doesn't Work?

A PyTorch model with float32 and batch_size=32 is not ready for edge. Typical problems:

  • ResNet-50 in fp32 occupies 98 MB, inference on Cortex-A78 — 380 ms. After INT8 quantization via torch.ao.quantization — 24 MB, 95 ms. Export to ONNX + TensorRT on Jetson — 28 ms.
  • YOLOv8m on Raspberry Pi 5 in fp32 — 2.8 fps. TFLite INT8 — 9.4 fps. With XNNPACK delegate — 14 fps (1.5× faster than pure INT8).
  • Transformer encoder on mobile CPU: MobileBERT in fp16 via CoreML on iPhone 15 — 18 ms/inference. distilbert-base-uncased in ONNX — 42 ms.

The problem is not choosing "quantize or not" — the right path is determined by the device, task, and acceptable metric degradation. We offer an assessment of your project: within 24 hours we will tell you how feasible it is to speed up the model.


How to Choose Quantization Method for Your Task?

PTQ (Post-Training Quantization) — a quick path. Take a trained model, run a calibration dataset (200–1000 samples), get INT8 or INT4 weights. Tools: torch.ao.quantization, ONNX Runtime quantization tool, bitsandbytes. Accuracy degradation: 0.5–2% on classification. Red zone — small object detection and segmentation, where PTQ gives -4–8% mAP.

QAT (Quantization-Aware Training) — training with simulated quantization noise. More expensive (retraining), but degradation 0.1–0.5%. Justified when PTQ is unacceptable. In PyTorch — torch.ao.quantization.prepare_qat().

GPTQ / AWQ — for LLMs. AWQ better preserves quality at 4-bit quantization. llm-compressor from Neural Magic or autoawq are the main libraries.

Method Implementation Time Accuracy Degradation Tools
PTQ 1–2 days 0.5–2% (up to 8% on detection) torch.ao, ONNX RT, bitsandbytes
QAT 1–3 weeks 0.1–0.5% torch.ao.prepare_qat, TF Quantization
GPTQ/AWQ 3–7 days 1–3% (LLM) autoawq, llm-compressor

Potential savings from choosing the right method can be substantial — for example, reducing cloud inference costs by up to 70% when deploying to edge. Project cost is calculated individually based on model complexity and target platform.


When to Use Pruning vs Distillation?

Structural pruning removes channels or layers. torch.nn.utils.prune — basic tool. For transformers — attention head pruning (LTP, movement pruning). Result: ResNet-50 after removing 40% of channels with fine-tuning — -35% size, -28% latency, -1.2% top-1 accuracy.

Knowledge distillation — train a small student to mimic a large teacher. Classic via KLDivLoss on soft labels. Feature distillation on intermediate layers is more effective. Hugging Face DistilBERT: 66M vs 110M parameters, -40% latency, -3% on GLUE. This is a model compression technique.

Combined approach: distillation → pruning → QAT. Gives maximum effect on limited hardware. We recorded a case where a client achieved 70% reduction in cloud compute spend after moving to edge with this pipeline.


Target Platforms and Tools

Platform Preferred Format Tool Specifics
NVIDIA Jetson TensorRT engine trtexec, torch2trt INT8 calibration, DLA offload
Apple Silicon / iOS CoreML (.mlmodel) coremltools ANE (Neural Engine) automatically
Android TFLite (.tflite) tf.lite.TFLiteConverter GPU delegate, NNAPI
x86 CPU ONNX + ORT onnxruntime AVX-512, VNNI
Arm Cortex TFLite / ONNX ort-arm, tflite XNNPACK, NEON
Qualcomm NPU QNN (.dlc) Qualcomm AI Hub Hexagon DSP

TensorRT — the main tool for NVIDIA edge. TRT builds a graph with operator fusion, selects optimal kernels. On Jetson AGX Orin YOLOv8m in TRT INT8 gives 78 fps vs 22 fps in fp16 PyTorch — 3.5× improvement.


Practical Case: How We Detected Defects on a Production Line (Our Client)

Task: real-time scratch detection on metal, 30 fps, camera to Jetson Xavier NX (16GB). Original model YOLOv8l mAP50 0.91, server inference 28 ms, on Jetson in fp16 — 110 ms (9 fps). Not suitable.

Optimization steps we performed for our client:

  1. Switch to YOLOv8m — mAP50 0.887 (-2.3%), 68 ms
  2. Export to TensorRT FP16 via yolo export format=engine half=True — 31 ms (32 fps)
  3. INT8 calibration on 500 frames — 22 ms (45 fps), mAP50 0.879

Result: 3.5% degradation at 5× speedup. Client received engine and documentation. We guarantee metric will not drop below agreed threshold — specified in contract.

Example model profiling (layer latency)

Profile slice of YOLOv8m on Jetson Xavier NX (fp16):

  • Convolution (layer 1–5): 12 ms
  • Bottleneck (layer 6–10): 8 ms
  • Head (detection): 11 ms

Bottleneck is the last layers of the head. After quantizing the head separately, head latency dropped to 4 ms.


What is Included in the Work?

  • Report on model profiling on target device (layer latency, bottlenecks)
  • Selection and justification of optimization methods (quantization / pruning / distillation)
  • Optimized model (TensorRT engine / TFLite / CoreML / ONNX)
  • Configs for reproducibility (scripts, Docker image, instructions)
  • Testing on real device (at least 10,000 inferences)
  • Training of your team (2 hours online)
  • 1 month support after delivery

How to Order Model Optimization

  1. Submit a request on the website or contact us in any convenient way.
  2. We perform free profiling of your model on the target device within 24 hours.
  3. We prepare an optimization plan with trade-off estimates (speed vs quality).
  4. You approve the plan — we start work.
  5. After completion, we deliver the optimized model, configs, and documentation.
  6. We train your team and provide monthly support.

Timeline: optimization of an existing model — 2–4 weeks. Development from scratch for edge — 6–16 weeks.

Get a consultation — we will evaluate your model for free and offer a plan within 24 hours. Order free profiling now. For complex projects, contact our engineering team to discuss custom optimisation strategies.