{"type":"post","id":"optimising-on-device-inference-for-apple-silicon-f4ec68","slug":"optimising-on-device-inference-for-apple-silicon-f4ec68","title":"Optimising On-Device Inference for Apple Silicon","description":"Perplexity describes Lily as a lightweight inference engine built specifically for Apple Silicon and Qwen3.6-35B-A3B.","retrieval_nugget":"Perplexity describes Lily as a lightweight inference engine built specifically for Apple Silicon and Qwen3.6-35B-A3B.","published_at":"2026-11-27","updated_at":"2026-11-27","record_date":"2026-11-27","date_kind":"published_at","topics":["inference"],"entities":["Perplexity","Lily","Qwen3.6-35B-A3B","MLX-LM","Apple"],"related_patterns":["harness-architecture-outlives-model-choice"],"novelty_label":"new_fact","what_changed":"Perplexity details Lily’s optimized on-device inference for Apple Silicon using Qwen3.6-35B-A3B and MLX-LM.","prior_refs":["https://newruntime.com/posts/perplexity-computer-now-runs-fully-local-on-apple-c23b92/"],"source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","source_urls":["https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon"],"production":{"schema":"newruntime-production-v1","desk":"newsroom","first_seen_at":"2026-11-27T19:21:52.129Z","independent_sources":1,"notes_synthesized":null,"writer_model":"gpt-6-luna","critic":null,"checks":["primary_source_verified","source_fresh","one_story","copy_contract"],"novelty":{"label":"new_fact","confidence":"medium"},"editorial_value":"high","human_review":"selective"},"citations":[{"claim":"","quotes":["Lily, our lightweight local inference engine, is built specifically for Apple silicon and Qwen3.6-35B-A3B, with separate optimisations for prefill and decode. A standalone demo is publicly available on GitHub."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=Lily%2C%20our%20lightweight%20local%20inference%20engine%2C%20is%20built%20specifically%20for%20Apple%20silicon%20and%20Qwen3.6%2D35B%2DA3B%2C%20with%20separate%20optimisations%20for%20prefill%20and%20decode.%20A%20standalone%20demo%20is%20publicly%20available%20on%20GitHub.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"Lily uses custom Metal kernels for Qwen-specific operations, with neither PyTorch nor MLX in its execution path.","quotes":["A Rust runtime loads the model checkpoint and manages the session state and generation loop, an OpenAI-compatible chat-completions API accepts requests and streams tokens, and custom Metal kernels execute Qwen-specific operations."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=A%20Rust%20runtime%20loads%20the%20model%20checkpoint%20and%20manages%20the%20session%20state%20and%20generation%20loop%2C%20an%20OpenAI%2Dcompatible%20chat%2Dcompletions%20API%20accepts%20requests%20and%20streams%20tokens%2C%20and%20custom%20Metal%20kernels%20execute%20Qwen%2Dspecific%20operations.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"","quotes":["A Rust runtime loads the model checkpoint and manages the session state and generation loop, an OpenAI-compatible chat-completions API accepts requests and streams tokens, and custom Metal kernels execute Qwen-specific operations.","Neither PyTorch nor MLX is in the execution path."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=A%20Rust%20runtime%20loads%20the%20model%20checkpoint%20and%20manages%20the%20session%20state%20and%20generation%20loop%2C%20an%20OpenAI%2Dcompatible%20chat%2Dcompletions%20API%20accepts%20requests%20and%20streams%20tokens%2C%20and%20custom%20Metal%20kernels%20execute%20Qwen%2Dspecific%20operations.&text=Neither%20PyTorch%20nor%20MLX%20is%20in%20the%20execution%20path.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"Perplexity contrasts this model-specific approach with MLX and MLX-LM’s general-purpose local inference stack.","quotes":["Lily, our lightweight local inference engine, is built specifically for Apple silicon and Qwen3.6-35B-A3B, with separate optimisations for prefill and decode. A standalone demo is publicly available on GitHub.","Match the GPU path to the inference phase. Use matrix-oriented execution when prefill can reuse weights across many rows, and vector-oriented execution when batch-1 decode processes one row at a time."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=Lily%2C%20our%20lightweight%20local%20inference%20engine%2C%20is%20built%20specifically%20for%20Apple%20silicon%20and%20Qwen3.6%2D35B%2DA3B%2C%20with%20separate%20optimisations%20for%20prefill%20and%20decode.%20A%20standalone%20demo%20is%20publicly%20available%20on%20GitHub.&text=Match%20the%20GPU%20path%20to%20the%20inference%20phase.%20Use%20matrix%2Doriented%20execution%20when%20prefill%20can%20reuse%20weights%20across%20many%20rows%2C%20and%20vector%2Doriented%20execution%20when%20batch%2D1%20decode%20processes%20one%20row%20at%20a%20time.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"","quotes":["MLX-LM already selects optimised kernels … around the model’s fixed structure.","MLX-LM’s Qwen implementation already groups expert work, evaluates Gated DeltaNet with a fused recurrent Metal kernel, and uses GQA-aware attention."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=MLX%2DLM%20already%20selects%20optimised%20kernels,around%20the%20model%E2%80%99s%20fixed%20structure.&text=MLX%2DLM%E2%80%99s%20Qwen%20implementation%20already%20groups%20expert%20work%2C%20evaluates%20Gated%20DeltaNet%20with%20a%20fused%20recurrent%20Metal%20kernel%2C%20and%20uses%20GQA%2Daware%20attention.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"Prefill measures prompt-processing speed; decode measures output-token generation speed.","quotes":["We benchmark Qwen3.6-35B-A3B on a single MacBook Pro powered by an M5 Max with a 40-core GPU and 128 GB of unified memory.","Across ten prompt lengths for prefill and ten context lengths for decode, from 256 to 128K tokens (K = 1,024), the engine averages 1.22× MLX-LM’s prefill throughput and 1.32× its decode throughput."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=We%20benchmark%20Qwen3.6%2D35B%2DA3B%20on%20a%20single%20MacBook%20Pro%20powered%20by%20an%20M5%20Max%20with%20a%2040%2Dcore%20GPU%20and%20128%20GB%20of%20unified%20memory.&text=Across%20ten%20prompt%20lengths%20for%20prefill%20and%20ten%20context%20lengths%20for%20decode%2C%20from%20256%20to%20128K%20tokens%20%28K%20%3D%201%2C024%29%2C%20the%20engine%20averages%201.22%C3%97%20MLX%2DLM%E2%80%99s%20prefill%20throughput%20and%201.32%C3%97%20its%20decode%20throughput.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"At a 4K-token prompt, it measured 5,749.9 prefill tokens/s for Lily versus 4,737.5 for MLX-LM; at a 4K-token decode context, 186.6 versus 140.9 tokens/s.","quotes":["In Perplexity’s tests on a MacBook Pro with an M5 Max, Lily averaged 1.22 times MLX-LM’s prompt-processing throughput and 1.32 times its generation throughput across ten lengths from 256 to 128K tokens."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=In%20Perplexity%E2%80%99s%20tests%20on%20a%20MacBook%20Pro%20with%20an%20M5%20Max%2C%20Lily%20averaged%201.22%20times%20MLX%2DLM%E2%80%99s%20prompt%2Dprocessing%20throughput%20and%201.32%20times%20its%20generation%20throughput%20across%20ten%20lengths%20from%20256%20to%20128K%20tokens.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"","quotes":["At a 4K-token prompt and a 4K-token decode context, the custom engine reaches 5,749.9 prefill tokens per second and 186.6 decode tokens per second, compared with 4,737.5 and 140.9 for MLX-LM."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=At%20a%204K%2Dtoken%20prompt%20and%20a%204K%2Dtoken%20decode%20context%2C%20the%20custom%20engine%20reaches%205%2C749.9%20prefill%20tokens%20per%20second%20and%20186.6%20decode%20tokens%20per%20second%2C%20compared%20with%204%2C737.5%20and%20140.9%20for%20MLX%2DLM.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"That sits alongside its previously reported work on fully local Perplexity Computer for Apple silicon Macs, where the model and agent run on-device.","quotes":["Hybrid Compute on Apple silicon orchestrates a task between frontier intelligence in the cloud and a local model on the Mac. Cloud models handle research and reasoning, while a local model works with private files and apps on the Mac."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=Hybrid%20Compute%20on%20Apple%20silicon%20orchestrates%20a%20task%20between%20frontier%20intelligence%20in%20the%20cloud%20and%20a%20local%20model%20on%20the%20Mac.%20Cloud%20models%20handle%20research%20and%20reasoning%2C%20while%20a%20local%20model%20works%20with%20private%20files%20and%20apps%20on%20the%20Mac.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"},{"claim":"","quotes":["We benchmark Qwen3.6-35B-A3B on a single MacBook Pro powered by an M5 Max with a 40-core GPU and 128 GB of unified memory.","Across ten prompt lengths for prefill and ten context lengths for decode, from 256 to 128K tokens (K = 1,024), the engine averages 1.22× MLX-LM’s prefill throughput and 1.32× its decode throughput.","In Perplexity’s tests on a MacBook Pro with an M5 Max, Lily averaged 1.22 times MLX-LM’s prompt-processing throughput and 1.32 times its generation throughput across ten lengths from 256 to 128K tokens."],"cite_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon#:~:text=We%20benchmark%20Qwen3.6%2D35B%2DA3B%20on%20a%20single%20MacBook%20Pro%20powered%20by%20an%20M5%20Max%20with%20a%2040%2Dcore%20GPU%20and%20128%20GB%20of%20unified%20memory.&text=Across%20ten%20prompt%20lengths%20for%20prefill%20and%20ten%20context%20lengths%20for%20decode%2C%20from%20256%20to%20128K%20tokens%20%28K%20%3D%201%2C024%29%2C%20the%20engine%20averages%201.22%C3%97%20MLX%2DLM%E2%80%99s%20prefill%20throughput%20and%201.32%C3%97%20its%20decode%20throughput.&text=In%20Perplexity%E2%80%99s%20tests%20on%20a%20MacBook%20Pro%20with%20an%20M5%20Max%2C%20Lily%20averaged%201.22%20times%20MLX%2DLM%E2%80%99s%20prompt%2Dprocessing%20throughput%20and%201.32%20times%20its%20generation%20throughput%20across%20ten%20lengths%20from%20256%20to%20128K%20tokens.","source_url":"https://www.perplexity.ai/en-GB/hub/blog/optimizing-on-device-inference-for-apple-silicon","publisher":"perplexity.ai"}],"schema_version":"newruntime-agent-readable-v0.2","stable_id":"post:optimising-on-device-inference-for-apple-silicon-f4ec68","status":"published","visuals":[],"editor":{"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]},"routes":{"html":"https://newruntime.com/posts/optimising-on-device-inference-for-apple-silicon-f4ec68/","markdown":"https://newruntime.com/posts/optimising-on-device-inference-for-apple-silicon-f4ec68.md","json":"https://newruntime.com/posts/optimising-on-device-inference-for-apple-silicon-f4ec68.json"},"markdown_url":"https://newruntime.com/posts/optimising-on-device-inference-for-apple-silicon-f4ec68.md","next_reads":[{"type":"topic","path":"/topics/inference/","url":"https://newruntime.com/topics/inference/","title":"Inference","reason":"Explore the inference topic hub.","media_type":"text/html","markdown_url":"https://newruntime.com/topics/inference.md","json_url":"https://newruntime.com/topics/inference.json"},{"type":"collection","path":"/posts/","url":"https://newruntime.com/posts/","title":"Field Notes","reason":"Open the latest editorial analysis.","media_type":"text/html","json_url":"https://newruntime.com/posts.json"},{"type":"collection","path":"/sources/","url":"https://newruntime.com/sources/","title":"Sources","reason":"See the original sources this archive cites.","media_type":"text/html"}]}
