FluidAudio ASR runs inside an iOS keyboard extension (CPU and ANE): how, and numbers
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- ios, swift
- Área
- machine-learning, mobile-dev
Línea de trabajo
Read the issue's iOS keyboard extension probe details and the two questions about ANE reliability and sharing compiled CoreML caches through an App Group. The payload names no FluidAudio source files or tests to start from; first check the relevant CoreML and iOS extension APIs, then verify whether either approach is supported. Done means providing evidence-backed answers to both questions; the issue is exploratory and needs iOS/CoreML expertise.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Edited 2026-11-19: on-device probe results added; earlier version assumed the memory cap was the blocker, which turned out wrong.
Following up on a Discord thread. This is a case study / FYI with a couple of narrow questions at the end, not a bug report. FluidAudio tdtCtc110m loads and transcribes inside a custom keyboard extension on iOS 27, on both CPU and the ANE (confirmed with MLComputePlan), at well under the extension memory cap.
How: audio capture in a keyboard extension
Keyboard extensions don't get record entitlements. audiomxd logs that the process "is an extension and doesn't have entitlements to record audio". Hex (anomalyco/hex#1999, ios/HEXKeyboard/KeyboardLocalDictation.swift) gets around this with no entitlement:
- A hidden 2×2 px
WKWebView(alpha 0.02) loads an inline page that callsnavigator.mediaDevices.getUserMedia({audio}). WKUIDelegate.requestMediaCapturePermissionForauto-grants.microphone. WebKit's media process captures under the containing app's mic permission.- A
ScriptProcessorsends Int16 PCM as base64 to Swift throughwebkit.messageHandlers. - The keyboard's Info.plist adds
NSMicrophoneUsageDescriptionandNSSpeechRecognitionUsageDescription.
Hex then transcribes with Apple SpeechTranscriber (out of process). I used the same capture, but with FluidAudio in-process instead.
On-device probe (iPhone 16, iOS 27)
The containing app stages tdtCtc110m in the App Group container. The keyboard loads it with AsrModels.load(from:) and runs it in-process, with the containing app not running. The probe logs phys_footprint and os_proc_available_memory at each step.
Capture works at 48 kHz with healthy levels (peak 0.9998, rms 0.11).
CPU (.cpuOnly) |
ANE (.cpuAndNeuralEngine) |
|
|---|---|---|
| First load | ≈30 s (one-time CoreML compile, then cached) | 6.2 s |
| Later loads | 0.6 s | — |
| Audio → transcription time | 10.3 s → 231 ms (≈45× RT) | 27.0 s → 294 ms (≈92× RT) |
| Output | correct text inserted into Notes | correct text |
phys_footprint peak |
23 MB | 25 MB |
-
Cap: footprint +
os_proc_available_memory≈ 177 MB, which matches Hex's ~176 MB on iPhone 17 Pro / iOS 27.2. -
Memory headroom: even five accidental concurrent loads peaked at 34 MB.
-
What counts against the cap: the model's ~217 MB on-disk size is not charged to the extension. The compiled CoreML weights are clean, file-backed pages.
-
iOS 27 ANE attribution: the iOS 27.0 notes say Neural Engine memory is now attributed to the app process (174796039, background ANE gated by 179282606, see #738 / FB23457001). Even so, the ANE run stayed at 25 MB.
-
ANE confirmed:
MLComputePlanrun inside the keyboard:Model .cpuAndNeuralEngine.cpuOnlyPreprocessor (fused 110M encoder) ANE 988 ops / CPU 55 CPU 1043 Decoder (19 ops) CPU CPU JointDecision (24 ops) CPU CPU The
phys_footprintpeak in that run was 29 MB (ANE) / 32 MB (CPU) of the ~177 MB cap.
For contrast, my full app (Parakeet v2 + CTC-110M spotter + CPU fallback twins) peaks at 657 MB during load. That heavier load path is a different case and doesn't predict the extension numbers.
Mac bake-off (accuracy context)
M4 Mac mini, macOS 27.2, FluidAudio 0.18.4. 11 of my own dictation clips, 270 s of audio / 731 reference words. WER ignores case and punctuation. RTFx is measured on warm models.
| Engine | WER | RTFx | First load + warm-up |
|---|---|---|---|
| Parakeet v2 | 2.60% (19/731) | 266× | 14.0 s |
| tdtCtc110m | 4.38% (32/731) | 482× | 4.9 s |
| Phonon-2 | 4.92% (36/731) | 124× | n/a (196 s, includes ~360 MB download) |
Apple SpeechTranscriber |
6.02% (44/731) | 73× | 0.7 s (out of process) |
On my speech, tdtCtc110m beats Apple's on-device model (4.4% vs 6.0% WER) and is ~6.5× faster. Since it now runs inside the keyboard, it's a real upgrade over the out-of-process approach.
Questions
- Is there any known reason ANE-in-extension would break later, e.g.
anedlimits, compile-cache location/eviction, or per-process ANE quotas once iOS 27 attribution applies? - The first CPU load compiled for ~30 s inside the extension. Is there a supported way to compile in the containing app and share the compiled cache with the extension via the App Group, so the keyboard never pays the compile?
- Lenguaje dominante
- Swift
- Estrellas
- 3k
- Forks
- 451
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 87
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de FluidInference/FluidAudio
-
Kokoro ANE legacy: Alignment still runs the graph that traps at 48 tokens (#1172 fixed v3 only)Abiertobug text-to-speech
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
FluidInference/FluidAudio#1201 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
FluidInference/FluidAudio#1200 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
FluidInference/FluidAudio#1194 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
FluidInference/FluidAudio#1193 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
FluidInference/FluidAudio#1191 ·
Los mantenedores suelen responder en 1 día
Todos los issues de FluidInference/FluidAudio
Issues similares
-
area: build-and-ci S3: minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
manaflow-ai/cmux#65734 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
OneBusAway/onebusaway-ios#2025 ·
Los mantenedores suelen responder en 1 día
-
good first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
erkamyaman/rust-anything#930 ·
Los mantenedores suelen responder en 1 día
-
contributor: external iOS needs review sdk-58 severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
expo/expo#54458 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
SwiftOldDriver/iOS-Weekly#5528 ·
Los mantenedores suelen responder en 1 día