Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions docs/models/koyal-120m.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Koyal 120M

[Adalat AI](https://www.adalat.ai/)'s Koyal 120M: four small offline
speech-to-text models, one per language, built for document-ready dictation.
The output has punctuation and numerals (`20ನೇ`, not `ಇಪ್ಪತ್ತನೇ`), so it can go
straight into a document.

| Variant | Language | Upstream |
| --- | --- | --- |
| `koyal-hi-120m-1.0` | Hindi (`hi`) | [`adalat-ai/koyal-hi-120m-1.0`](https://huggingface.co/adalat-ai/koyal-hi-120m-1.0) at [`7f2cb57`](https://huggingface.co/adalat-ai/koyal-hi-120m-1.0/commit/7f2cb57) |
| `koyal-kn-120m-1.0` | Kannada (`kn`) | [`adalat-ai/koyal-kn-120m-1.0`](https://huggingface.co/adalat-ai/koyal-kn-120m-1.0) at [`a169f0b`](https://huggingface.co/adalat-ai/koyal-kn-120m-1.0/commit/a169f0b) |
| `koyal-ml-120m-1.0` | Malayalam (`ml`) | [`adalat-ai/koyal-ml-120m-1.0`](https://huggingface.co/adalat-ai/koyal-ml-120m-1.0) at [`8135bc8`](https://huggingface.co/adalat-ai/koyal-ml-120m-1.0/commit/8135bc8) |
| `koyal-te-120m-1.0` | Telugu (`te`) | [`adalat-ai/koyal-te-120m-1.0`](https://huggingface.co/adalat-ai/koyal-te-120m-1.0) at [`1f301af`](https://huggingface.co/adalat-ai/koyal-te-120m-1.0/commit/1f301af) |

Weights are CC-BY-4.0.

## What it is

A classic NeMo Conformer hybrid TDT+CTC model (17 layers, d_model 512, about
120M parameters). The encoder is warm-started from AI4Bharat's MahaDhwani and
fine-tuned per language. transcribe.cpp ships the TDT head, like
`parakeet-tdt_ctc-110m`.

It is not a FastConformer, unlike the rest of the
[Parakeet family](parakeet.md). It runs on the parakeet path because only the
subsampling block differs: NeMo `striding` (two full convs, 4x) in place of
`dw_striding` (8x). The Conformer blocks, the TDT decoder and the tokenizer
are the same code. Frames are 40 ms, not 80 ms. Long audio uses a 512-frame
local attention window, which covers the same 20.5 s as the 256-frame window
at 8x.

One language per model. The model does not need a language hint. If one is
given it is only checked: the model's own code (`-l ml` for the Malayalam
model) is accepted, and anything else is an error. No streaming, translation
or language detection.

| Quantization | Size |
| --- | ---: |
| F32 | 479 MB |
| Q8_0 | 149 MB |
| Q5_K_M | 113 MB |
| Q4_K_M | 101 MB |

## Accuracy

WER on the full FLEURS test split (hi 418, kn 838, ml 958, te 472
utterances), transcribe.cpp on an NVIDIA A100 (CUDA), batch size 1,
timestamps none, scored with `scripts/wer/score.py` like the other Indic
language rows in this repo.

| Quantization | hi | kn | ml | te |
| --- | ---: | ---: | ---: | ---: |
| F32 | 5.38% | 5.85% | 5.57% | 7.34% |
| Q8_0 | 5.35% | 5.86% | 5.58% | 7.35% |
| Q5_K_M | 5.21% | 5.92% | 5.55% | 7.17% |
| Q4_K_M | 5.27% | 5.94% | 5.59% | 7.18% |

## Quick start

```bash
cmake -B build
cmake --build build

uv run --project scripts/envs/parakeet \
scripts/convert-parakeet.py adalat-ai/koyal-ml-120m-1.0

build/bin/transcribe-quantize \
models/koyal-ml-120m-1.0/koyal-ml-120m-1.0-F32.gguf \
models/koyal-ml-120m-1.0/koyal-ml-120m-1.0-Q8_0.gguf \
--quant Q8_0

build/bin/transcribe-cli \
-m models/koyal-ml-120m-1.0/koyal-ml-120m-1.0-Q8_0.gguf \
-l ml samples/ml-short.wav
```

The converter writes `models/<variant>/<variant>-F32.gguf`; the folder name
sets the variant. Repeat the quantize step with `Q5_K_M` or `Q4_K_M` for the
smaller files.

## Numerical validation

Each variant is validated tensor by tensor against NeMo on its
`samples/<lang>-short.wav`, with the shared parakeet tolerances:

```bash
uv run scripts/validate.py all --family parakeet --variant koyal-ml-120m-1.0
```

## Attribution

Weights: Adalat AI, CC-BY-4.0. The encoder is warm-started from AI4Bharat's
MahaDhwani. Conversion drops the auxiliary CTC head and renames tensors; it
does not retrain the model.
4 changes: 4 additions & 0 deletions docs/models/parakeet.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ Most users want one of three:
five-value-quantized repack of v3, expanded back to dense weights here.
English only, accuracy on par with `parakeet-tdt-0.6b-v2`. CC-BY-4.0
weights. See [phonon-2.md](phonon-2.md).
- **Hindi, Kannada, Malayalam or Telugu → Koyal 120M.** Adalat AI's small
per-language dictation models; output keeps punctuation and numerals.
Classic Conformer (4x subsampling) rather than FastConformer.
See [koyal-120m.md](koyal-120m.md).
- **Streaming / real-time → Nemotron streaming.** Most Parakeet variants here
are offline-only. For low-latency streaming use the FastConformer-lineage
[`nemotron-3.5-asr-streaming-0.6b`](nemotron-3.5-asr-streaming-0.6b.md)
Expand Down
33 changes: 33 additions & 0 deletions docs/porting/families/parakeet.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,3 +666,36 @@ strict CPU-reference tensor tolerances. Packed compute, deployment
quantization and publication readiness are not claimed. Detailed evidence is
recorded in
`reports/porting/parakeet/phonon-2/_porting-log.md`.

## Koyal 120M classic-Conformer variants

Source `adalat-ai/koyal-{hi,kn,ml,te}-120m-1.0`; NeMo reference, the shared
`scripts/envs/parakeet` environment and
`scripts/dump_reference_parakeet_nemo.py`. See
[the variant documentation](../../models/koyal-120m.md) for reproduction and
scope.

These are the only variants in the family that are not FastConformer. The
encoder is a classic NeMo Conformer (17 layers, d_model=512, kernel 31, 80
mels) whose `pre_encode` is `striding`: conv0, then one more full 3x3
stride-2 conv, 4x in time. FastConformer's `dw_striding` is conv0 plus two
depthwise-separable pairs, 8x. Everything after `pre_encode` (the Conformer
blocks, relative-position attention, the TDT decoder and joint, the BPE
tokenizer) is the existing parakeet code, so they run on the parakeet path
rather than as a new family.

KV `stt.parakeet.encoder.subsampling=striding` selects the stack. The key is
written only for striding; an absent key means `dw_striding`, so existing
GGUFs load and convert unchanged. Frames are 40 ms instead of 80 ms, so the
long-form local-attention window is 512 frames to keep the same 20.5 s.
Striding with `chunked_limited` attention is rejected: causal striding is not
implemented.

The upstream checkpoints are hybrid TDT+CTC. The auxiliary CTC head is
dropped at convert time, as for `tdt_ctc-110m`, through the profile flag
`drop_aux_ctc`. Each model takes one language; a language hint is optional
and any other language is an error.

Each variant has its own golden manifest on an 11 s FLEURS clip in its
language and passes with the shared `tests/tolerances/parakeet.json`
(16/16 tensors, transcript exact).
11 changes: 11 additions & 0 deletions reports/porting/parakeet/forward-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,14 @@ Subsampler pointwise bias is masked on padded frames via
Global TDT budget uses the existing implementation. Gate tensors cover mel,
subsampler, positional encoding, blocks 0/12/23, block-0 residual stages,
encoder final, blank embedding, LSTM states and first joint logits.

### Koyal 120M / striding variant

Classic NeMo Conformer, not FastConformer: 17 layers, d_model=512, n_mels=80,
`use_bias=true`, TDT head, pred_n_layers=1, BPE 512. Same forward structure
as `tdt_ctc-110m` except `pre_encode`, which is NeMo `striding`
(`ConvSubsampling` with `subsampling="striding"`): conv0 -> ReLU -> full 3x3
stride-2 conv -> ReLU -> flatten -> linear, 4x in time, selected by
`stt.parakeet.encoder.subsampling=striding`. Valid lengths use two stride-2
stages instead of three. Oracle: NeMo, the same dumper as the other NeMo
variants. Gate tensors and tolerances are the shared family set.
198 changes: 198 additions & 0 deletions reports/porting/parakeet/koyal-hi-120m-1.0/intake.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
{
"schema_version": "transcribe-intake-v1",
"family": "parakeet",
"hf_repo": "adalat-ai/koyal-hi-120m-1.0",
"hf_revision": "7f2cb579598ba607b7ebb78a1b523fbcb83f4cf9",
"sources": {
"config": {
"kind": "hf_file",
"path": "config.json",
"status": "missing",
"detail": "NeMo .nemo archive only; model_config.yaml inside it is the config."
},
"preprocessor": {
"kind": "hf_file",
"path": "preprocessor_config.json",
"status": "missing",
"detail": "Inside .nemo as model.cfg.preprocessor: AudioToMelSpectrogramPreprocessor, 80 mels."
},
"tokenizer_config": {
"kind": "hf_file",
"path": "tokenizer_config.json",
"status": "missing",
"detail": "SentencePiece BPE inside .nemo, vocab_size=512, punctuation and digits in vocab."
},
"tokenizer_json": {
"kind": "hf_file",
"path": "tokenizer.json",
"status": "missing"
},
"generation_config": {
"kind": "hf_file",
"path": "generation_config.json",
"status": "missing"
},
"safetensors_metadata": {
"kind": "hf_api",
"path": "HfApi.get_safetensors_metadata",
"status": "missing",
"detail": "PyTorch state_dict inside .nemo"
},
"model_card": {
"kind": "hf_api",
"path": "https://huggingface.co/adalat-ai/koyal-hi-120m-1.0",
"status": "found",
"detail": "Monolingual Hindi dictation model; rich-orthography output (punctuation, numerals); CC-BY-4.0; encoder warm-started from ai4bharat/MahaDhwani_pretrained_conformer."
},
"reference_modeling_code": {
"kind": "reference_code",
"path": "scripts/convert-parakeet.py, src/arch/parakeet/, src/conformer/",
"status": "found",
"detail": "Existing TDT path applies after pre_encode; pre_encode is NeMo ConvSubsampling with subsampling=striding."
}
},
"variants": [
{
"name": "koyal-hi-120m-1.0",
"memory_gb": 0.5,
"files": [
"koyal-hi-120m-1.0.nemo"
]
}
],
"config": {
"architecture_candidates": [
"encoder-transducer"
],
"key_fields": {
"architectures": [
"EncDecHybridRNNTCTCBPEModel"
],
"model_type": "conformer_tdt_ctc",
"encoder.type": "ConformerEncoder (classic Conformer, not FastConformer)",
"encoder.n_layers": 17,
"encoder.d_model": 512,
"encoder.n_heads": 8,
"encoder.ff_expansion_factor": 4,
"encoder.conv_kernel_size": 31,
"encoder.subsampling": "striding",
"encoder.subsampling_factor": 4,
"encoder.self_attention_model": "rel_pos",
"encoder.att_context_size": [
-1,
-1
],
"decoder.type": "RNNTDecoder (predictor)",
"decoder.pred_hidden": 640,
"decoder.pred_rnn_layers": 1,
"joint.type": "RNNTJoint (TDT)",
"joint.joint_hidden": 640,
"joint.durations": [
0,
1,
2,
3,
4
],
"joint.num_extra_outputs": 5,
"ctc_decoder.type": "ConvASRDecoder",
"tokenizer.vocab_size": 512,
"tokenizer.has_punctuation_capitalization": true
},
"varying_across_variants": [
"tokenizer vocabulary (one language per variant)"
]
},
"dtype": {
"expected": "float32",
"source": "config",
"evidence": "NeMo .nemo, PyTorch state_dict at float32; model_config.yaml declares no other precision.",
"details": {
"config_declared": null,
"header_distribution": {}
},
"expected_f32_tensors": []
},
"frontend": {
"sample_rate": 16000,
"n_mels": 80,
"hop_length": 160,
"fft_size": 512,
"window": "hann_periodic",
"normalization": "per_feature",
"preemphasis": 0.97,
"dither": 1e-05,
"center": true,
"padding_mode": "reflect",
"mel_filterbank_norm": "slaney"
},
"tokenizer": {
"type": "sentencepiece",
"vocab_size": 512,
"special_tokens": {
"blank": 512
},
"has_language_tokens": false,
"vocab_sha256": null
},
"capabilities": {
"languages": [
"hi"
],
"language_detection": false,
"translation": false,
"timestamps": [
"token",
"word",
"segment"
],
"streaming": false,
"speaker_diarization": false
},
"upstream_benchmarks": [
{
"dataset": "FLEURS-RO test",
"language": "hi",
"metric": "other",
"score": 9.03,
"score_unit": "percent",
"source": "https://huggingface.co/adalat-ai/koyal-hi-120m-1.0",
"notes": "WER_SCRIBE from the model card, 418 clips: scribe-eval alignment over all tokens, no text normalization, against rich-orthography references (adalat-ai/fleurs-ro)."
},
{
"dataset": "FLEURS-RO test",
"language": "hi",
"metric": "wer",
"score": 10.63,
"score_unit": "percent",
"source": "https://huggingface.co/adalat-ai/koyal-hi-120m-1.0",
"notes": "jiwer WER on the same unnormalized text, from the model card."
},
{
"dataset": "FLEURS-RO test",
"language": "hi",
"metric": "cer",
"score": 3.79,
"score_unit": "percent",
"source": "https://huggingface.co/adalat-ai/koyal-hi-120m-1.0",
"notes": "jiwer CER on the same unnormalized text, from the model card."
}
],
"reference_framework": "nemo",
"reference_rationale": "Standard NeMo checkpoint with no custom code; same NeMo reference and dumper as the rest of the family.",
"architecture_pattern": "encoder-transducer",
"known_risks": [
"Classic Conformer, not FastConformer: pre_encode is NeMo `striding` (conv0 plus one full 3x3 stride-2 conv, 4x), not `dw_striding` (8x). Needs its own subsampling path; frames are 40 ms.",
"Long-form local-attention window is sized in frames; at 4x it must be 512 frames to cover the same 20.5 s as 256 frames at 8x.",
"Hybrid TDT + CTC head sharing the encoder; ship TDT only, as for tdt_ctc-110m. The variant name has no `tdt_ctc`, so the converter needs an explicit flag to drop the aux CTC head.",
"NeMo keeps a masked padding frame when the frame count is a multiple of 4, so the reference encoder dump is one frame longer there; pick golden clips that avoid it.",
"Punctuation and digits in vocab: WER depends on how the reference and normalizer treat them.",
"Standard parakeet TDT risks (joint duration, rel_pos shift, preemph ordering, per-feature norm, blank id)."
],
"intake_gaps": [
{
"field": "tokenizer.vocab_sha256",
"reason": "Computed at convert time."
}
]
}
Loading