• स्ट्रीमिंग speech recognition को native environment और browser, दोनों में चलाने के लिए Rust-आधारित implementation है, जो Burn ML framework का उपयोग करता है
  • मॉडल Mistral के Voxtral Mini 4B Realtime पर आधारित है, और WASM + WebGPU के जरिए browser tab में पूरी तरह client-side inference करता है
  • Q4 GGUF quantized model (2.5GB) ब्राउज़र में चल सकता है, जबकि SafeTensors-आधारित F32 model (9GB) native environment में काम करता है
  • browser constraints (2GB allocation, 4GB address space, GPU read limits आदि) को हल करने के लिए sharding, 2-stage loading, asynchronous tensor processing जैसी तकनीकें लागू की गई हैं
  • यह Apache-2.0 license के तहत जारी किया गया है, और HuggingFace Spaces पर real-time demo आज़माया जा सकता है

Voxtral Mini 4B Realtime (Rust) का अवलोकन

  • Mistral के Voxtral Mini 4B Realtime मॉडल को Rust और Burn ML framework में पूरी तरह implement किया गया है
    • streaming speech recognition को local और browser environment में चलाया जा सकता है
    • browser version WASM(WebAssembly) और WebGPU का उपयोग करके client-side पर चलता है
  • Q4 GGUF quantized model (लगभग 2.5GB) ब्राउज़र में चलता है, जबकि F32 SafeTensors model (लगभग 9GB) native environment में उपयोग होता है
  • HuggingFace Spaces पर real-time demo उपलब्ध है

आर्किटेक्चर

  • input audio (16kHz mono) को Mel spectrogram में बदलने के बाद, यह encoder (32 layers) और decoder (26 layers) से होकर text में परिवर्तित होता है
  • मुख्य processing steps
    • Mel spectrogram → encoder (32 layers, 1280 dimensions) → Conv 4x downsample → adapter (3072 dimensions) → decoder (GQA 32Q/8KV)
  • दो inference paths उपलब्ध हैं
    • F32(native): SafeTensors-आधारित, Burn tensor operations का उपयोग
    • Q4 GGUF(native + browser): GGUF Q4_0 quantization, custom WGSL shader का उपयोग

ब्राउज़र में चलाने के लिए तकनीकी समाधान

  • ब्राउज़र में 4B मॉडल चलाने के लिए 5 constraints को हल किया गया
    1. 2GB allocation limitShardedCursor से multi-buffer reading
    2. 4GB address space limit → 2-stage loading (parsing के बाद reader release, फिर finalization)
    3. 1.5GiB embedding table → GPU Q4 embeddings + CPU row lookup
    4. GPU synchronous read प्रतिबंधितinto_data_async().await का उपयोग
    5. 256 workgroup limit → cubecl-wgpu patch से kernel size limit

Q4 padding correction

  • डिफ़ॉल्ट mistral-common audio को 32 silent tokens से pad करता है, लेकिन यह decoder के 38 prefix में से केवल आधे को कवर करता है
  • Q4_0 quantized model में इसके कारण ऐसे input पर त्रुटि होती है जहाँ speech तुरंत शुरू हो जाती है
  • इसे ठीक करने के लिए padding को 76 tokens (=38 decoder tokens) तक बढ़ाया गया, ताकि पूरा prefix silence से भर जाए

build और test

  • build options
    • default: cargo build --release (wgpu + native-tokenizer)
    • browser के लिए: wasm-pack build --target web --features wasm
  • test
    • GPU-आधारित unit और integration tests समर्थित हैं
    • E2E browser tests Playwright + वास्तविक GPU environment में चलाए जाते हैं
    • CI में GPU न होने के कारण संबंधित tests छोड़े जाते हैं

मॉडल तैयारी और sharding

  • browser के ArrayBuffer limit (512MB से कम) के लिए GGUF file को shard units में विभाजित किया जाता है
    split -b 512m models/voxtral-q4.gguf models/voxtral-q4-shards/shard-  
    
  • development server और E2E tests अपने-आप shards खोज लेते हैं

license और resources

अभी कोई टिप्पणी नहीं है.

अभी कोई टिप्पणी नहीं है.