Repository navigation
feat(speech): add LlamaCppLiveAsrAdapter and public streaming routing - #2055
Merged
Merged
Conversation
…' into feat/327-live-asr-public
…' into feat/327-live-asr-public
# Conflicts: # lib/src/backends/llama_cpp/llama_cpp_backend.dart # test/unit/backends/llama_cpp/llama_cpp_backend_test.dart
Contributor
|
Chat app preview removed for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LlamaCppLiveAsrAdapter(sealedSpeechToTextAdaptersubtype) andSpeechToTextCapabilities.streamingInputUnsupportedReasonfor native incremental live PCM speech recognition on llama.cpp (Voxtral Realtime and LFM3-Audio) viaSpeechToTextEngine.load,startStream(), and complete-PCMtranscribe/transcribeOnce.BackendStreamingSpeechToText,BackendStreamingSpeechToTextSession, andBackendStreamingSpeechToTextUpdateSPI tolib/backend.dart,LlamaEngineBackendHooks,NativeLlamaBackend, andNativeAutoBackend.example/basic_app/bin/llamadart_live_asr_example.dart(withSIGINTcancellation handling), updateREADME.md,MIGRATION.md,CHANGELOG.md, website docs/migration/changelog,skills/llamadart-{speech,web}/SKILL.md,capability_coverage.json, andspeech-to-text-stream-smoke(env-configurable paths, JFK keyword content checks, no-silent-loss bounds, cancel-before-first-step / cancel-during-blocked-push / cancel-after-first-text + immediate reuse, per-modelpeakCurrentRssMB, andLLAMADART_STT_LIVE_PACED=1300 s live-paced qualification).origin/main(a60436bfa3fd3eefc0c6776b723726c9cfc2f9be, squash-merge of feat(llama_cpp): add internal live ASR native service and worker protocol #2054) and retargeted feat(speech): add LlamaCppLiveAsrAdapter and public streaming routing #2055 tomain, after addressing all deep-audit and delta-audit P2/P3 findings.Refs #327
Production-readiness scope
SpeechToTextEnginewithLlamaCppLiveAsrAdapter, receiving cumulative confirmed partial events and a final transcript.llamadart-native@v1.0.0-1+ (Voxtral-Mini-4B-Realtime-2602andLFM3-Audio-2BGGUF + audio projector). Qualified locally on macOS arm64 CPU (numberOfThreads: 2,numberOfThreadsBatch: 2) in fast and 300 s live-paced runs.LlamaCppLiveAsrAdapterwithLlamaUnsupportedExceptionbefore model resolution/download/bridge calls. Older native runtimes, mismatched projectors (including Qwen3-ASR), andLFM3-Audiobelow 2,048 per-sequence context capacity throwLlamaUnsupportedException.attachremains prompt-only; file/encoded-byte inputs,languageHint, andcontextPromptare rejected.Completeness checklist
PR type guidance
LlamaCppLiveAsrAdapter+BackendStreamingSpeechToTextSPI,llamadart_live_asr_example.dart, docs/migration/skills/changelog updates, unit/Web/E2E tests.Test Plan
python3 tool/ci/check_format.py(1895 files, 0 changed) — at1c1e6e9eedart analyze(0 issues) — at1c1e6e9eedart run tool/testing/check_platform_boundaries.dart(OK) — at1c1e6e9eecd example/basic_app && dart analyze && dart test(0 issues, +51 ~12 passed) — at1c1e6e9eedart test -p chrome --exclude-tags local-only(+4945 ~1 passed) — at1c1e6e9ee./tool/docs/build_site.sh(4272 pages, 64 in sitemap, no broken internal links) — at1c1e6e9eecoverage-lib(+14929 ~135 passed, 93.78% LCOV (36134/38531)) — at1c1e6e9ee7d67893877checks (unchanged acrossorigin/mainmerge):test/unit/core/speech/ test/unit/tooling/(+2184 ~11 passed),llamadart_live_asr_example.dartSIGINTcancellation (Cancelled.+ exit130), unset-envdart test --run-skipped -t local-only test/e2e/backends/speech_to_text_stream_e2e_test.dart(~3clean skip)c38c393d2breal-model E2E check:TMPDIR="$(mktemp -d)" dart test --run-skipped -t local-only test/e2e/backends/speech_to_text_stream_e2e_test.dart(fast mode, macOS arm64 real models: Voxtral Realtime 300s fast, LFM3-Audio 2048 restart + 300s fast, Qwen3-ASR refusal, JFK keyword + >=25 repetition bounds, cancel-before-first-step / cancel-during-blocked-push / cancel-after-first-text + immediate reuse: +3 passed)eeb8e84ca8check:LLAMADART_STT_LIVE_PACED=1300 s live-paced runMatrix Evidence
static-format-analyze1c1e6e9ee)coverage-lib1c1e6e9ee)root-chrome1c1e6e9ee)speech-to-text-stream-smokec38c393d2b, 2/2 threads)wall=52062msVoxtral fast,wall=7112msLFM3 fast)300 s Live-ASR Qualification (macOS arm64 CPU,
threads=2/2)Voxtral-Mini-4B-Realtime-2602-Q4_K_M.ggufc38c393d2bLFM3-Audio-2B-Q4_K_M.ggufc38c393d2bVoxtral-Mini-4B-Realtime-2602-Q4_K_M.ggufeeb8e84ca8LFM3-Audio-2B-Q4_K_M.ggufeeb8e84ca8*Note: Fast runs at
c38c393d2bmeasure per-modelpeakCurrentRssMB(ProcessInfo.currentRssmax). Earliereeb8e84ca8live-paced rows reflect process-lifetimeProcessInfo.maxRss.Mutation Check Before / After (Audit
d860a618a->c38c393d2b)d860a618a)c38c393d2b9d10ea3b899dbaadbfae0df67fabb8)M01–M26)M06,M11,M13,M15,M17,M18,M23,M26.M19is an equivalent mutant on_LlamaCppStreamingSession(addPcmthrowsLlamaStateExceptionwhen_cancelledis true, caught by_pipeStreamingTask, verifiedpushCalls == 0).M24is unreachable via publicSpeechToTextEngine.T1–T3)T1survived)test/unit/tooling/test_matrix_test.dartnow pinsspeech-to-text-stream-smoke(T1killed).Review Notes
1c1e6e9eeagainstmaina60436bfa(Opus 5.5 auditor-deep sessions: full atd860a618a, deltas atb0507331dand1c1e6e9ee); 0 P1/P2; merge ofmainverified mechanical; CI 36 pass / 9 path-skipped;coverage-lib93.78%; evidencellamadart-evidence/pr-2055/audit-1c1e6e9ee/.1c1e6e9ee7e725fd8caf584dde873bfb896287e1High-risk regression review
backendRuntime,regressionPolicy,structuredOutput)feat/327-live-asr-public)1c1e6e9ee)1c1e6e9ee7e725fd8caf584dde873bfb896287e1/main(a60436bfa3fd3eefc0c6776b723726c9cfc2f9be)missingStructuredOutputEvidence) becauselib/backend.dartgains three export names (BackendStreamingSpeechToText,BackendStreamingSpeechToTextSession,BackendStreamingSpeechToTextUpdate). Maintainer waiver (leehack, 2026-11-18): one-time export-only waiver per Let export-only public entrypoint diffs skip structured-output minima #1806; no structured-output evidence is claimed.speech-to-text-stream-smokeonVoxtral-Mini-4B-Realtime-2602-Q4_K_M.gguf,LFM3-Audio-2B-Q4_K_M.gguf,Qwen3-ASR-0.6B-Q8_0.gguf