[codex] Improve macOS dictation latency - #37
murmer-blip wants to merge 14 commits into
Conversation
|
Update from the latest latency pass:
Checks run locally:
Live macOS benchmark notes from this machine:
One observed tradeoff: the background warmup is cooperative between buckets, but an individual MLX generation cannot be interrupted mid-bucket. It runs after readiness and restores the short speech bucket last to protect the common short-dictation path. |
|
Follow-up update for the common short-dictation path:
Checks run locally:
Live macOS benchmark from this machine after background warmup completed:
Tradeoff: startup readiness got heavier than the previous 4s-bucket-only warmup, but the common short path no longer pays the 4s minimum bucket or the first-use spoken-shape spike. |
|
Updated with a real-audio latency fix after Matthew's latest hotkey trace disproved the synthetic benchmark. Finding:
Fix in
Benchmarks on the same Mac, same daemon/HTTP route, same captured mic files:
Verification:
Caveat:
|
|
Follow-up fix pushed in Second finding:
Follow-up fix:
Verification:
|
|
Correction after checking Matthew's latest real shortcut use: the previous fix was not sufficient. Latest live use:
What reproduced the failure:
Root cause update:
Fix in
Verification:
|
Summary
RECwhile capture is active/stopping, thenTXT...once transcription startsTXT...transitionBenchmark Results
Notes:
model.generate()and manualsample_lencaps because they were unstable or slower on this MLX build.Validation
uv run python -m tests(360 tests OK)uv run ruff check transclip/asr.py transclip/service/engine.py transclip/desktop/hotkey/macos.py tests/test_asr.py tests/test_service.py tests/test_macos_hotkey.pyuv run scripts/bench_mlx_txt_latency.py --reps 3 --label final-speedupsuv run scripts/bench_macos_hotkey_latency.py --repetitions 50 --warmups 5 --scenario startuv run scripts/bench_macos_hotkey_latency.py --repetitions 50 --warmups 5 --scenario stopLocal Install Smoke Test
Regenerated
~/bin/transclip-toggle, restarted the TransClip service, kicked the macOS hotkey LaunchAgent, and confirmed localtransclip statusreports ready.