File size: 3,430 Bytes
7b1658a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
license: mit
base_model: ai-sage/GigaAM-Multilingual-v2
pipeline_tag: automatic-speech-recognition
library_name: mlx
tags:
  - mlx
  - apple-silicon
  - asr
  - speech-recognition
  - gigaam
  - zapformer
  - multilingual
  - streaming
language:
  - ru
  - en
  - kk
  - ky
  - uz
  - be
  - fr
  - es
  - ba
  - ka
  - hy
  - ro
  - tk
  - az
  - tg
  - de
  - it
  - nl
  - pl
  - pt
  - tt
---

# GigaAM-Multilingual-v2-mlx

Pure Apple MLX conversion of [`ai-sage/GigaAM-Multilingual-v2`](https://huggingface.co/ai-sage/GigaAM-Multilingual-v2) (`rnnt` branch) for [gigaam-mlx](https://github.com/aystream/gigaam-mlx).

- **Architecture:** 25-layer Zapformer encoder (`1024 / 1280 @2x / 1024`, `SwishL`/`SwishR`) with FiLM conditioning (`layers 3, 7, 11, 15, 19, 23`), FP32 residual late fusion (`1152 -> 2048 -> 1024`), and 4027-class SentencePiece RNN-T (`max_symbols_per_step=3`).
- **Parameters:** `771,353,916` active MLX parameters (`612` encoder/FiLM tensors in `float16`, `15` head & language-conditioning tensors in `float32`; `~1.5 GB` safetensors).
- **Capabilities:** Full-context & batched variable-length inference, real-time causal streaming (`160 / 320 / 640 ms`), word-level timestamps, optional pure-MLX Conformer VAD, and **zero PyTorch runtime dependency**.

## Supported Languages (`21` + `auto`)

`auto` (default), `ru`, `en`, `kk` (alias `kz`), `ky`, `uz`, `be`, `fr`, `es`, `ba`, `ka`, `hy`, `ro`, `tk`, `az`, `tg`, `de`, `it`, `nl`, `pl`, `pt`, `tt`.

Supports equal-weight mixtures (`"ru-en"`, `'["ru", "en"]'`), weighted mixtures (`'{"ru": 0.7, "en": 0.3}'`), and per-batch language lists (`["ru", "en"]`).

## Quick Start

```bash
pip install git+https://github.com/aystream/gigaam-mlx.git
```

### Python

```python
from gigaam_mlx import load_model, transcribe

model, tokenizer = load_model("multilingual", language="ru")  # or "auto"
text = transcribe(model, tokenizer, "meeting.wav", vad=True)
print(text)

# Streaming with dynamic language switching (resets stream state)
stream = model.create_stream(tokenizer, future_context_ms=320, language="ru")
stream.set_language("en")
```

### CLI

```bash
gigaam-mlx recording.mkv --model-type multilingual --language ru --vad --word-timestamps --format all
gigaam-mlx recording.mkv --model-type multilingual --language '{"ru":0.7,"en":0.3}' --dtype float16
```

## Benchmarks (Apple Silicon M2 Max)

Measured on a 19.0s speech clip and 22-minute (`1319.4s`) audio (`batch_size=4`):

- **19.0s clip:** **0.131s (~146x realtime)** in FP16 / **0.147s (~129x)** in FP32 vs PyTorch CPU `2.007s` (~9.5x).
- **320 ms streaming (320 ms packets):** **30.9 ms/packet (~10.3x)** in FP16 / **34.3 ms/packet (~9.2x)** in FP32 (at 200 ms packets: `19.2 ms` FP16 / `21.9 ms` FP32).
- **Full 22-minute audio with VAD (`1319.4s`, warmed):** **8.43s (~157x realtime, 2.34 GB peak)** in FP16 / **9.93s (~133x, 4.65 GB peak)** in FP32.
- **PyTorch parity:** `mean abs encoder diff <= 6.8e-6` (`max <= 2.8e-4`) and identical decoded text, word timestamps, and `160 / 320 / 640 ms` streaming packet deltas across `auto`, `ru`, `en`, and `ru-en` vs PyTorch CPU FP32.

## Acknowledgments

- Original model & weights: [`ai-sage/GigaAM-Multilingual-v2`](https://huggingface.co/ai-sage/GigaAM-Multilingual-v2) and [Salute Developers GigaAM](https://github.com/salute-developers/GigaAM) (MIT License)
- MLX port: [aystream/gigaam-mlx](https://github.com/aystream/gigaam-mlx)