Run Hermes Agent with local Gemma 4 and llama.cpp on macOS
Introduction
Explore the local agent architecture on macOS
Build llama.cpp from source for macOS
Download and benchmark Gemma 4 E4B on macOS
Serve Gemma 4 E4B with a 64K context window
Install and configure Nous Research Hermes Agent
Validate Hermes Agent code fixing on macOS
Next Steps
Run Hermes Agent with local Gemma 4 and llama.cpp on macOS
Review frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Compare
pp512 prompt processing and tg128 token generation in the llama-bench results. Use -ngl 99 for Metal and -ngl 0 for the CPU baseline. Set -t to your performance-core count, then compare your results with the Apple M4 Pro reference table.Bind
llama-server to 127.0.0.1:8080 and set -c 65536 for the 64K context window. Use --jinja for structured tool calls, -ngl 99 for Metal offload, and --cache-type-k q8_0 --cache-type-v q8_0 for the quantized KV cache.From
~/hermes-gemma4/llama.cpp, download the Q4_0 GGUF file from ggml-org/gemma-4-E4B-it-GGUF into ./models/.Press Ctrl+C when the Hermes Agent Setup Wizard asks you to sign in or select a cloud provider. With
hermes config set, set model.provider to local, model.base_url to http://127.0.0.1:8080/v1, and model.default to ./models/gemma-4-E4B-it-Q4_0.gguf.Check that
llama-server is running and that /v1/models reports the model ID configured in model.default. Verify that model.base_url points to http://127.0.0.1:8080/v1. For tool calls, check -c 65536 and --jinja. If long requests time out, set HERMES_API_TIMEOUT=1800 in ~/.hermes/.env.