Skip to content

refactor(stt): extract shared NeMo-family module; decouple NemotronASR from Parakeet (#197)#198

Merged
lucasnewman merged 1 commit into
Blaizzy:mainfrom
beshkenadze:refactor/nemo-shared-module
Jun 9, 2026
Merged

refactor(stt): extract shared NeMo-family module; decouple NemotronASR from Parakeet (#197)#198
lucasnewman merged 1 commit into
Blaizzy:mainfrom
beshkenadze:refactor/nemo-shared-module

Conversation

@beshkenadze

Copy link
Copy Markdown
Contributor

What

Extract the genuinely-shared NeMo-family leaf blocks out of Parakeet into a new Sources/MLXAudioSTT/Models/Nemo/ group so that two sibling models no longer depend on each other.

NemotronASR previously reused Parakeet's public types (rel-pos attention, RNN-T prednet/joint, decoding, alignment, and the RNN-T config structs). This PR moves those shared types into Models/Nemo/, renamed Parakeet*Nemo*, and repoints NemotronASR at the Nemo* names. NemotronASR no longer references Parakeet at all.

Moves (git mv, renamed inside)

from to
Parakeet/ParakeetAttention.swift Nemo/NemoAttention.swift
Parakeet/ParakeetRNNTLayers.swift Nemo/NemoRNNTLayers.swift
Parakeet/ParakeetDecodingLogic.swift Nemo/NemoDecodingLogic.swift
Parakeet/ParakeetAlignment.swift Nemo/NemoAlignment.swift
4 RNN-T config structs lifted out of ParakeetConfig.swift Nemo/NemoRNNTConfig.swift

Renamed types follow the prefix swap: ParakeetRelPositionMultiHeadAttentionNemoRelPositionMultiHeadAttention, ParakeetPredictNetworkNemoPredictNetwork, ParakeetJointNetworkNemoJointNetwork, ParakeetLSTMStateNemoLSTMState, ParakeetDecodingLogicNemoDecodingLogic, ParakeetAligned*/ParakeetAlignmentNemoAligned*/NemoAlignment, and the 4 Parakeet*ConfigNemo*Config.

Back-compat

One shim file Parakeet/ParakeetNemoAliases.swift adds typealias Parakeet* = Nemo* for every moved type (access levels mirror the underlying types). This keeps ParakeetModel.swift, ParakeetConformer.swift, the rest of ParakeetConfig.swift, the existing tests, and any external code compiling with zero edits.

Scope

Pure move/rename — no behavior change. ParakeetModel.swift and ParakeetConformer.swift are untouched; ParakeetConfig.swift only loses the 4 extracted structs.

swift build passes (only pre-existing README resource warnings). Test targets compile, and the pure-logic alignment/decoding unit tests (ParakeetSTTTests) pass.

Closes #197

…R from Parakeet (Blaizzy#197)

Move the genuinely-shared NeMo-family leaf blocks out of Parakeet into a
new Models/Nemo/ group, renamed Parakeet*->Nemo*:

- ParakeetAttention.swift     -> Nemo/NemoAttention.swift
- ParakeetRNNTLayers.swift    -> Nemo/NemoRNNTLayers.swift
- ParakeetDecodingLogic.swift -> Nemo/NemoDecodingLogic.swift
- ParakeetAlignment.swift     -> Nemo/NemoAlignment.swift
- 4 RNN-T config structs lifted from ParakeetConfig.swift -> Nemo/NemoRNNTConfig.swift

Add one back-compat shim (Parakeet/ParakeetNemoAliases.swift) with
typealias Parakeet* = Nemo* for every moved type, so ParakeetModel,
ParakeetConformer, the rest of ParakeetConfig, tests, and external code
keep compiling untouched. Repoint NemotronASR directly at the Nemo*
names; it no longer references Parakeet at all.

Pure move/rename with no behavior change. swift build passes; the
pure-logic alignment/decoding unit tests pass.

Closes Blaizzy#197
@lucasnewman lucasnewman merged commit 416f08c into Blaizzy:main Jun 9, 2026
1 check passed
@beshkenadze beshkenadze deleted the refactor/nemo-shared-module branch June 10, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nemotron_asr couples to Parakeet config (anti-pattern); extract a shared NeMo-family module

2 participants