
Introducing AnySpeechRecognizer and AnyDecisionModel for Apple Platforms

The AnyLanguageModel project is extending its Swift approach to speech and decisions. AnySpeechRecognizer wraps Apple’s new SpeechAnalyzer API from macOS 26 and iOS 26, keeping the familiar module structure while letting apps choose the recognition engine. AnyDecisionModel provides a Swift API for yes-or-no, multiple-choice, and rating-scale questions, returning typed results and probabilities derived from models rather than from generated text. Both packages download open models from the Hugging Face Hub and run on device.
AnySpeechRecognizer mirrors SpeechAnalyzer, SpeechTranscriber, DictationTranscriber, SpeechDetector, and AssetInventory, with Apple’s Speech framework as the default engine; for code using that shared API, changing the import is enough. Supported engines include NVIDIA’s Parakeet v3, a polyglot model covering 25 European languages without requiring a locale; Moondream’s Parakeet Ultra, a post-trained version that was more accurate in most of the package’s measurements; and NVIDIA’s English-only Parakeet Unified. These run on the package’s own Core ML runtime with file and live input, volatile results, word timing, and word confidence. Qwen3-ASR from Alibaba is also available in 0.6B and 1.7B sizes, covering 30 languages and 22 Chinese dialects, with automatic language detection or an explicit locale. It returns one final result per segment of up to 40 seconds, runs on the GPU, and is slower, so it is better suited to files than live input. Additional engines can be added by implementing SpeechRecognitionModel and SpeechRecognitionExecutor.
The Core ML conversions are published on the Hugging Face Hub with source checkpoints, per-file checksums, and pinned revisions. Parakeet repositories include an 8-second encoder for live input that cuts live analysis time by about a third at a somewhat higher word error rate. Download sizes are roughly 600 MB per Parakeet model, about 590 MB for the live encoder, 0.9 to 2.4 GB for Qwen3-ASR, and about 250 MB for Sortformer. Since Apple’s Speech framework has no diarization module, AnySpeechRecognizer adds SpeakerDiarizer, which runs NVIDIA’s Streaming Sortformer on Core ML alongside a transcriber on the same timeline. It tracks up to four speakers, even when they overlap, and a SpeakerTimeline attributes each timed word to a speaker. Sortformer v2 is the default, with v2.1 available as a meeting-tuned alternative.
The package reports word error rates measured on an M4 Max Mac Studio with macOS 27.0.1 using LibriSpeech files of 3 to 8 minutes. On test-clean and test-other, Parakeet v3 achieved 1.55% and 2.78% from files, and 4.73% and 4.29% live; Parakeet Ultra achieved 1.66% and 2.55% from files, and 2.65% and 3.28% live; Parakeet Unified achieved 1.43% and 2.19% from files, and 1.45% and 2.42% live; Apple’s transcriber achieved 2.12% and 3.97%. Parakeet transcribes an hour of audio in about 20 to 40 seconds from a file, or about 1.5 to 2.5 minutes live, with roughly 100 MB of memory after model compilation. Qwen3-ASR is much slower and needs a few gigabytes. On AMI meeting recordings with overlapping speech, every engine had a word error rate above 23%. These results come from one machine and a few datasets, and the authors have so far tested only on macOS, not on an iPhone.
AnyDecisionModel has no Apple framework to map onto. A DecisionSession holds a single text or JSON state, and every question is about that state. The API gives probability(of:), choice, and score calls returning a Double, a Choice containing the selected case plus per-option probabilities and confidence, and a Score with expected level and per-level probabilities. Questions are independent and can be batched through decide(_:). The MLX backend builds a prompt with a one-token label per allowed answer and reads the label probabilities from one forward pass. Local backends accept a Calibration that applies temperature and a yes-or-no bias, and rotationDebiasing can average over rotated option orders at the cost of one prompt evaluation per rotation. The reported confidence is based on probability entropy, not correctness, so error rates should be checked on real data.
Decision heads are a newer approach, exemplified by Cloudflare’s Clef models. AnyDecisionModel can run Clef-Flash, a 9B variant, on a Mac with MLX using MLXHeadDecisionModel, reading decisions from the trained decision head rather than next-token probabilities. The 4-bit model is a 6.2 GB download and its model card recommends at least 16 GB of memory; this backend accepts only text and JSON states even though Clef itself can read images and video. The package has six backends overall: MLX, MLX decision heads, Core AI, llama.cpp, Jev through TypeSafe’s System One API, and Ollama. Next-token backends limit choices to 26 options and scores to 10 levels; decision heads have no such limit. Swift package traits keep the core dependency-free, with Jev and Ollama also building on Linux.
The Emoji Magnet example app shows the decision API in practice: a text field sits above 343 emoji, and matching emoji rise out of the pile with no keyword rules, only model decisions at inference time. On the hosted Jev backend, all 343 yes-or-no questions are answered in one request, settling in about half a second. Without an API key, the app runs Qwen3 4B locally with MLX, using prefix caching to evaluate the state once and answer 16 questions per forward pass; on an M4 Max, a group of 16 takes about 0.45 seconds and a full pass about 10 seconds.
Both packages require Swift 6.2 or later and macOS 26 or iOS 26 or later. Parakeet, Sortformer, and the MLX backend require Apple silicon; AnyDecisionModel‘s MLX build tasks use Xcode’s Swift 6.4 or later and the Metal toolchain, while Core AI requires Xcode 27 and an OS 27 runtime. For now, AnyDecisionModel‘s CoreAI trait cannot be combined with AnySpeechRecognizer because coreai-kit 0.7.3 requires swift-huggingface below 1.0 while AnySpeechRecognizer requires 1.x. AnySpeechRecognizer also ships a hear command-line tool for transcription, speaker labeling, and evaluation.


