Gemma4 with audio input: 16.8 tok/s on Macbook M2 Max 64GB
retained text
<!-- SC_OFF --><div class="md"><p>Here's the setup I decided on for embedding gemma4-12b into a Tauri2 desktop app:</p> <ul> <li>Native Rust FFI into llama.cpp via <code>llama-cpp-2</code> (Metal enabled)</li> <li>Model:<code>gemma-4-12b-it-Q5_K_S</code> quantized by Unsloth, Q5_K - Small</li> <li>Audio input is a 607 KB 16-bit mono 16 kHz PCM WAV.</li> <li>Prompt path: Gemma chat template + llama.cpp mtmd (multimodal) audio marker, with prompt of "Transcribe this audio exactly."</li> <li>Benchmark input: 503 multimodal tokens/positions, including 486 audio tokens.</li> </ul> <p>I'm not very well versed on model benchmarking, but it appears to be giving <strong>16.8 tok/sec first-inference performance</strong>, model already loaded. The total-path speed breaks down as 2s for audio/prefill plus 3.7s for decode, with decode alone at 26 tok/s. </p> <p>Does that seem like a reasonable level of performance? Any suggestions on how to speed up the inference?</p> <p>Other approaches I considered:</p> <ul> <li><code>mlx-swift-lm</code>, but I need audio support, and it doesn't seem to be supported (filed issue #393)</li> <li><code>llama-server</code> in a sidecar, but that seemed harder to manage the lifecycle</li> <li><code>crabnebula-dev/tauri-plugin-llm</code>, but I don't think it supports gemma4 (filed issue #22) </li> </ul> <p>The inference and benchmark test code is available in this prototyping-only repo: <a href="https://github.com/tleyden/tauri2-local-llm">https://github.com/tleyden/tauri2-local-llm</a></p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/tleyden"> /u/tleyden </a> <br /> <span><a href="https://www.reddit.com/r/LocalLLaMA/comments/1un9cjq/gemma4_with_audio_input_168_toks_on_macbook_m2/">[link]</a></span>   <span><a href="https://www.reddit.com/r/LocalLLaMA/comments/1un9cjq/gemma4_with_audio_input_168_toks_on_macbook_m2/">[comments]</a></span>
document fetched 2026-07-05 08:45 · canonical https://reddit.com/r/LocalLLaMA/comments/1un9cjq/gemma4_with_audio_input_168_toks_on_macbook_m2