← Projects

Gemma on Apple Silicon

Local inference notes for a 16 GB M2 MacBook, with a small Gemma model and Ollama.

This experiment looks at local document extraction on a 16 GB M2 MacBook. The hardware constraint includes the operating system, model weights, context cache, and the rest of the application.

No repeatable memory, latency, extraction-accuracy, or fine-tuning results are published here.

Start with an explicit model tag

Google’s Ollama guide lists gemma4:e2b and gemma4:e4b among the available variants. Use the same tag for download and execution:

Terminal window
ollama pull gemma4:e4b
ollama run gemma4:e4b
ollama ps

Record the Ollama version, model digest, quantization, and context length. A model tag can change over time.

Check memory pressure during a representative request, including a long input. A successful model load does not establish that the full workload fits comfortably in memory.

Test extraction

Use a small set of documents with manually checked fields. Include missing values, poor scans, rotated pages, and similar-looking identifiers.

Request a defined output schema, then validate types, required fields, and source values in code. Measure field accuracy and failed parses separately.

Use synthetic or approved sample documents during setup. Local inference still leaves inputs, logs, and temporary files to manage.

Fine-tuning

LoRA remains a separate line of work. Inference support in Ollama does not establish that a training framework supports the same model on Metal.

Check the training backend, model format, adapter export, and memory requirements before choosing that workflow. Keep a held-out document set for evaluation.

References

Technologies: Gemma 4, Ollama, Apple Silicon.