Running Gemma 4 locally on Mac: Benchmarking Qxotic Jinfer, llama.cpp, MLX, and connecting Java 25 with LangChain4j
As a Java developer, integrating Large Language Models (LLMs) into applications is becoming a core requirement. While cloud APIs like Google Gemini, Anthropic’s Claude, or OpenAI’s GPT are convenient, running models locally on my machine offers lower latency, zero API costs, privacy, and full control over system telemetry. I can even run models disconnected from the internet, when I’m travelling in a train or a plane!
When Google released Gemma 4, I wanted to find the best way to run Gemma 4 locally on my Apple Silicon Mac (equipped with 48GB of unified RAM) and consume it seamlessly from Java 25 using LangChain4j.
Read more...