← News

Voice, image and video

Swift Packages AnySpeechRecognizer and AnyDecisionModel Bring Open Speech and Decision Models to Apple Platforms

Developer Mattt released two Swift packages: AnySpeechRecognizer keeps Apple's Speech API but swaps in Parakeet, Qwen3-ASR and Sortformer diarization, while AnyDecisionModel returns typed probabilities for yes/no, multiple-choice and rating questions using local open models.

Published: 2026-11-18 13:19 UTCUpdated: 2026-11-18 13:19 UTCSource date: 2026-10-29

Developer Mattt published two Swift packages on October 29 that bring open speech and decision models to Apple platforms. The work extends the approach of AnyLanguageModel 1.0, which unified local and hosted language models in Swift, to two narrower tasks. Both packages require Swift 6.2 or later and macOS 26 or iOS 26 or later.

AnySpeechRecognizer mirrors the SpeechAnalyzer API Apple introduced in macOS 26 and iOS 26, including SpeechTranscriber, DictationTranscriber, SpeechDetector and AssetInventory. Apple's engine remains the default, so existing code only needs a changed import; switching engines means specifying a model when creating the transcriber. Options include NVIDIA's Parakeet TDT 0.6B v3, which the author says recognizes 25 European languages and detects the language itself, Moondream's post-trained Parakeet Ultra, and the English-only Parakeet Unified. Alibaba's Qwen3-ASR is available in 0.6B and 1.7B variants covering 30 languages and 22 Chinese dialects; it runs on the GPU, is slower than Parakeet and suits file transcription better than live input.

The package adds a speaker diarization module Apple's framework lacks. SpeakerDiarizer runs NVIDIA's Streaming Sortformer, tracks up to four speakers even when they overlap, and assigns each timed word to a speaker through a SpeakerTimeline. Converted Core ML models are published on the Hugging Face Hub, with each repository recording its source checkpoint and per-file checksums and the package pinning a fixed revision. According to the author, each Parakeet model is about 600 MB, the live encoder about 590 MB, Qwen3-ASR 0.9 to 2.4 GB and Sortformer about 250 MB, downloaded only when an app requests them.

AnyDecisionModel has no Apple framework to map onto. The author argues decision models are not entirely new, but the naming and attention are, and a Swift API should be ready. Apps often ask a language model whether a message is urgent or which team should handle a ticket, then parse generated text, which yields one answer without the probabilities assigned to alternatives. DecisionSession holds a single text or JSON state, builds a prompt with a one-token label per allowed answer and reads each label's probability from one forward pass, returning typed results with confidence. Questions are independent, so an answer never feeds a later question.

Six backends are offered: MLX, MLX decision heads, Core AI, llama.cpp, Jev and Ollama. The next-token backends cap choices at 26 options and scores at 10 levels; models with trained decision heads, such as Cloudflare's Clef-Flash (9B, a 6.2 GB 4-bit download), have no such limit but currently accept only text and JSON states. The package also provides calibration through temperature and a yes/no bias, plus rotation debiasing that averages probabilities across option orders to counter position bias.

The author measured results with the hear command-line tool on an M4 Max Mac Studio. On LibriSpeech files, Parakeet v3 scored 1.55% and 2.78% word error rate on test-clean and test-other, and 4.73% and 4.29% in live mode; Parakeet Unified scored 1.43% and 2.19% on files; Apple's transcriber scored 2.12% and 3.97%. On AMI meeting recordings with overlapping speech, every tested engine exceeded 23%. The author notes the numbers come from one machine and few datasets, that testing covered macOS 27 but not iPhone, and that developers should measure their own audio.

The broader significance is the decoupling of model choice from framework: the interface stays stable, engines can be swapped, and download, caching and version pinning follow explicit rules. It also reflects a trend in which narrow tasks such as speech recognition, diarization and decisions are handled by purpose-built models rather than general language models, trading generality for lower cost and latency.


Related articles