A practical guide to running Google's Gemma 4 model locally using five different runtimes: Ollama (simple CLI setup with OpenAI-compatible API), llama.cpp (GGUF-based inference with fine-grained control), MLX (optimized for Apple Silicon), LM Studio (graphical desktop interface), and Transformers.js (JavaScript/Node.js with ONNX models). Each section covers installation, model download, text and multimodal inference, and API server setup. A comparison section helps developers choose the right runtime based on their workflow, hardware, and use case.
Table of contents
Running Gemma 4 Locally: Ollama, llama.cpp, MLX, and MoreRunning Gemma 4 with Ollama for Local AI InferenceRunning Gemma 4 with llama.cpp and GGUF ModelsRunning Gemma 4 with MLX on Apple Silicon MacsRunning Gemma 4 with LM Studio’s Desktop AppRunning Gemma 4 Locally with Transformers.jsChoosing the Right Runtime for Running Gemma 4 LocallySummary11 Impressions