Open Source Models
Qwen 2.5 vs. Gemma 2 for Local AI on Apple Silicon
Compare Qwen 2.5 and Gemma 2 on Apple Silicon. See how memory, context and quantization differ, and how to test both on your Mac.
What to try
- Compare instruction-tuned variants at the same precision, on the same device and with the same output cap.
- Use a coding task you can run and a summary you can check.
- Record time to first token, peak memory and errors in each answer.
If Qwen and Gemma both fit on your Mac, the useful question is which one handles your work better. This comparison focuses on Qwen 2.5 and Gemma 2, two specific generations whose model documentation explains how attention and memory differ.
How Qwen 2.5 and Gemma 2 handle context
Both families keep information about previous tokens in a KV cache. Gemma 2 alternates local and global attention layers. This helps explain the architecture, while actual memory use depends on how the runtime stores and trims the cache. Gemma 2 technical report
To try a smaller variant, start with the Qwen 2.5 guide for iPhone.
How much memory each variant needs
Compare a specific file from each family. Parameter count, precision and format all affect weight size. Chat memory also includes the cache and runtime allocations. The Qwen2.5-3B-Instruct model card identifies the variant, advertised context and license.
If you plan to try Gemma on mobile, see how to choose a Gemma 2 variant for iPhone.
What changes at 4 bits
Quantization reduces the space needed for weights. Two 4-bit conversions can use different formats, so check the file and runtime you intend to use. To assess quality, try a case where a wrong name, number or formatting instruction is easy to spot.
To isolate that change, try the same model at 4 and 8 bits.
How to compare speed and memory on your Mac
Use the same device and runtime, comparable input lengths and the same output cap. Separate the wait for the first token from the rate at which the rest of the answer appears. Record peak memory and repeat after several turns.
Because autoregressive token generation is strictly bound by memory transfer speed, consult our analysis of memory bandwidth limits for local LLMs.
Which model suits the task
For coding, try a short function and run it. For summaries, use a text with facts you can check. If you need JSON, validate the output against your real schema. A model can do well on one task and struggle with another.
If you are comparing coding suggestions, try these checks for local coding assistants.
How to start with a local model
Check that your app supports the exact architecture and format. Start with an instruction-tuned variant that leaves room for context. If both fit, keep the one that gives you usable answers with fewer corrections.
Check the Lapis model catalogue for variants available on your device.
Sources and references
- Qwen2.5-3B-Instruct model card
Qwen Team
- Gemma 2: Improving Open Language Models at a Practical Size
Gemma Team, Google DeepMind (arXiv:2408.00118, 2024)
- Qwen2.5 Technical Report
Qwen Team, Alibaba Group (arXiv:2412.15115, 2024)
- MLX: Efficient Machine Learning on Apple Silicon
A. Hannun, J. Digani, A. Katharopoulos, R. Collobert (Apple Machine Learning Research, 2023)
- Roofline: An Insightful Visual Performance Model for Multicore Architectures
Samuel Williams, Andrew Waterman and David Patterson, Communications of the ACM (2009)
- Metal Shading Language and Compute Management on Apple Silicon
Apple Developer Documentation (Platform Architecture, 2024)
Local execution with Lapis
Chat with compatible models on iPhone, iPad and Mac. Download them once and use local inference offline; model size depends on your device’s resources.